Skip to content

Arduino exe now found on windows #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 5, 2018

Conversation

tomduff
Copy link
Contributor

@tomduff tomduff commented May 4, 2018

Changes:

  • Updated arduino self.existing_executable function to find exe
  • Added compilers to .arduino-ci.yaml so that build runs

With the updated code and g++ on the path the DoSomething example appears to run as as expected.

It is a bit clunky because the ide splash pops up all the time, can this be supressed? I guess not as the the comand line docs here don't seem to mention it.

Updated arduino self.existing_executable function to find exe
Added compilers to .arduino-ci.yaml so that build runs
@per1234
Copy link
Contributor

per1234 commented May 4, 2018

Try running arduino_debug.exe instead of arduino.exe. That should solve the splash issue.

tomduff added 4 commits May 4, 2018 17:21
Can't seem to install rubocop locally hence this may take a few pushes to resolve
Another attempt to sort the rubocop errors (can you guess I don't really know ruby?)
Hopefully got rid of the last offense
Switched to arduino_debug exe to supress the pop up - runs much quicker now.
@tomduff
Copy link
Contributor Author

tomduff commented May 4, 2018

arduino_debug.exe works much better
Thanks

tomduff added 4 commits May 4, 2018 17:53
Added error handling around the reg lookup so that it does not just bomb out and runs to the force install function.
I really need to work out how to get rubocop running locally.
@tomduff
Copy link
Contributor Author

tomduff commented May 4, 2018

Ok current state is as follows:

  • if arduino ide is installed on windows (and g++ is on the path) the tests run just fine
  • if no ardunio ide is installed on windows it fails in the force install function

tomduff added 5 commits May 5, 2018 08:58
* Pulled package using open uri
* Changed move to remove additional folder depth
* Cleaned up extraction folder and zip after use
* Added a few additional puts outputs to help see what is going on
* Probably introduced a stack of rubocop errors
Corrected the incorrect reg key used to allow testing of force download
The ssl errors only appear on travis so I have switched to http for now to see if everything else works
@tomduff
Copy link
Contributor Author

tomduff commented May 5, 2018

I think everything related to executing a ci run on windows works:

  • An existing arduino ide install on windows can be found
  • A force install of arduino ide successfully downloads, extracts and 'installs'
  • A test run successfully executes the tests cases with the expected results.

The only issue is that for force downloading of the ide to work on Appveyor ssl verification needs to be disabled. This was not required to enable it to work locally on a windows box. Perhaps the relevant code can be updated to try without verification only if running on Appveyor?

The only failures in the Appveyor build all come from the rb specs that execute at the very end. I am not sure if these are valid on windows. If they are perhaps they can captured as a different issue?

I'd be keen to get these changes into master so we can use this locally on a windows environment without having to work from the source.

@ianfixes
Copy link
Collaborator

ianfixes commented May 5, 2018

I'm just catching up to this now, and my immediate concern is whether this is based on my 2018-04-25_windows_ci branch from #39 ... If not, I will see about pulling your logic into that new class structure.

@@ -11,3 +11,5 @@ unittest:
- uno
- due
- leonardo
compilers:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this line is necessary to make things work, please open an issue for that... the compilers setting should be automatically inherited from https://github.com/ianfixes/arduino_ci/blob/master/misc/default.yml#L83-L84

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. That is what I thought originally until I spotted TestSomething had it explicitly defined so I assumed it must have been a misunderstanding on my part. Note that this behaviour is the same on Windows and Linux. I'll raise an issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue #44 raised

@tomduff
Copy link
Contributor Author

tomduff commented May 5, 2018

Yes, these changes were branched from 2018-04-25_windows_ci and the pull request aims to merge it back to that branch.

@ianfixes
Copy link
Collaborator

ianfixes commented May 5, 2018

the pull request aims to merge it back to that branch

Yup, sorry. Noticed that shortly after my first message, but the kids woke up :)

@@ -58,7 +68,11 @@ def extracter
# Extract the package_file to extracted_file
# @return [bool] whether successful
def extract
powershell("Expand-Archive", package_file, "-dest", extracted_file)
puts 'Extracting ' + package_file + " to " + extracted_file
powershell("Expand-Archive", "-Path", package_file, "-DestinationPath", extracted_file)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to mute the output from this command? It dominates the build log https://ci.appveyor.com/project/ianfixes/arduino-ci/build/1.0.31#L144

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't see any flags in the powershell command definition although it suggests there might be common parameters. Standard suggestions on google appear to be to pipe to null. I just pushed up a version with this but it looks like you have merged already so I am not sure if that was included or not.

Note - This doesn't happen when run locally, you just get a nice nice progress bar:
[oooooooooooo........................................ ]

I did wonder if both extract and move could be done using a ruby dependency rather than powershell, but my ruby knowledge is minimal to none.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Putting those in pure ruby is probably the right way to go. I more or less ported the install.sh script from Adafruit to boostrap this project... so now that it looks like I'm headed for cross-platform fun (beyond my most ambitious expectations, honestly, in a good way!), I will plan to take a closer look at that.

Of course, having working cross-platform CI is a great enabler for that kind of thing in the first place... so I can't thank you enough for your help here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I cherry-picked your commit with no problems. Thanks

@ianfixes
Copy link
Collaborator

ianfixes commented May 5, 2018

Thanks for checking this out, btw. I can't imagine the number of weeks of trial and error this saved me!

@ianfixes
Copy link
Collaborator

ianfixes commented May 5, 2018

I'm going to merge this now as it's a huge step forward. However, I'm going to delay merging ianfixes:2018-04-25_windows_ci into master until I get the following fixed:

  • Silence the output from the extract command on windows
  • Disable 2 of the xvfb tests that fail in rspec, they should only be running on Linux hosts
  • Fix the unit test that's failing due to a compile error: String vs long long int -- that should be a short fix if I can figure out whether it's related to an #include on Windows or just a missing entry in String.h for 64-bit host stuff.
  • Fix the failing test of random()
    ok 1 - assertEqual 4294967292 == x
    not ok 2 - assertEqual 83 == x
      ---
      operator: ==
      expected: 83
      actual: 87
      at:
        file: C:/projects/arduino-ci/SampleProjects/TestSomething/test/godmode.cpp
        line: 25
      ...
    not ok 3 - assertEqual 74 == x
      ---
      operator: ==
      expected: 74
      actual: 82
      at:
        file: C:/projects/arduino-ci/SampleProjects/TestSomething/test/godmode.cpp
        line: 27
      ...
    1..3
not ok 2 - random
# Subtest: interrupts

@ianfixes ianfixes merged commit 6656efd into Arduino-CI:2018-04-25_windows_ci May 5, 2018
ianfixes pushed a commit that referenced this pull request May 6, 2018
Windows compilation support

* Updated arduino self.existing_executable function to find arduino_debug.exe
* Added compilers to .arduino-ci.yaml so that build runs
* Added error handling around the reg lookup so that it does not just bomb out and runs to the force install function.
* Corrected the incorrect reg key used to allow testing of force download
* Switched to http for downloads to avoid ssl error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants