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

Exec bazel instead of subprocessing #566

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aaron-skydio
Copy link

@aaron-skydio aaron-skydio commented Mar 28, 2024

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:

  • shells' segfault detection often does not fire on subprocesses, so doing bazel run //:something_that_segfaults will not cause bash to display that the process segfaulted if bazelisk subprocesses to bazel, but it does if bazelisk execs bazel.
  • terminal emulators that display the name of the running process currently display bazel, even once bazel run has execd 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 change

syscall.Exec is not supported on windows, so this only applies to linux and macos.

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.

1 participant