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

Prevent rustc overwriting input files #46814

Merged
merged 3 commits into from Dec 22, 2017

Conversation

Projects
None yet
7 participants
@varkor
Contributor

varkor commented Dec 18, 2017

If rustc is invoked on a file that would be overwritten by the
compilation, the compilation now fails, to avoid accidental loss. This
resolves #13019. Kudos to @estebank, whose patch I finished off.

Prevent rustc overwriting input files
If rustc is invoked on a file that would be overwritten by the
compilation, the compilation now fails, to avoid accidental loss. This
resolves #13019.
@rust-highfive

This comment has been minimized.

Show comment
Hide comment
@rust-highfive

rust-highfive Dec 18, 2017

Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @eddyb (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

Collaborator

rust-highfive commented Dec 18, 2017

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @eddyb (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@eddyb

This comment has been minimized.

Show comment
Hide comment
@eddyb
Member

eddyb commented Dec 18, 2017

@rust-highfive rust-highfive assigned alexcrichton and unassigned eddyb Dec 18, 2017

@alexcrichton

This comment has been minimized.

Show comment
Hide comment
@alexcrichton

alexcrichton Dec 18, 2017

Member

Thanks for the PR! Would it be possible to perhaps avoid duplicating the invocation of build_output_filenames and reuse it being created elsewhere? Other than that though looks great!

Member

alexcrichton commented Dec 18, 2017

Thanks for the PR! Would it be possible to perhaps avoid duplicating the invocation of build_output_filenames and reuse it being created elsewhere? Other than that though looks great!

@varkor

This comment has been minimized.

Show comment
Hide comment
@varkor

varkor Dec 18, 2017

Contributor

Which invocation of build_output_filenames would be most appropriate to reuse? The one in driver.rs seems to be the only one that is guaranteed to be called — but then the input filename would probably need to be passed to compile_input as well. Is it preferable to add an extra parameter here to avoid the extra invocation?

Contributor

varkor commented Dec 18, 2017

Which invocation of build_output_filenames would be most appropriate to reuse? The one in driver.rs seems to be the only one that is guaranteed to be called — but then the input filename would probably need to be passed to compile_input as well. Is it preferable to add an extra parameter here to avoid the extra invocation?

@eddyb

This comment has been minimized.

Show comment
Hide comment
@eddyb

eddyb Dec 18, 2017

Member

@varkor Yes, feel free to change rustc_driver APIs.

Member

eddyb commented Dec 18, 2017

@varkor Yes, feel free to change rustc_driver APIs.

@varkor

This comment has been minimized.

Show comment
Hide comment
@varkor

varkor Dec 19, 2017

Contributor

Done, thanks!

Contributor

varkor commented Dec 19, 2017

Done, thanks!

@alexcrichton

This comment has been minimized.

Show comment
Hide comment
@alexcrichton

alexcrichton Dec 19, 2017

Member

Thanks! Looks like there's a test that's failing though?

Member

alexcrichton commented Dec 19, 2017

Thanks! Looks like there's a test that's failing though?

@varkor

This comment has been minimized.

Show comment
Hide comment
@varkor

varkor Dec 19, 2017

Contributor

Ah, let an invocation slip through the net. Fixed.

Contributor

varkor commented Dec 19, 2017

Ah, let an invocation slip through the net. Fixed.

@alexcrichton

This comment has been minimized.

Show comment
Hide comment
@alexcrichton

alexcrichton Dec 19, 2017

Member

@bors: r+

Thanks!

Member

alexcrichton commented Dec 19, 2017

@bors: r+

Thanks!

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Dec 19, 2017

Contributor

📌 Commit 3a29f28 has been approved by alexcrichton

Contributor

bors commented Dec 19, 2017

📌 Commit 3a29f28 has been approved by alexcrichton

@frewsxcv

This comment has been minimized.

Show comment
Hide comment
@frewsxcv

frewsxcv Dec 21, 2017

Member

@bors rollup

Member

frewsxcv commented Dec 21, 2017

@bors rollup

kennytm added a commit to kennytm/rust that referenced this pull request Dec 21, 2017

Rollup merge of rust-lang#46814 - varkor:contrib-7, r=alexcrichton
Prevent rustc overwriting input files

If rustc is invoked on a file that would be overwritten by the
compilation, the compilation now fails, to avoid accidental loss. This
resolves rust-lang#13019. Kudos to @estebank, whose patch I finished off.

bors added a commit that referenced this pull request Dec 21, 2017

Auto merge of #46922 - kennytm:rollup, r=kennytm
Rollup of 15 pull requests

- Successful merges: #46636, #46780, #46784, #46809, #46814, #46820, #46839, #46847, #46858, #46878, #46884, #46890, #46898, #46916, #46918
- Failed merges:

bors added a commit that referenced this pull request Dec 21, 2017

Auto merge of #46922 - kennytm:rollup, r=kennytm
Rollup of 14 pull requests

- Successful merges: #46636, #46780, #46784, #46809, #46814, #46820, #46839, #46847, #46858, #46878, #46884, #46890, #46898, #46918
- Failed merges:

@bors bors merged commit 3a29f28 into rust-lang:master Dec 22, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@varkor varkor deleted the varkor:contrib-7 branch Dec 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment