-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
github: Move windows CI builds to GitHub Actions. #10263
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
Conversation
Code size report:
|
913c5b6
to
23e9179
Compare
Code size report:
|
Thanks @dlech this sounds really good. How easy is it to debug failing builds on thr GH Actions Windows infrastructure? One of the near features of Appveyor is that you could RDP into the VM for an hour after the build ran, which was quite handy for scenarios that were difficult to repro locally. |
.github/workflows/ports_windows.yml
Outdated
exclude: | ||
- variant: standard | ||
configuration: Debug | ||
runs-on: windows-2022 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 2022 probably means VS2022 right? Appveyor was still running VS2017 intentionally to make sure we're somewhat backwards compatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, VS2022 is what is installed on this image by default. We can update this to install an older version if needed or even add multiple versions of VS to the build matrix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that this PR's been updated to test 2017, 2019 and 2022. That's great!
The same as Linux I guess. I've always been able to reproduce issues locally so I've never look any farther into it. |
b517bf9
to
fe0bfbb
Compare
Code size report:
|
1 similar comment
Code size report:
|
8f60789
to
034a298
Compare
Code size report:
|
034a298
to
5e2433d
Compare
Code size report:
|
5e2433d
to
05b72fc
Compare
Code size report:
|
05b72fc
to
9515f6c
Compare
Code size report:
|
93f3ede
to
14f33e7
Compare
Code size report:
|
Code size report:
|
Generally I haven't had too much trouble reproducing Linux issues remotely (and with Docker I've been able to very easily replicate the Actions environment). But for Windows this just isn't an option. I do (some of the time) have access to a Windows laptop, but certainly not one with all the different VS versions installed etc. So being able to RDP to the Appveyor instance has been invaluable. |
Seems like it is at least technically possible to do something like this with github actions: https://medium.com/the-scale-factory/troubleshoot-github-actions-via-vpn-3d5d41b01ea4 |
choco install windows-sdk-8.1 | ||
- uses: microsoft/setup-msbuild@v1 | ||
with: | ||
vs-version: ${{ matrix.vs_version }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my information: are these spaces in {{}}
required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so.
- uses: actions/setup-python@v4 | ||
if: matrix.runner == 'windows-2019' | ||
with: | ||
python-version: '3.9' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appveyor used to have 3.8, any reason for 3.9 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It matches the version installed by default in the windows-2022
image.
Overall I like the idea of github actions for everything, but I also think we need at least a POC that remote login is possible. Or even a script on the wiki or so. Especially for mingw builds I've had it more than once that locally things worked ok but then failed on Appveyor because of a slightly different version or so. In which case RDP is usually quicker than trying to reproduce the exact same environment. An alternative would be to make it easier to reproduce the same environment I guess. Maybe a step which prints out versions of everything used explicitly (mingw/gcc/python) ? |
configuration: Debug | ||
runs-on: ${{ matrix.runner }} | ||
steps: | ||
- name: Install Visual Studio 2017 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is rather slow, could this be cached?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing that the installers poke windows registry, so probably not. Maybe there is a way to create a docker container with this pre-installed or something like that?
(It's already still faster than the current appveyor build though)
I was able to successfully log in via RDP with https://github.com/marketplace/actions/debugging-using-reverse-rdp-with-ngrok Since it requires a personal access token and only allows one session at a time, I don't think it makes sense to commit anything here, but to use it. The basic procedure is to delete all of the other workflow files and all of the jobs except for one in the windows workflow file (so there is only one matrix combination left) and add this action as a step wherever it makes sense (may want it before or after other steps depending on where the failure is). Also, don't do what I did and set the step to foreground: true and then shut down the remote windows vm without deleting |
Will need to merge #10267 before this one. |
ports/windows/Makefile
Outdated
ifeq ($(MSYSTEM),MINGW32) | ||
# compliler optimizations break float formatting | ||
# https://github.com/micropython/micropython/pull/10267 | ||
RUN_TESTS_SKIP += -e format_ints_doubleprec -e format_modulo2_intbig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to do the skipping here instead of directly in run_tests.py?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging #10267 will make this change here go away.
I gguess this should be fine. Might also make it easier to publish the executables? |
14f33e7
to
58bf8bf
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #10263 +/- ##
==========================================
+ Coverage 98.36% 98.49% +0.13%
==========================================
Files 159 155 -4
Lines 21093 20528 -565
==========================================
- Hits 20748 20220 -528
+ Misses 345 308 -37 ☔ View full report in Codecov by Sentry. |
It looks like the 2022 builds are failing because of an extra space in the path in the "Get micropython.exe path" step.
There should not be a space between "=" and "D". Since the other VS version builds aren't failing, I'm guessing something must have changed in VS 2022 in the last year since this was working before. I'm pretty sure that is why I put the |
I suppose it could have something to do with a different PowerShell version on the windows-2022 VM too. |
Yes, I'm just trying to fix this now, with the space/Trim. @dlech sorry but I forced pushed to your branch! I also rebased on latest master. |
4b72696
to
e015b8b
Compare
OK, I think this is working now. Needed a small tweak to remove the space between the variable name and the variable value. This new github actions workflow has a lot of jobs... that's mainly due to a large job matrix with different versions of Visual Studio, x86 and x64, debug and release builds. The VS 2017 jobs are very slow, they seem to get stuck on |
3328e36
to
e015b8b
Compare
Maybe we can just exclude VS 2017 builds of the standard variant? That will cut off 2 jobs. Then there's still 4 jobs for VS 2017, all building the dev variant: x86 debug, x86 release, x64 debug, x64 release. |
I would think this is the issue described here yet you fixed this with only one Trim so not sure.
I always opted to keep this in for backwards compatibility, but by now we're like 7 years further so imo VS2017 is not really crucial anymore. For the variants we could for example build the dev one for Debug and Release, and the standard one only for Release? Likewise only build the VS2019 in Release. |
The issue was that pasting text using The fix was to use |
By moving to GitHub actions, all MicroPython CI builds are now on GitHub actions. This allows faster parallel builds and saves time by not building when no relevant files changed. This reveals a few failing tests, so those are temporarily disabled until they can be fixed. Signed-off-by: David Lechner <david@pybricks.com> Signed-off-by: Damien George <damien@micropython.org>
4620347
to
ed15b3c
Compare
This is now merged. And I've disabled (but not deleted, yet) the AppVeyor GitHub webhook. Thanks @dlech for putting this together! |
@dlech do you happen to remember the full story for needing https://github.com/micropython/micropython/blob/master/tests/run-tests.py#L586 and https://github.com/micropython/micropython/blob/master/.github/workflows/ports_windows.yml#L141 ? Sorry I didn't see this when looking at the PR but that "import/import_file.py" test should already have been excluded by https://github.com/micropython/micropython/blob/master/tests/run-tests.py#L701 but somehow the |
IIRC, the MSYS Python is compiled for a POSIX environment and therefore uses Unix line endings instead of Windows line endings (and also explains why os.name is not "nt"). So this is why we need to use the different version of CPython - to get one with Windows line endings so that the generated .exp files match between CPython and MicroPython. We aren't compiling MicroPython for the MSYS environment but just using MSYS for the cross-compiler to target Windows so MicroPython is using Windows line endings. I don't really remember why the import error was different and still broken though. |
Hmm. I really thought run-tests has Anyway the key issue here is that following the windows README for an MSYS2 installation has none of these problems, and its python version does have I'll see if I can get RDP running.. |
Add working_directory for subsequent code file
PR micropython#10263 moved it to only before code.py. This breaks the repl (and likely boot.py.) Fixes micropython#10289
By moving to GitHub actions, all MicroPython CI builds are now on GitHub actions. This allows faster parallel builds and saves time by not building when no relevant files changed.
This reveals a few failing tests, so those are temporarily disabled until they can be fixed.
The
misc_sys_settrace_features.py
is disable on visual studio build because it is failing with:I think we didn't see this one before because Appveyor builds only did a Debug build for the standard variant but now we are only doing Debug build for the dev variant.
The
import/import_file.py
is disabled on msys builds because it is failing with:On the bright side, the failing tests show that the conditional "Print failures" work as expected.