Windows support 1/x: centipede:command. - #2174
Open
copybara-service[bot] wants to merge 1 commit into
Open
Conversation
copybara-service
Bot
force-pushed
the
cl/959298250
branch
14 times, most recently
from
August 6, 2026 02:06
25e5dc4 to
478c3a3
Compare
copybara-service
Bot
force-pushed
the
cl/959298250
branch
from
September 3, 2026 20:25
478c3a3 to
eb18e67
Compare
copybara-service
Bot
force-pushed
the
cl/959298250
branch
from
September 8, 2026 19:32
eb18e67 to
e2d8e50
Compare
copybara-service
Bot
force-pushed
the
cl/959298250
branch
3 times, most recently
from
September 8, 2026 23:02
82e67de to
b52165f
Compare
`Command` previously relied on `posix_spawn` with `/bin/sh`, the POSIX `env` utility for environment variable modifications, and shell `<` redirection syntax in arguments. These mechanisms are not portable to Windows. Refactor `Command` to support native Windows process management alongside POSIX: - Introduce `Command::PlatformContext` to encapsulate platform-specific process handles (`HANDLE` on Windows vs. `pid_t` and `ForkServerProps` on POSIX). - Implement Windows process creation, environment block construction (`Options::env_diff`), and standard stream redirection in `Command::ExecuteAsync()` using `CreateProcessA`. - Add `Options::stdin_file_path` to handle input redirection directly rather than appending `"<"` to command arguments, and update `SymbolTable` to use it. - Escape command-line arguments, environment variables, and file paths in `Command::ToString()` on both POSIX (`ShellEscape`) and Windows. - Update `command_test_helper` and `command_test` to verify arguments, environment variables, standard input, and signals portably without relying on `bash`, and enable `centipede:command_test` on Windows CI. - Update `GetDataDependencyFilepath` to return executable path suffixed with `.exe` under Windows. PiperOrigin-RevId: 959298250
copybara-service
Bot
force-pushed
the
cl/959298250
branch
from
September 8, 2026 23:15
b52165f to
70b418d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Windows support 1/x: centipede:command.
Commandpreviously relied onposix_spawnwith/bin/sh, the POSIXenvutility for environment variable modifications, and shell<redirection syntax in arguments. These mechanisms are not portable to Windows.Refactor
Commandto support native Windows process management alongside POSIX:Introduce
Command::PlatformContextto encapsulate platform-specific process handles (HANDLEon Windows vs.pid_tandForkServerPropson POSIX).Implement Windows process creation, environment block construction (
Options::env_diff), and standard stream redirection inCommand::ExecuteAsync()usingCreateProcessA.Add
Options::stdin_file_pathto handle input redirection directly rather than appending"<"to command arguments, and updateSymbolTableto use it.Escape command-line arguments, environment variables, and file paths in
Command::ToString()on both POSIX (ShellEscape) and Windows.Update
command_test_helperandcommand_testto verify arguments, environment variables, standard input, and signals portably without relying onbash, and enablecentipede:command_teston Windows CI.Update
GetDataDependencyFilepathto return executable path suffixed with.exeunder Windows.