Escape --manifest-path arg in build --print-commands-only tests.#2591
Conversation
|
Claude finished @fnando's task in 1m 30s —— View job Claude PR Review
SummaryThe fix is correct, minimal, and well-justified. Wrapping Findings🔴 Blocker — must restore before merge (already called out)
🟡 Consistency nit (non-blocking)
🟢 Minor — code style
🟢 Observation (not in scope for this PR)
VerdictLGTM on the test fix. Block the merge until the |
There was a problem hiding this comment.
Pull request overview
This PR updates build integration test expectations so --print-commands-only output matches the shell-escaped manifest path formatting emitted by production code, especially on Windows.
Changes:
- Adds a
manifest_path_arghelper that shell-escapes--manifest-path=<path>. - Updates affected build tests to use the escaped manifest path argument.
- Temporarily disables the Windows CI job gate to run Windows validation on this PR.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
cmd/crates/soroban-test/tests/it/build.rs |
Updates expected cargo command strings to match escaped manifest path output. |
.github/workflows/rust.yml |
Temporarily ungates the Windows build-and-test job. |
|
Claude finished @fnando's task in 1m 28s —— View job Claude PR Review (re-review after synchronize)
SummaryThe previous review's blocker has been resolved: commit I re-verified the fix against production: Findings🟢 Blocker resolvedThe 🟡 Consistency nit (non-blocking, unchanged from prior review)
🟢 Style nit (taste — fine as-is)
fn manifest_path_arg(path: &str) -> String {
escape(format!("--manifest-path={path}").into()).into_owned()
}🟢 Observation (out of scope — same as last review)
VerdictLGTM. The blocker is gone, the diff is now minimal and focused, and the test now models real production output across platforms. The two remaining notes are non-blocking nits. |
What
Escape the
--manifest-path=<path>arg in the expected output ofbuild::build_all,build::build_default_members,build::build_all_when_in_non_package_directory, andbuild::build_package_by_nameso the assertions match what production emits on Windows.Adds a
manifest_path_arghelper incmd/crates/soroban-test/tests/it/build.rsthat wrapsformat!("--manifest-path={path}")withshell_escape::escape, the same wayserialize_command(cmd/soroban-cli/src/commands/contract/build.rs:594) escapes each cargo arg.Why
The Windows CI matrix has been red since #2502 (Shell-escape build command args in --print-commands-only output). On Windows
PathBuf::joinproduces backslashes, andshell_escape::escapetreats\as a shell-special character and wraps the whole token in single quotes, so the CLI emits'--manifest-path=contracts\add\Cargo.toml'. The tests' expected strings interpolate the manifest path raw, so they never matched the actual output.Fix is in the tests rather than production: both
'--key=value'and--key='value'parse to the same arg token in a shell, so the current production output is functionally correct, just visually unusual on Windows. Mirroring it in the tests is the smaller, lower-risk change.Verification
To run the Windows matrix on this PR, the
if:gate onbuild-and-test-windowswas temporarily commented out, then restored. Both Windows jobs passed with the fix:Known limitations
N/A