Hive Hive
Sign in

fix(graph): encode rustc response file args

GitHub issue · Closed

Metadata
Source
tuist/once #139
Updated
Jul 5, 2026
Domains
Once
Details

What changed

This adds a rustc-response argument-file format to cmd_args and teaches the executor to encode those files for the host before writing them. The Rust target kind now keeps feature flags as normal rustc arguments such as feature="default", then asks the materializer for the rustc-response format when Windows needs a response file.

The change also updates the Starlark module reference and adds coverage for the generic cmd_args format, Windows response-file encoding, and the generated Rust feature response file.

Why

The main release workflow is still failing in the Windows release packaging jobs. The previous fix made feature values valid as direct rustc arguments, but response-file parsing on Windows consumed the raw string delimiter quotes before rustc validated --cfg.

Root cause

The failed jobs reached cargo_dependencies_x86_64_pc_windows_msvc/anyhow-1.0.102:rustc and reported feature=r#default#. That means the response file contained a value that looked valid as a direct Rust string literal, but Windows response-file parsing removed the double quotes inside it.

Approach

This keeps the rule authoring surface ergonomic. Target kinds declare the arguments they intend rustc to receive, and the executor owns the format-specific response-file encoding. line-delimited remains a literal format, while rustc-response applies the host-specific escaping needed by rustc @path files.

Impact

Rule authors do not need to know how to escape rustc response files for Windows. Existing direct rustc invocations stay unchanged, and Windows response files now preserve feature values with quoted string literals.

Validation

  • mise exec -- cargo test -p once-frontend --test prelude prelude_cargo_metadata_windows_features_escape_response_file_cfgs
  • mise exec -- cargo test -p once-frontend --test prelude prelude_rust_windows_feature_cfgs_use_response_file
  • mise exec -- cargo test -p once-frontend run_action_flattens_cmd_args_with_rustc_response_arg_file
  • mise exec -- cargo test -p once-cli rustc_response_args_escape_quotes_for_windows_hosts
  • mise exec -- cargo test -p once-cli commands::graph::analysis::actions::tests::rustc_response_args_escape_windows_shell_characters
  • mise exec -- cargo test -p once-cli commands::graph::analysis::actions::tests
  • mise exec -- cargo test -p once-frontend --test prelude
  • mise exec -- cargo test -p once-frontend
  • mise exec -- cargo test -p once-cli
  • mise exec -- cargo fmt --all -- --check
  • git diff --check
  • mise exec -- cargo clippy -p once-cli -p once-frontend --all-targets -- -D warnings
  • mise exec -- cargo test --workspace
  • mise exec -- cargo clippy --workspace --all-targets -- -D warnings
Flights

Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.

New Flights are paused Configure model inference, GitHub, and a sandbox provider to start another Flight. Existing results remain available below.
No Flights yet

Start a Flight and preserve its objective, outcome, and session here.

Comments

No GitHub comments yet.