Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
bootloader Windows XP compatibility #2974
This PR address ticket #2876 when using MSVC compiler.
Basically this makes the linker use the option /SUBSYSTEM, with its 4 combinations:
Where 5,01 is used for 32bit arch and 5,02 for 64bit.
I ran a few manual tests which worked ok, if there's some suite, please let me know how to run it.
I'm not sure if for an automated build system, an extra setup (package having support for that platform is required to be installed for MSVC, in that case, please let me know).
htgoebel left a comment
Thanks for this pull-request.
Since this MSVC is a beast, I'm afraid of side-effects. This is why I'm picky about changing things here.
What are these options doing exactly? Why is this safe? Why can I be confident, there are not side-effects? Why is this necessary now, but has not been necessary earlier? You may want proof your statement by pointing we to some 3rd-party explanation.
This is not what I wanted to read :-\ The bootloader needs to build in the VM we are using (and in Appvaor, of course) and I'm not going to test this as long as your are "not sure" (say: have not tested this yourself).
Win XP is end of live for quite some time. So I'm not going to spend much time on this. (Sorry, but I have to be careful with my time).
Please also note that we are not including bootlaoders build by anybody other then the core developers. So please remove them when updating the pull-request.
Also the commit message has to follow the guideline.
I'm looking forward for you explanasion
Thanks for the answer and comments, I'll fix that when have some more time, also let me answer these:
I had two things that wasn't sure about:
First, I seemed to remember that there were necessary two changes to make MSVS compile for XP. The one I've applied (settings the subsystem version specifically for XP or XP/x64). The other part was having an RTM on builder box supporting that. And that's something I don't know about pyinstaller's build bots.
Second, I wasn't sure at all of how to deal with these build compilation system, how these build configs work and theirs clone to make another "setup", so I've tried to do my best. (That's why I've clean-up some variables in case they were reused (as indeed I was having a problem of a setting being specified twice)).
I don't know what you mean with "have not tested this yourself". Because it is clear I don't have access to your build system. And it is also clear I've made the bins on my own and tried them (and other people have tried them too, check the ticket dup of this where I pointed that), and, bad on my part, I've committed them. But, again, I wouldn't be proposing this if didn't work on my side, and the tests ran seems to check it is working (I understand that's not a final word, of course).
Thanks, I'll work on changes you pointed!!!!
I'm sorry for the other PR, I'm a very basic user of git didn't know how to re-use this, and was going to close it in favor of the new one..
However here we are.. I've got the changes working, and I think, the code is what was expected to be.
Let me know whatever I can be helpful for, thanks!
Thanks for the update. I still do not understand what this change does exactly.
I found https://docs.microsoft.com/en-us/cpp/build/reference/subsystem-specify-subsystem, which says: "The choice of subsystem affects the entry point symbol (or entry point function) that the linker will select." Okay, but why do we need 5.01/5.02 for Windows and why this is safe to use for Windows 10 and later, too?
Reading https://stackoverflow.com/questions/30960872/ I assume the following, this sets the minimum version of windows, this application will run on. 50.1 is the value for 32-bit XP, 5.02 for 64-bit XP.
This Stackoverflow-Answer also says Windows 8 SDK only supports development of software down to Windows Vista, for XP SDK 7 is required. So do we need to switch the SDK, too? How is this done ?
Regarding the building the bootloader: Please verify the bootloaders build in our environment. https://pyinstaller.readthedocs.io/en/stable/bootloader-building.html#vagrantfile-virtual-machines should give all information required. Basically it's just:
Python 3.5 cannot be used on Windows XP anyway. I also don't think that this PR, if merged, will do what the author wants it to do: binaries that are compatible with Windows XP will not show up on pypi.
To produce Windows XP binaries, you need to set the platform toolset to
It is required because since VS2012 the default minimal target for VS was setup to Vista (win ver. 6.0).
About the entry-point, it is selected by the /SUBSYSTEM: first argument, CONSOLE or WINDOW as it was used before. One invokes
Yes, that's what the commit says too.
When I was using VS2012 I had to install by hand the SDK, however with the VS2015 I've tested it it wasn't required. However, I'm checking out the vagrant files and testing.. and will let you know.
I'm not sure if you're referring to me but, at least in my case, I'm not doing this for pypi. But anyway, XP will die and isn't supported anymore by a lot of products, and you're completely free to not support it anymore, and not to spend any time for its support.
I'll check the vagrant environment.. I have had not to install anything more than VS2015.. but maybe that's not the case in vagrant's setup.. I'll check that..
Are you completely sure? I've just finish to download the build box images, and tested it wasn't required.
You can see here, there's no error on build, with the subsystem specified. And after that, the dumpbin output (on the left), shows the binary effectively targets the required version.
(I'm sorry I don't know what's the good way to share such an image if required)
Please, contact me if I can be helpful in some way. Thanks.
This is the CONSOLE resp. WINDOWS value. But how does the suffix effect the entry-point? Or will this just become flags in the PE file?
@htgoebel no, the version specified (5.01/5/.02) doesn't change the entry point. Documentation says subsystem (console/gui) does.
Subsystem version changes requested OS version header.
I'm sorry, I mean that was going to check, on vagrant box, if something else was required to build for XP, meaning, an special SDK (as xoviat pointed out), and that wasn't required. Looks like it was only required for some VS2012.