Skip to content

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

Merged
bors merged 1 commit into
rust-lang:masterfrom
antonlarin:rebuild-on-env-change
Mar 24, 2017
Merged

bors merged 1 commit into
rust-lang:masterfrom
antonlarin:rebuild-on-env-change

Conversation

@antonlarin

Copy link
Copy Markdown
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
Copy Markdown

r? @alexcrichton

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

@alexcrichton

Copy link
Copy Markdown
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
antonlarin force-pushed the rebuild-on-env-change branch from 2fe29b7 to d70ca21 Compare March 23, 2017 19:57
@antonlarin

Copy link
Copy Markdown
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
Copy Markdown
Member

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

In any case looks great, thanks again!

@bors: r+

@bors

bors commented Mar 23, 2017

Copy link
Copy Markdown
Contributor

📌 Commit d70ca21 has been approved by alexcrichton

@bors

bors commented Mar 23, 2017

Copy link
Copy Markdown
Contributor

⌛ 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

bors commented Mar 24, 2017

Copy link
Copy Markdown
Contributor

☀️ 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