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

Allow any execute bits to count as executable #345

Merged

Conversation

JaredNeil
Copy link
Contributor

@JaredNeil JaredNeil commented Aug 8, 2022

If the tools/bazel wrapper is executable by the user, but not everyone the current behavior is that bazelisk assumes it's not executable and silently pretends that the wrapper script doesn't exist, which was very confusing to me.

After this change, someone could run into the case where bazelisk thinks the user can execute the wrapper, but doesn't actually have permission. If that does happen, the error could not run Bazel: could not start Bazel: fork/exec /repo/tools/bazel: permission denied makes it pretty clear what's wrong.

This now matches how the Go standard library checks if a file is executable. https://cs.opensource.google/go/go/+/refs/tags/go1.19:src/os/exec/lp_unix.go;l=26

@fweikert
Copy link
Member

fweikert commented Nov 4, 2022

Thank you!

@fweikert fweikert merged commit aa0e93d into bazelbuild:master Nov 4, 2022
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.

2 participants