Skip to content

Preserve caller-provided RUSTDOCFLAGS in cargo-zerocopy#3476

Open
fallintoplace wants to merge 1 commit into
google:mainfrom
fallintoplace:fix/preserve-rustdocflags
Open

Preserve caller-provided RUSTDOCFLAGS in cargo-zerocopy#3476
fallintoplace wants to merge 1 commit into
google:mainfrom
fallintoplace:fix/preserve-rustdocflags

Conversation

@fallintoplace

Copy link
Copy Markdown

This fixes a mismatch in cargo-zerocopy's flag forwarding for docs builds.

cargo-zerocopy previously read RUSTFLAGS and then reused that value for both RUSTFLAGS and RUSTDOCFLAGS. In CI, the docs job appends docs.rs-specific rustdoc args and --document-hidden-items to RUSTDOCFLAGS, so those rustdoc-only flags were getting dropped before cargo doc ran.

What changed:

  • read both RUSTFLAGS and RUSTDOCFLAGS independently
  • keep the wrapper's internal cfg flags on both channels
  • add unit tests covering appended caller flags, empty caller flags, and distinct rustdoc flags

Developer impact:

  • the docs CI step now exercises the rustdoc configuration it says it is exercising
  • caller-provided rustdoc flags are no longer silently replaced by caller-provided rust flags

Validation:

  • cargo fmt -p cargo-zerocopy --manifest-path /Users/hoangvu/Code/OSS/zerocopy/tools/Cargo.toml --check
  • cargo test -p cargo-zerocopy --manifest-path /Users/hoangvu/Code/OSS/zerocopy/tools/Cargo.toml

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.85%. Comparing base (ed09d09) to head (1cfb77c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3476   +/-   ##
=======================================
  Coverage   91.85%   91.85%           
=======================================
  Files          20       20           
  Lines        6093     6093           
=======================================
  Hits         5597     5597           
  Misses        496      496           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants