Exec bazel instead of subprocessing #566
Open
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.
Instead of running bazel as a subprocess of bazelisk, replace bazelisk with bazel in the same process (in the case when bazelisk is only being used to invoke bazel once and then exit, as opposed to invoking bazel multiple times or post-processing output from bazel). This eliminates several classes of issues.
A couple concrete examples:
bazel run //:something_that_segfaults
will not cause bash to display that the process segfaulted if bazelisk subprocesses to bazel, but it does if bazeliskexec
s bazel.bazel
, even oncebazel run
hasexec
d the binary it built, since the running top-level process is still bazelisk; they should display the name of the binary, and they do after this changesyscall.Exec
is not supported on windows, so this only applies to linux and macos.