Skip to content
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

Python 3.11.5 to 3.11.6 upgrade fails: vcruntime140.dll not found #110437

Closed
dconnet opened this issue Oct 5, 2023 · 9 comments
Closed

Python 3.11.5 to 3.11.6 upgrade fails: vcruntime140.dll not found #110437

dconnet opened this issue Oct 5, 2023 · 9 comments
Labels
3.11 only security fixes 3.12 bugs and security fixes 3.13 new features, bugs and security fixes OS-windows type-bug An unexpected behavior, bug, or error

Comments

@dconnet
Copy link

dconnet commented Oct 5, 2023

Bug report

Bug description:

While updating 3.11.5 to 3.11.6 using python-3.11.6-amd64.exe, installation fails multiple time while precompiling. This is on a fairly clean up-to-date Win10 system with no Visual Studio. On a system with Visual Studio, the upgrade works.

CPython versions tested on:

3.11

Operating systems tested on:

Windows

Linked PRs

@dconnet dconnet added the type-bug An unexpected behavior, bug, or error label Oct 5, 2023
@zooba
Copy link
Member

zooba commented Oct 5, 2023

You should have a set of log files in your %TEMP% directory. Could you zip them up and attach them to this issue?

@dconnet
Copy link
Author

dconnet commented Oct 5, 2023

These are all the logs (started the upgrade with a clean temp)

InstallLogs.zip

@dconnet
Copy link
Author

dconnet commented Oct 5, 2023

I did forget to note: downloading vc_redist.x64.exe from MS and installing that resolves the issue. (This also affected Windows11 - I have a couple VMs for testing)

@zooba
Copy link
Member

zooba commented Oct 5, 2023

Hmm, it seems like somehow we ended up with an earlier version of vcruntime140.dll in the 3.11.6 release than was in the 3.11.5.

image

Usually this shouldn't matter, because it's the key file and the latest version should be kept, but for some reason it was removed but not reinstalled here.

I haven't got time right now to dig any further, but I'll try and look closer at it tomorrow. Out of interest, if you uninstall 3.11.5 and then install 3.11.6 (i.e. don't do an upgrade), does it install the file?

@dconnet
Copy link
Author

dconnet commented Oct 5, 2023

Another note: Out of curiosity, I tried the 3.12 installer - that worked.

@dconnet
Copy link
Author

dconnet commented Oct 5, 2023

Actually, I had to uninstall 3.11.6 since the install worked - the precompile failure didn't rollback the install.
After uninstalling that and reinstalling, it did work.

@zooba
Copy link
Member

zooba commented Oct 6, 2023

Looks like repairing 3.11.6 will add the file back, but it definitely gets lost in the upgrade process for some reason.

@zooba
Copy link
Member

zooba commented Oct 6, 2023

This blog covers the reasons: https://learn.microsoft.com/en-us/archive/blogs/astebner/why-windows-installer-removes-files-during-a-major-upgrade-if-they-go-backwards-in-version-numbers

It seems that the image used for 3.11.6 replaced toolset v14.36 with v14.37, but our build used v14.35 instead. The image for 3.11.5 had both v14.35 and v14.36, but the build chose the latter. It's always supposed to choose the latest, but apparently it didn't in this case. Most likely an issue on the image.

I think the best option is going to be to manually manage the redistributable files rather than picking them up from the build machine. Now that our build machines are subject to the whims of cloud CI, we clearly can't assume we won't go backwards in version.

zooba added a commit to zooba/cpython that referenced this issue Oct 6, 2023
@zooba zooba added 3.11 only security fixes 3.12 bugs and security fixes 3.13 new features, bugs and security fixes labels Oct 6, 2023
@zooba
Copy link
Member

zooba commented Oct 6, 2023

@pablogsal It's not super urgent, but it would be nice to get a 3.11.7 release out with this fix. I don't think there's a need to trigger a release just for this, but please don't delay the next one.

Also, it'd be great to get a note on the download page, something like:

Due to an installer issue, updating from Python 3.11.5 to 3.11.6 may inadvertently remove some files. If you experience issues, run the 3.11.6 installer again and choose "Repair", or else you can manually install the latest VCRedist from Microsoft.

zooba added a commit to python/release-tools that referenced this issue Oct 6, 2023
Previously we would use whichever was installed on the build machine, which could result in downgrades between releases.
See python/cpython#110437 for more information about what this breaks.
zooba added a commit that referenced this issue Oct 9, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Oct 9, 2023
…ated list of DLLs to bundle (pythonGH-110470)

(cherry picked from commit 12cc679)

Co-authored-by: Steve Dower <steve.dower@python.org>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Oct 9, 2023
…ated list of DLLs to bundle (pythonGH-110470)

(cherry picked from commit 12cc679)

Co-authored-by: Steve Dower <steve.dower@python.org>
zooba added a commit that referenced this issue Oct 9, 2023
…rated list of DLLs to bundle (GH-110470)

gh-110437: Allow overriding VCRuntimeDLL with a semicolon separated list of DLLs to bundle (GH-110470)
(cherry picked from commit 12cc679)

Co-authored-by: Steve Dower <steve.dower@python.org>
zooba added a commit that referenced this issue Oct 9, 2023
…rated list of DLLs to bundle (GH-110470)

gh-110437: Allow overriding VCRuntimeDLL with a semicolon separated list of DLLs to bundle (GH-110470)
(cherry picked from commit 12cc679)

Co-authored-by: Steve Dower <steve.dower@python.org>
@zooba zooba closed this as completed Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes 3.12 bugs and security fixes 3.13 new features, bugs and security fixes OS-windows type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants