This repository was archived by the owner on Jan 23, 2023. It is now read-only.
[release/2.1] Add support for building CoreCLR using python3 #28087
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a combined fix from 3 different PRs and one additional fix for 2.1:
The 2.1-specific fix is that python3 is is only used as a fallback, in case all other python program names dont work.
As for the original PRs, they perform these changes:
build.sh and build.cmd contain logic to identify a working version of python to use. System.Private.CoreLib ignores that and directly invokes'python', which may not work, or even execute a different program. Fix that.
The windows build scripts try finding python in order of python3, python2 and then python. The unix build scripts dont. They just try python2 variants and then fail. This change makes brings them closer together by letting users build using only python3.
Use the same logic in CMakeLists.txt that's used in build.sh/build.cmd to lookup python.