Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include package props with corresponding env vars into target metadata #3857

Merged
merged 1 commit into from
Mar 24, 2017

Conversation

antonlarin
Copy link
Contributor

Previously, when changing package properties with corresponding environment variables (such as authors, which has CARGO_PKG_AUTHORS), it didn't invalidate the build, even though there could have been a dependency on such variables in the source code.

This commit includes 3 such properties: authors list, description and homepage in the target metadata.

I've added a test only for description change, can add more if necessary.
Fixes #3696.

@rust-highfive
Copy link

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

Looks great, thanks!

Could you leave a comment over in where the env vars are set to be sure to update this hash piece as well?

Previously, when changing package properties with corresponding
environment variables (such as authors, which has CARGO_PKG_AUTHORS),
it didn't invalidate the build, even though there could have been
a dependency on such variables in the source code.

This commit includes such properties (there are 3 of them in total:
authors, description and homepage) in the target metadata.

Fixes rust-lang#3696.
@antonlarin
Copy link
Contributor Author

Done. While looking for a place where hash is calculated I also have stumbled upon a misleading comment (no function calculate_target_fresh() anymore), but I'm not sure how to fix it. Thought I'd let you know.

@alexcrichton
Copy link
Member

Heh yeah comments don't always live up to the test of time...

In any case looks great, thanks again!

@bors: r+

@bors
Copy link
Contributor

bors commented Mar 23, 2017

📌 Commit d70ca21 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Mar 23, 2017

⌛ Testing commit d70ca21 with merge 20f6eff...

bors added a commit that referenced this pull request Mar 23, 2017
Include package props with corresponding env vars into target metadata

Previously, when changing package properties with corresponding environment variables (such as authors, which has CARGO_PKG_AUTHORS), it didn't invalidate the build, even though there could have been a dependency on such variables in the source code.

This commit includes 3 such properties: authors list, description and homepage in the target metadata.

I've added a test only for description change, can add more if necessary.
Fixes #3696.
@bors
Copy link
Contributor

bors commented Mar 24, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 20f6eff to master...

@bors bors merged commit d70ca21 into rust-lang:master Mar 24, 2017
@antonlarin antonlarin deleted the rebuild-on-env-change branch March 24, 2017 09:42
@ehuss ehuss mentioned this pull request Mar 26, 2019
bors added a commit that referenced this pull request Mar 26, 2019
Some fingerprint cleanup.

Just a minor cleanup.

Move `CARGO_PKG_*` values from Metadata to Fingerprint (added in #3857).  Closes #6208.  This prevents stale artifacts from being left behind when these values change. Also tracks changes to the "repository" value (added in #6096).

Remove `edition` as a separate field. It is already tracked in `target`. This was required previously to #5816 which added per-target editions.

Also adds a helper to the testsuite to make globbing easier.
@ehuss ehuss added this to the 1.18.0 milestone Feb 6, 2022
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.

Changes to Cargo.toml that result in a different environment should invalidate the build
5 participants