Skip to content

Correctly set filetime for copied LLVM #57871

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

Merged
merged 1 commit into from
Jan 27, 2019

Conversation

Mark-Simulacrum
Copy link
Member

This also makes compiletest no longer always retest everything.

Fixes #57864

@Mark-Simulacrum
Copy link
Member Author

cc @eddyb

@rust-highfive
Copy link
Contributor

r? @nikomatsakis

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 24, 2019
}));

// Compiletest itself.
inputs.extend(collect_timestamps(&rust_src_dir.join("src/tools/compiletest/")));
//inputs.extend(Stamp::from_dir(&rust_src_dir.join("src/tools/compiletest/")));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some leftover commented out code

@nikomatsakis
Copy link
Contributor

I don't really know this code in particular.

r? @oli-obk since they left a review already =)

This also makes compiletest no longer always retest everything.
@Mark-Simulacrum
Copy link
Member Author

@oli-obk Fixed up the code. FWIW the compiletest changes could be dropped entirely (they're mostly to ease debugging): none of them are actually necessary to fix the bug, but I decided to leave them in to help future bug-hunting.

t!(fs::set_permissions(&dst, metadata.permissions()));
let atime = FileTime::from_last_access_time(&metadata);
let mtime = FileTime::from_last_modification_time(&metadata);
t!(filetime::set_file_times(&dst, atime, mtime));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So... if I'm seeing this right, the only actual change of this PR is this file.

Let me see if I get this right:

The old code copied e.g. rustc over from where it was built in stage 1 to where it is used to build the tests. This copy operation nuked all metadata and timestamps, thus causing compiletest to think rustc changed and causing a full rebuild.

The new code instead reads the metadata, copies the file and writes back the relevant old metadata. So even if there's a new file, its timestamp didn't change.

If I got everything right, please add a few comments explaining why we don't just do fs::copy and be done with it. r=me with that

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, fs::copy doesn't copy the timestamp (just the permission bits); this code is copied from the copy method on Build (in this file) anyway, so I'd prefer to not modify it in this PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify, the reason we don't call that copy method instead is that it prefers to create a hardlink instead of copying if it can, and we don't want that here.

@oli-obk
Copy link
Contributor

oli-obk commented Jan 25, 2019

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 25, 2019

📌 Commit 82fae2b has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 25, 2019
@Centril
Copy link
Contributor

Centril commented Jan 26, 2019

Adjusting queue order for rollup, @bors p=1

@bors
Copy link
Collaborator

bors commented Jan 26, 2019

⌛ Testing commit 82fae2b with merge 30d2b0866bf8ac48cb3e429ddd4c21c4eb050498...

@Mark-Simulacrum
Copy link
Member Author

@bors retry

Prioritizing bootstrap update...

@bors
Copy link
Collaborator

bors commented Jan 27, 2019

⌛ Testing commit 82fae2b with merge 4916801...

bors added a commit that referenced this pull request Jan 27, 2019
Correctly set filetime for copied LLVM

This also makes compiletest no longer always retest everything.

Fixes #57864
@bors
Copy link
Collaborator

bors commented Jan 27, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: oli-obk
Pushing 4916801 to master...

@bors
Copy link
Collaborator

bors commented Jan 27, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: oli-obk
Pushing 4916801 to master...

@bors bors merged commit 82fae2b into rust-lang:master Jan 27, 2019
@Mark-Simulacrum Mark-Simulacrum deleted the fix-compiletest-stamp branch June 8, 2019 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants