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

Windows: "bazel run" requires Bash [blocking #4319] #8229

Closed
laszlocsomor opened this issue May 3, 2019 · 1 comment
Closed

Windows: "bazel run" requires Bash [blocking #4319] #8229

laszlocsomor opened this issue May 3, 2019 · 1 comment
Labels
area-Windows Windows-specific issues and feature requests P2 We'll consider working on this in future. (Assignee optional) team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: bug

Comments

@laszlocsomor
Copy link
Contributor

laszlocsomor commented May 3, 2019

Description of the problem / feature request:

"bazel run" requires Bash, doesn't work with --shell_executable=.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

BUILD:

cc_binary(
    name = "x",
    srcs = ["x.cc"],
)

x.cc:

int main() { return 0; }
bazel run --shell_executable= //:x
(...)
INFO: Build completed successfully, 6 total actions
ERROR: the "run" command needs a shell; use the --shell_executable=<path> flag to specify its path, INFO: Build completed successfully, 6 total actions

What operating system are you running Bazel on?

Windows 10

What's the output of bazel info release?

0.25.0 release

Have you found anything relevant by searching the web?

This is a sub-issue of #6462, and a blocker for #4319.

laszlocsomor added a commit to laszlocsomor/bazel that referenced this issue May 3, 2019
"bazel run //foo:bin" no longer requires Bash,
i.e. it works with --shell_executable="".

Bash is still required with --run_under="foo" and
with --script_path=<path>.

Fixes bazelbuild#8229
@jin jin added area-Windows Windows-specific issues and feature requests untriaged labels May 3, 2019
@laszlocsomor laszlocsomor added P1 I'll work on this now. (Assignee required) type: bug and removed untriaged labels May 6, 2019
@laszlocsomor laszlocsomor changed the title Windows: "bazel run" requires Bash Windows: "bazel run" requires Bash [blocking #4319] May 6, 2019
laszlocsomor added a commit to laszlocsomor/bazel that referenced this issue May 6, 2019
"bazel run //foo:bin" no longer requires Bash,
i.e. it works with --shell_executable="".

Bash is still required with --run_under="foo" and
with --script_path=<path>.

Fixes bazelbuild#8229
laszlocsomor added a commit to laszlocsomor/bazel that referenced this issue May 6, 2019
This flag enables Bash-less "bazel run" for simple
cases (no `--run_under`, no `--script_path`).

When enabled, "bazel run //foo:bin" no longer
requires Bash, and works with
`--shell_executable=""`.

Bash is still required with --run_under="foo" and
with --script_path=<path>.

Fixes bazelbuild#8229
See bazelbuild#8240
laszlocsomor added a commit to laszlocsomor/bazel that referenced this issue May 6, 2019
This flag enables Bash-less "bazel run" for simple
cases (no `--run_under`, no `--script_path`).

When enabled, "bazel run //foo:bin" no longer
requires Bash, and works with
`--shell_executable=""`.

Bash is still required with --run_under="foo" and
with --script_path=<path>.

Fixes bazelbuild#8229
See bazelbuild#8240

Change-Id: I36b9951674bf8651216178d6b34f28a496e724b9
laszlocsomor added a commit to laszlocsomor/bazel that referenced this issue May 10, 2019
To "bazel run" a binary, the RunCommand creates an
ExecRequest and sends it to the Bazel client,
which then fulfills the request.

In PR bazelbuild#8241, RunCommand merged all command line
arguments and added that to the request as a
single argv entry. The client uses the first argv
element as the executable, but if all arguments
are joined into one string then argv0 contains the
whole argument vector as a single string.

Unfortunately the test didn't catch this because
it didn't attempt passing any arguments.

Fixes bazelbuild#8229
See bazelbuild#8240
bazel-io pushed a commit that referenced this issue May 10, 2019
To "bazel run" a binary, the RunCommand creates an
ExecRequest and sends it to the Bazel client,
which then runs the binary as the client's
subprocess.

In PR #8241, RunCommand merged all command line
arguments and added that to the request as a
single argv entry. The client uses the first argv
element as the executable, but if all arguments
are joined into one string then argv0 contains the
whole argument vector as a single string.

Unfortunately the test didn't catch this because
it didn't attempt passing any arguments.

Fixes #8229
See #8240

Closes #8287.

PiperOrigin-RevId: 247590904
irengrig pushed a commit to irengrig/bazel that referenced this issue Jun 18, 2019
To "bazel run" a binary, the RunCommand creates an
ExecRequest and sends it to the Bazel client,
which then runs the binary as the client's
subprocess.

In PR bazelbuild#8241, RunCommand merged all command line
arguments and added that to the request as a
single argv entry. The client uses the first argv
element as the executable, but if all arguments
are joined into one string then argv0 contains the
whole argument vector as a single string.

Unfortunately the test didn't catch this because
it didn't attempt passing any arguments.

Fixes bazelbuild#8229
See bazelbuild#8240

Closes bazelbuild#8287.

PiperOrigin-RevId: 247590904
@laszlocsomor laszlocsomor reopened this Jul 8, 2019
@laszlocsomor laszlocsomor added bazel 1.0 P2 We'll consider working on this in future. (Assignee optional) and removed P1 I'll work on this now. (Assignee required) labels Jul 8, 2019
@dslomov dslomov removed the bazel 1.0 label Jul 24, 2019
@laszlocsomor
Copy link
Contributor Author

Bazel 1.0 fixed this, see #8241.

@philwo philwo added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Windows Windows-specific issues and feature requests P2 We'll consider working on this in future. (Assignee optional) team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: bug
Projects
None yet
4 participants