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

Don't fail to remove files if they are missing #82105

Merged
merged 1 commit into from
Feb 17, 2021

Conversation

nagisa
Copy link
Member

@nagisa nagisa commented Feb 14, 2021

In the backend we may want to remove certain temporary files, but in
certain other situations these files might not be produced in the first
place. We don't exactly care about that, and the intent is really that
these files are gone after a certain point in the backend.

Here we unify the backend file removing calls to use ensure_removed
which will attempt to delete a file, but will not fail if it does not
exist (anymore).

The tradeoff to this approach is, of course, that we may miss instances
were we are attempting to remove files at wrong paths due to some bug –
compilation would silently succeed but the temporary files would remain
there somewhere.

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(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 Feb 14, 2021
In the backend we may want to remove certain temporary files, but in
certain other situations these files might not be produced in the first
place. We don't exactly care about that, and the intent is really that
these files are gone after a certain point in the backend.

Here we unify the backend file removing calls to use `ensure_removed`
which will attempt to delete a file, but will not fail if it does not
exist (anymore).

The tradeoff to this approach is, of course, that we may miss instances
were we are attempting to remove files at wrong paths due to some bug –
compilation would silently succeed but the temporary files would remain
there somewhere.
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Feb 15, 2021

📌 Commit fa3621b has been approved by petrochenkov

@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 Feb 15, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 17, 2021
…laumeGomez

Rollup of 11 pull requests

Successful merges:

 - rust-lang#79981 (Add 'consider using' message to overflowing_literals)
 - rust-lang#82094 (To digit simplification)
 - rust-lang#82105 (Don't fail to remove files if they are missing)
 - rust-lang#82136 (Fix ICE: Use delay_span_bug for mismatched subst/hir arg)
 - rust-lang#82169 (Document that `assert!` format arguments are evaluated lazily)
 - rust-lang#82174 (Replace File::create and write_all with fs::write)
 - rust-lang#82196 (Add caveat to Path::display() about lossiness)
 - rust-lang#82198 (Use internal iteration in Iterator::is_sorted_by)
 - rust-lang#82204 (Update books)
 - rust-lang#82207 (rustdoc: treat edition 2021 as unstable)
 - rust-lang#82231 (Add long explanation for E0543)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7292d5f into rust-lang:master Feb 17, 2021
@rustbot rustbot added this to the 1.52.0 milestone Feb 17, 2021
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.

None yet

5 participants