Skip to content

Make build timestamp files robust to concurrent source modification. #22997

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

Conversation

pnkfelix
Copy link
Member

@pnkfelix pnkfelix commented Mar 3, 2015

Make build timestamp files robust in face of concurrent source modification.

Strategy: If the end goal is to touch e.g. stamp.std, then we first touch stamp.std.start_time before doing anything else. Then when the receipe finishes, we touch stamp.std using the timestamp from stamp.std.start_time as the reference time, and remove stamp.std.start_time.

Fix #6518.

…cation.

Strategy: If the end goal is to touch e.g. `stamp.std`, then we first
touch `stamp.std.start_time` before doing anything else.  Then when
the receipe finishes, we touch `stamp.std` using the timestamp from
`stamp.std.start_time` as the reference time, and remove
`stamp.std.start_time`.

Fix rust-lang#6518.
@rust-highfive
Copy link
Contributor

r? @nikomatsakis

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

@pnkfelix
Copy link
Member Author

pnkfelix commented Mar 3, 2015

(i checked as well that touch -r is supported on my copy of FreeBSD, and a user in #rust-internals reports that touch -r is supported on MinGW as well.)

@semarie
Copy link
Contributor

semarie commented Mar 3, 2015

@pnkfelix touch -r is a posix option: http://pubs.opengroup.org/onlinepubs/009695399/utilities/touch.html so it should work for lot of OS.

@nikomatsakis
Copy link
Contributor

@bors r+ 62aa899

Seems good to me, as long as it's sufficiently portable.

cc @alexcrichton @brson

@nikomatsakis
Copy link
Contributor

@bors rollup

@Manishearth
Copy link
Member

@bors force

@bors
Copy link
Collaborator

bors commented Mar 3, 2015

⌛ Testing commit 62aa899 with merge 129173f...

bors added a commit that referenced this pull request Mar 3, 2015
…edits, r=nikomatsakis

Make build timestamp files robust in face of concurrent source modification.

Strategy: If the end goal is to touch e.g. `stamp.std`, then we first touch `stamp.std.start_time` before doing anything else.  Then when the receipe finishes, we touch `stamp.std` using the timestamp from `stamp.std.start_time` as the reference time, and remove `stamp.std.start_time`.

Fix #6518.
@alexcrichton
Copy link
Member

Aw man, looks like I need to get more creative when subverting our build system!

@pnkfelix
Copy link
Member Author

pnkfelix commented Mar 3, 2015

@alexcrichton you should still be able to touch the stamp files after the fact. I find it hard to imagine a work process you're doing now that would stop working ... well, except for the work process that involves racing with rustc. :)

@bors bors merged commit 62aa899 into rust-lang:master Mar 3, 2015
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.

rustc should open the output file as soon as it starts compiling
7 participants