Skip to content

build: explicitly specify python interpreter #222

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

Merged
merged 1 commit into from
Jun 2, 2020

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented Jun 2, 2020

This ensures that the build system can control the python interpreter
rather than relying on the PATH or the shebang.

This ensures that the build system can control the python interpreter
rather than relying on the `PATH` or the shebang.
@compnerd
Copy link
Member Author

compnerd commented Jun 2, 2020

@swift-ci please test

@compnerd
Copy link
Member Author

compnerd commented Jun 2, 2020

CC: @akyrtzi @nathawes

@compnerd
Copy link
Member Author

compnerd commented Jun 2, 2020

This can be merged separately as it has no dependencies on the build system it will simply ensure that the python interpreter used to invoke build-script.py is used to invoke gyb. This allows the build system to control which python is used to build with. Unfortunately, we cannot replicate the exact logic for controlling the behaviour here as we can with Swift as the build system uses a custom python script.

@akyrtzi
Copy link
Contributor

akyrtzi commented Jun 2, 2020

Hmm, this is not enough, in swift-syntax repo we commit the gyb-generated files into the repo.
We'd need another PR, or extra commit in this PR, that updates the generated files (specifically the Sources/SwiftSyntax/gyb_generated/Misc.swift file which contains the hash output), and merge it at the same time as the swiftlang/swift#32127

@compnerd
Copy link
Member Author

compnerd commented Jun 2, 2020

Hmm, lets actually do that in a follow up change that can be committed in sync. master hasn't yet switched to python3 yet.

This is still a bit worrisome since there is no way for us to currently ensure that macOS builds with python3 as there is an issue with some of the builders not finding python3 always (maybe @shahmishal remembers the details here) and we can fallback to python2 if python3 is not found.

@akyrtzi akyrtzi merged commit 997c82c into swiftlang:master Jun 2, 2020
@akyrtzi
Copy link
Contributor

akyrtzi commented Jun 2, 2020

We could potentially pick a specific hash algorithm to make it python version independent.

@shahmishal
Copy link
Member

We should use xcrun python3 to make sure it picks up the right python on macOS hosts

@compnerd compnerd deleted the python-control branch June 2, 2020 23:17
@compnerd
Copy link
Member Author

compnerd commented Jun 2, 2020

@akyrtzi - I like that idea! That certainly would make the transition much simpler. Would you happen to have any specific hash in mind? Would SHA1 be reasonable enough? That is amongst the supported hashes in the Intel SHA extensions enabling a hardware accelerated variant to be implemented on platforms.

@akyrtzi
Copy link
Contributor

akyrtzi commented Jun 2, 2020

have any specific hash in mind? Would SHA1 be reasonable enough?

Any that is available in all platforms would do, SHA1 is fine.

adevress pushed a commit to adevress/swift-syntax that referenced this pull request Jan 14, 2024
Specify the type of decl to rename in AlwaysUseLowerCamelCase.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants