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

Commits on Oct 24, 2024

  1. Use backslashes in executable paths when remotely executing on Windows

    `.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
    fmeum authored and bazel-io committed Oct 24, 2024
    Configuration menu
    Copy the full SHA
    356a321 View commit details
    Browse the repository at this point in the history