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
Update Windows build batch scripts #66106
Comments
I am aware of a few open issues with the build scripts provided for Windows (both the Tools/buildbot scripts and the .bat files provided in PCbuild), such as bpo-9973 and bpo-9822, and there are some other issues that bother me but that I haven't opened issues for. Here's a patch which takes care of all of the issues I'm aware of, by almost completely rewriting most of the scripts. An overview of the changes:
I think these changes make things simpler, with fewer places to update when options are changed, compilers upgraded, libraries updated, etc. With this change, the simplest way to build on Windows becomes "PCbuild\build.bat -e" (or add "-d" for debug). This is still not exactly what I want eventually (see bpo-16895, which is now long out of date :), but is a solid step in that direction. Most of these changes could be backported to 3.4, and at least a good portion of those to 2.7. I'm not exactly sure how worth it that would be, though. Thoughts? |
Here's the devguide patch. |
Looks pretty good. I'm happy to see more move into PCBuild - ideally, people building a Python release should never have to look anywhere else. buildmsi.bat can probably go away completely if the buildbots aren't using it. 3.5 will eventually have a .wixproj to build the MSI and there'll be a buildrelease.bat or similar under tools/ to keep the single entry point. As part of the VC14 change there'll be changes to the batch files, but as far as entry points go they'll still be there. I want to move most of the functionality into an MSBuild script (currently pcbuild.proj in my sandbox) since that is generally more flexible than cmd.exe, but until then this looks like a great improvement. Not quite the 'make' equivalent you have in bpo-16895, but that will be easy to write when "make (\w+)" translates into "msbuild pcbuild.proj /t:\1". I don't see any value in backporting to 2.7. I've got my own scripts for that which make doing a release very straightforward, and I'm happy to keep it that way. That said, the easier we make it for people to build from source, the sooner we can stop doing binary releases for 2.7. Consider me +0.5 on taking this change, but it's only less than +1 because I'm already working on the next major iteration and so *I* don't need them. |
All fine with me. As for buildmsi.bat: note that we used to have a "daily msi" builder that was using the script. It took too much effort to keep it running. |
With a vote and a half in favor, I'll go ahead with this probably later today. There is one change needed to the I'll leave buildmsi.bat in place for now; I'm interested in trying to resurrect the daily MSI builder some day. Possibly not before Steve converts us to WIX :) |
New changeset c3022e2606df by Zachary Ware in branch 'default': |
New changeset ed3fa77804f8 by Zachary Ware in branch 'default': |
New changeset f0a5be139717 by Zachary Ware in branch 'default': |
New changeset 06589e81fd56 by Zachary Ware in branch 'default': |
The XP buildbot seems to have choked on this change, I suspect because of the 'clean' script exiting with a non-zero error code. I'm not certain why it can't recover, though. David, can you tell what's going on with it? |
Interesting - it's got a "Visual Studio Just-In-Time Debugger" dialog on the screen for an unhandled win32 exception in the compiler (cl.exe). That's a dialog my pop-up AutoIt script wasn't expecting, so I've added it to the other (RTL error) checks, and it'll clear automatically going forward. But I'm not sure what triggered the error. -- David |
Ok, the last spurt of exceptions on the XP buildbot in the 3.x branch were all related to the fact that somehow the .hg folder in the 3.x branch build tree was missing. The rest of the build files seemed present. I've removed the build tree completely to let a new checkout take place and restarted the most recent build. There does also appear to have been a test file beneath the build tree that the new clean script couldn't remove (build/test_python_580/@test_580_tmp-?L???.py). I was able to remove it myself interactively from cmd.exe, but I've had problems like this myself when cleaning up temp files on the buildbots sometimes, and believe it has something to do with filename character encodings, depending on the tool being used to reference the file. That might explain the non-zero error on XP though, and I agree that making sure such failures don't propagate seems right. -- David |
I'm seeing an apparent side-effect of the new clean script (or it seems to correlate). Since it started running, the Windows buildbots (both 7 and XP) seem to always perform a full clone of the master repository for each build rather than just a pull/update. That's a noticeable performance difference (15-20 minutes per clone rather than the more typical 1-2 minutes for pull/update) and seems like it should be unnecessary. I'm not quite sure how the buildbot task makes the decision between the two approaches, but could the new clean be removing a file that's relevant to how the decision is made? |
Thanks for getting the XP bot running again, it looks like it's now having issues with how the tests are now run (some issue with how sys.stdin is set up in a subprocess); I'm not sure if that should be fixed by reverting back to not using run_tests.py, or fixing stdin in a subprocess on XP (which is now officially unsupported by 3.5 anyway...). As for the fact that your bots are now doing full clones instead of pulls is disturbing and must be fixed, but I'm not sure how that happened. The AMD64 Windows 7 bot is still doing pulls, so the new clean script shouldn't be a problem. Do you have any insight into what happened on the x86 Win7 bot's build 8503[1]? That should have been the first build with this issue's changes, but it didn't even try to update at all. Build 10744[2] on the XP bot seems to have tried to clobber the build directory on update after a successful clean on the previous build, which doesn't make sense to me either (though the 'test' step did time out, which might play into it). [1] http://buildbot.python.org/all/builders/x86%20Windows7%203.x/builds/8503 |
A couple of issues:
With these changes build_pgo.bat works. |
As you can probably tell, I wasn't on a machine where I could test build_pgo.bat before I committed changes to it (oops). It looks like your patch is reversed, would you mind fixing it? I can tell you it will need to change, though; build.bat needs to use 'x86_amd64' for the argument to vcvarsall.bat for building 64-bit to support cross-compiling on 32-bit Windows. It may work out easiest for build_pgo.bat to just not use build.bat. |
This should now be the correct way. |
Does this render the patch against build_pgo.bat on bpo-17667 obsolete? |
New changeset 60c61ea64021 by Zachary Ware in branch 'default': |
New changeset 4c1d543135ef by Zachary Ware in branch 'default': |
While troubleshooting an issue with test_distutils consistently failing on my XP buildbot, I narrowed it down to the test.bat change to use run_tests.py. I don't yet know fully what's happening, but after replacing the new test.bat with the older version (that calls rt.bat) everything works fine. Doing so also appears to clean up the stdin encoding problem (which was causing a consistent failure in test_capi). As suggested by Zachary in msg222621, and given the status of XP going forward, I think it may be best, at least for now, to revert back to the traditional test.bat/rt.bat combination under XP, which has been stable for a long time. At least until some further work can be done to discover what's happening with the new approach, assuming it's desired at some point under XP. Attached is a simple test.bat update that reverts to the older rt.bat approach but only under XP. |
New changeset f592a4073672 by Zachary Ware in branch 'default': |
New changeset 1d5485471457 by Zachary Ware in branch 'default': |
After the last round of changes, the buildbots appear to be mostly happy. If anybody else wants to backport the changes, I'd be happy to review and commit, but I'll leave the backporting itself to whoever wants to do it. In the meantime, closing the issue. |
Just thought I'd add a note here that after the most recent changes, my buildbots also appear to be back to quicker hg pulls rather than clones at the start of the process (see msg222592). Still not sure why that behavior changed, but we're back to the previous behavior. |
New changeset 4890a55c62ab by Zachary Ware in branch '2.7': New changeset a6ceb631c747 by Zachary Ware in branch '3.4': New changeset e6a95bda2943 by Zachary Ware in branch '3.5': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: