-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
cannot pass script/binary in root of repository to --workspace_status_command with bazel 0.12 #5002
Comments
OK, I'm pretty sure this is actually a bug. If I move the script into a subdirectory of our repo (from In other words,
|
cc @davidstanke |
This is to work around: bazelbuild/bazel#5002
cc @philwo |
Pinging #4582 for reference |
@laszlocsomor, is this due to 073ea09? |
That change post-dates this bug report, so it seems unlikely, but maybe it was an earlier change in the same area? |
I can repro this, let me take a look. |
/cc @tomlu Culprit is a729b9b, and reason is that the The workaround is either to use the full path of the script, e.g. |
Also I'm going to roll forward 073ea09 and will make sure that passing a workspace-relative path will work. |
"bash print-workspace-status.sh" is a command (with arguments), isn't it? |
We should consider supporting commands-with-arguments in the workspace_status_command. Actually, we might want to consider cleaning up the entire set of command-line flags that affect the workspace status command. :-/ |
Maybe :) Or a file name: "bash\ print-workspace-status.sh". How do you know? |
The point of 073ea09 was to (a) not require a shell interpreter to run the workspace status command, and (b) make the semantics unambiguous. |
Why? Supporting a |
I was wrong, |
@laszlocsomor I'm not sure I follow. Why can't we expect a path? For example, we could expect a path with forward slashes and automatically convert to the platform-specific separator? This is only an issue for checked-in bazelrc files, right? So it seems fine to restrict it to relative paths pointing at checked in workspace status command binaries. |
@ulfjack We can expect a path, that's not the problem. But what do you pass as the flag's value, what program works on every platform? Indeed the problem is with checked-in bazelrc files. Imagine it contains Come to think of it, a reasonable compromise would be always running "tools/foo" through Bash except if it's an |
A viable workaround is to implement the workspace status command's logic as a script (e.g. in python), have the interpreter on the PATH, and use |
This is to work around: bazelbuild/bazel#5002
Description of the problem / feature request:
In our project (kubernetes/test-infra) we use a shell script to set stamping variables, and we run this on all builds by adding
--workspace_status_command=./print-workspace-status.sh
to our bazelrc.Starting with bazel 0.12, this is failing with
If I switch this to
--workspace_status_command="bash ./print-workspace-status.sh"
it works again.I'm not sure whether this was an intentional regression. It's not mentioned in the release notes, at the very least.
What operating system are you running Bazel on?
Linux
What's the output of
bazel info release
?The text was updated successfully, but these errors were encountered: