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

Fix invalid shebang for BinaryPaths script #10710

Merged
merged 2 commits into from Aug 31, 2020

Conversation

tdyas
Copy link
Contributor

@tdyas tdyas commented Aug 31, 2020

Problem

The code in https://github.com/pantsbuild/pants/blob/master/src/python/pants/engine/process.py, which uses a shell script to probe where Python interpreters are located, puts a newline in front of the shebang which can error out when remote execution environments try to execute the script. Unix/Linux requires that the shebang be the very first bytes in the file.

Solution

Strip whitespace off the front of the script. This removes the newline just after the """ marker.

Result

Remote execution in Buildbarn should pass.

[ci skip-rust]

[ci skip-build-wheels]

@tdyas tdyas changed the title remove leading whitespae to ensure shebang is at front of string remove leading whitespae to ensure shebang is at front of script file Aug 31, 2020
Copy link
Contributor

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! Wow. Thank you. Travis doesn't work with this script, and I think this is likely the reason.

src/python/pants/engine/process.py Outdated Show resolved Hide resolved
@Eric-Arellano Eric-Arellano changed the title remove leading whitespae to ensure shebang is at front of script file Remove invalid shebang for BinaryPaths script Aug 31, 2020
@Eric-Arellano Eric-Arellano changed the title Remove invalid shebang for BinaryPaths script Fix invalid shebang for BinaryPaths script Aug 31, 2020
@coveralls
Copy link

coveralls commented Aug 31, 2020

Coverage Status

Coverage remained the same at 0.0% when pulling 6c63a64 on tdyas:remove_newline_before_shebang into b173bcb on pantsbuild:master.

[ci skip-rust]

[ci skip-build-wheels]
Copy link
Contributor

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@Eric-Arellano Eric-Arellano merged commit 5a97e71 into pantsbuild:master Aug 31, 2020
@tdyas tdyas deleted the remove_newline_before_shebang branch February 20, 2023 20:22
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.

None yet

4 participants