Skip to content

Rebuild when -Zpublic-dependency changes#16965

Open
qaijuang wants to merge 1 commit intorust-lang:masterfrom
qaijuang:fix-public-dependency-fingerprint
Open

Rebuild when -Zpublic-dependency changes#16965
qaijuang wants to merge 1 commit intorust-lang:masterfrom
qaijuang:fix-public-dependency-fingerprint

Conversation

@qaijuang
Copy link
Copy Markdown

@qaijuang qaijuang commented May 5, 2026

Fixes #16962.

What does this PR try to resolve?

-Zpublic-dependency changes how Cargo passes private dependencies to rustc for library units. With the option enabled, Cargo marks private dependencies with priv in --extern so rustc can run the exported_private_dependencies lint.

The fingerprint config hash did not include that effective mode, so toggling -Zpublic-dependency could leave the library fresh even though the rustc invocation should change.

This PR hashes the effective condition that changes the --extern args and keeps the predicate shared with extern_args.

How to test and review this PR?

The new test covers both stale directions:

  • first build with -Zpublic-dependency, then without it
  • first build without -Zpublic-dependency, then with it

@rustbot rustbot added A-build-execution Area: anything dealing with executing the compiler A-rebuild-detection Area: rebuild detection and fingerprinting labels May 5, 2026
@qaijuang qaijuang changed the title fix(fingerprint): rebuild when -Zpublic-dependency changes Rebuild when -Zpublic-dependency changes May 5, 2026
@qaijuang qaijuang marked this pull request as ready for review May 5, 2026 08:21
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 5, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 5, 2026

r? @epage

rustbot has assigned @epage.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ehuss, @epage, @weihanglo
  • @ehuss, @epage, @weihanglo expanded to ehuss, epage, weihanglo
  • Random selection from ehuss, epage, weihanglo

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

Labels

A-build-execution Area: anything dealing with executing the compiler A-rebuild-detection Area: rebuild detection and fingerprinting S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

-Zpublic-dependency does not invalidate build cache when it should

3 participants