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

Fingerprint build script deps only for path packages. #6734

Merged
merged 1 commit into from
Mar 11, 2019

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Mar 10, 2019

#6720 introduced some protection that if there is a build script, and two commands are used (such as cargo build then cargo test), the second command would correctly get rebuilt. However, the way it was implemented relies on mtimes working correctly. A common use case is to cache built dependencies in Docker, and Docker zeros the nanoseconds from mtime when the image is saved. This caused all packages that had build scripts to get rebuilt when the Docker image runs.

The solution here is to only use the #6720 protection for local (path) packages. This runs under the assumption that mtimes need to work for those anyways.

The consequence is that the scenario in #6720 will no longer work for detecting changes in registry dependencies with build scripts. Fixing that final edge case is nontrivial. Since it is unlikely to happen often, I figure this workaround should be sufficient for now.

cc rust-lang/rust-playground#469
cc rust-lang/rust#59061

@rust-highfive
Copy link

r? @alexcrichton

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

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Collaborator

bors commented Mar 11, 2019

📌 Commit 5e7b50a has been approved by alexcrichton

@bors
Copy link
Collaborator

bors commented Mar 11, 2019

⌛ Testing commit 5e7b50a with merge 06fdf54c330f6908c0435ba48f16a9ea12da7a6a...

@bors
Copy link
Collaborator

bors commented Mar 11, 2019

💔 Test failed - checks-travis

@alexcrichton
Copy link
Member

@bors: retry

@bors
Copy link
Collaborator

bors commented Mar 11, 2019

⌛ Testing commit 5e7b50a with merge dd76122...

bors added a commit that referenced this pull request Mar 11, 2019
Fingerprint build script deps only for path packages.

#6720 introduced some protection that if there is a build script, and two commands are used (such as `cargo build` then `cargo test`), the second command would correctly get rebuilt. However, the way it was implemented relies on mtimes working correctly. A common use case is to cache built dependencies in Docker, and Docker zeros the nanoseconds from mtime when the image is saved. This caused all packages that had build scripts to get rebuilt when the Docker image runs.

The solution here is to only use the #6720 protection for local (path) packages. This runs under the assumption that mtimes need to work for those anyways.

The consequence is that the scenario in #6720 will no longer work for detecting changes in registry dependencies with build scripts. Fixing that final edge case is nontrivial. Since it is unlikely to happen often, I figure this workaround should be sufficient for now.

cc rust-lang/rust-playground#469
cc rust-lang/rust#59061
@bors
Copy link
Collaborator

bors commented Mar 11, 2019

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

@bors bors merged commit 5e7b50a into rust-lang:master Mar 11, 2019
@shepmaster
Copy link
Member

Will this just make its way into a regular nightly automatically?

@ehuss
Copy link
Contributor Author

ehuss commented Mar 12, 2019

No. I'll post an update now.

bors added a commit to rust-lang/rust that referenced this pull request Mar 13, 2019
Update cargo

5 commits in 95b45eca19ac785263fed98ecefe540bb47337ac..dd761226d944712a363ea515cb294f4e2b6bdbe5
2019-03-06 19:24:30 +0000 to 2019-03-11 18:51:14 +0000
- Fingerprint build script deps only for path packages. (rust-lang/cargo#6734)
- Add --quiet option for `cargo test` (rust-lang/cargo#6358)
- .gitignore should end with a newline. (rust-lang/cargo#6732)
- Emit warning on misspelled environment variables (rust-lang/cargo#6694)
- Update glob requirement from 0.2.11 to 0.3.0 (rust-lang/cargo#6724)
bors added a commit to rust-lang/rust that referenced this pull request Mar 13, 2019
Update cargo

6 commits in 95b45eca19ac785263fed98ecefe540bb47337ac..0e35bd8af0ec72d3225c4819b330b94628f0e9d0
2019-03-06 19:24:30 +0000 to 2019-03-13 06:52:51 +0000
- Make `hg` optional for tests. (rust-lang/cargo#6739)
- Fingerprint build script deps only for path packages. (rust-lang/cargo#6734)
- Add --quiet option for `cargo test` (rust-lang/cargo#6358)
- .gitignore should end with a newline. (rust-lang/cargo#6732)
- Emit warning on misspelled environment variables (rust-lang/cargo#6694)
- Update glob requirement from 0.2.11 to 0.3.0 (rust-lang/cargo#6724)
@ehuss ehuss added this to the 1.35.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.

5 participants