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

[8.0.0] Use backslashes in executable paths when remotely executing on Windows #24080

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

bazel-io
Copy link
Member

.bat scripts can only be executed on Windows when their paths use backslashes, not forward slashes. For this reason, local execution carefully replaces forward slashes with backslashes in the executable of a Spawn when executing on Windows.

This commit adds equivalent logic for the case of remote execution on Windows from any host:

  • Remote execution replaces forward slashes with backslashes in the first argument when executing on Windows.
  • Most calls to PathFragment#getCallablePathString are replaced with the new execution platform aware getCallablePathStringForOs. This affects test actions, in which various wrappers execute different executables (e.g. --run_under targets) and thus can have Bazel-controlled executable path strings in locations other than the argv[0].

Fixes #11636

Closes #23986.

PiperOrigin-RevId: 689357323
Change-Id: Ifb842babc02c6d741d3b45914a5bf5c032204e2b

Commit 9c90100

`.bat` scripts can only be executed on Windows when their paths use backslashes, not forward slashes. For this reason, local execution carefully replaces forward slashes with backslashes in the executable of a `Spawn` when executing on Windows.

This commit adds equivalent logic for the case of remote execution on Windows from any host:
* Remote execution replaces forward slashes with backslashes in the first argument when executing on Windows.
* Most calls to `PathFragment#getCallablePathString` are replaced with the new execution platform aware `getCallablePathStringForOs`. This affects test actions, in which various wrappers execute different executables (e.g. `--run_under` targets) and thus can have Bazel-controlled executable path strings in locations other than the `argv[0]`.

Fixes bazelbuild#11636

Closes bazelbuild#23986.

PiperOrigin-RevId: 689357323
Change-Id: Ifb842babc02c6d741d3b45914a5bf5c032204e2b
@bazel-io bazel-io requested a review from a team as a code owner October 24, 2024 15:46
@bazel-io bazel-io added team-Configurability platforms, toolchains, cquery, select(), config transitions team-Remote-Exec Issues and PRs for the Execution (Remote) team awaiting-review PR is awaiting review from an assigned reviewer labels Oct 24, 2024
@bazel-io bazel-io requested a review from tjgq October 24, 2024 15:46
@iancha1992 iancha1992 added this pull request to the merge queue Oct 28, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 28, 2024
@meteorcloudy meteorcloudy added this pull request to the merge queue Oct 28, 2024
Merged via the queue into bazelbuild:release-8.0.0 with commit 57ce6a4 Oct 28, 2024
46 checks passed
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Configurability platforms, toolchains, cquery, select(), config transitions team-Remote-Exec Issues and PRs for the Execution (Remote) team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants