Repository navigation
Windows: fix Dir::remove and Dir::rename following symlinks - #164559
Conversation
|
@bors try |
This comment has been minimized.
This comment has been minimized.
ensure Dir::remove and Dir::rename do not follow symlinks try-job: test-x86_64-msvc*
19f0348 to
3cbd1f6
Compare
This comment has been minimized.
This comment has been minimized.
|
💔 Test for cad40d1 failed: CI. Failed job:
|
|
|
3cbd1f6 to
085caae
Compare
|
@bors try |
This comment has been minimized.
This comment has been minimized.
ensure Dir::remove and Dir::rename do not follow symlinks try-job: test-x86_64-msvc*
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
085caae to
84800e1
Compare
|
r? @ChrisDenton |
|
@ChrisDenton this is a fairly small PR that only touches unstable APIs, so hopefully should not be too hard to review. It's now been waiting for 3 weeks. Happy to assign to another reviewer if there is someone else on the team with sufficient Windows knowledge. :) |
| let tmpdir = tmpdir(); | ||
| let mut f = check!(File::create(tmpdir.join("foo.txt"))); | ||
| check!(f.write(b"bar")); | ||
| check!(f.flush()); |
There was a problem hiding this comment.
Why was this removed? Or why was it there before?
There was a problem hiding this comment.
I removed it because it seemed unnecessary and I was touching this test anyway. There are a couple of flush in this file. The oldest one was added by you in c6f7aa0; #150679 likely just copied that then.
EDIT: I undid this part of the diff. These flush should IMO have comments as they look quite odd, but that is orthogonal to this PR.
There was a problem hiding this comment.
Specifically File::flush is even documented to be a NOP.
Since a File structure doesn’t contain any buffers, this function is currently a no-op on Unix and Windows. Note that this may change in the future.
There was a problem hiding this comment.
It might have been to ensure the metadata is updated before we reopen the file.
There was a problem hiding this comment.
flush is not sync_all though.
I made this a separate PR: #165739.
There was a problem hiding this comment.
Yes, I was speculating as to the intent, not the effect.
84800e1 to
811ebf7
Compare
|
@bors r+ rollup |
…s, r=ChrisDenton Windows: fix Dir::remove and Dir::rename following symlinks Windows `fs::Dir` used to follow symlinks for operations that should instead act on the symlink itself. This fixes that. Fixes rust-lang#164249 try-job: test-x86_64-msvc* Cc @ChrisDenton
…uwer Rollup of 16 pull requests Successful merges: - #165575 (Upgrade bundled musl to 1.2.6) - #163992 (add `core::arch::{x86, x86_64}::x87_f80`) - #165117 (std: use skip_unsupported_miri_tests to control when tests should be skipped in Miri due to missing shims) - #165458 (fix incorrect byte count suffix on MSVC) - #165487 (Migrate built-in macros `pattern_type` & `view_type` to macros 2.0 that expand to internal syntax) - #165490 (Mark the compile unit for `-Zdebuginfo-for-profiling`) - #165586 (Remove `backend_optimization_level`.) - #165646 (fix NumScalableVectors::from_field_count) - #165655 (Unignore passing GCC backend tests) - #165740 (miri subtree update) - #164559 (Windows: fix Dir::remove and Dir::rename following symlinks) - #165682 (interpret: ensure newly created unions have uninit in their padding) - #165693 (Move `check_attr` to attribute parsing) - #165715 (windows: check for null before wide encoding) - #165717 (mpsc_sync::stream_send_recv_stress: wait for all threads to finish) - #165733 (docs(num): remove needless whitespaces) Failed merges: - #165727 (Normalize "beta release channel" in `const-supertrait-unstable` test) - #153261 (Partially stabilize `ptr_alignment_type` as `alignment_type`) - #164218 (Tweak private re-export errors to point at correct span and have more context) - #165709 (remove 'x miri' smoke test from PR CI)
…s, r=ChrisDenton Windows: fix Dir::remove and Dir::rename following symlinks Windows `fs::Dir` used to follow symlinks for operations that should instead act on the symlink itself. This fixes that. Fixes rust-lang#164249 try-job: test-x86_64-msvc* Cc @ChrisDenton
…uwer Rollup of 16 pull requests Successful merges: - #165575 (Upgrade bundled musl to 1.2.6) - #163992 (add `core::arch::{x86, x86_64}::x87_f80`) - #165117 (std: use skip_unsupported_miri_tests to control when tests should be skipped in Miri due to missing shims) - #165458 (fix incorrect byte count suffix on MSVC) - #165490 (Mark the compile unit for `-Zdebuginfo-for-profiling`) - #165586 (Remove `backend_optimization_level`.) - #165646 (fix NumScalableVectors::from_field_count) - #165655 (Unignore passing GCC backend tests) - #165740 (miri subtree update) - #153261 (Partially stabilize `ptr_alignment_type` as `alignment_type`) - #164559 (Windows: fix Dir::remove and Dir::rename following symlinks) - #165682 (interpret: ensure newly created unions have uninit in their padding) - #165693 (Move `check_attr` to attribute parsing) - #165715 (windows: check for null before wide encoding) - #165717 (mpsc_sync::stream_send_recv_stress: wait for all threads to finish) - #165733 (docs(num): remove needless whitespaces) Failed merges: - #165727 (Normalize "beta release channel" in `const-supertrait-unstable` test) - #164218 (Tweak private re-export errors to point at correct span and have more context) - #165709 (remove 'x miri' smoke test from PR CI)
…s, r=ChrisDenton Windows: fix Dir::remove and Dir::rename following symlinks Windows `fs::Dir` used to follow symlinks for operations that should instead act on the symlink itself. This fixes that. Fixes rust-lang#164249 try-job: test-x86_64-msvc* Cc @ChrisDenton
…s, r=ChrisDenton Windows: fix Dir::remove and Dir::rename following symlinks Windows `fs::Dir` used to follow symlinks for operations that should instead act on the symlink itself. This fixes that. Fixes rust-lang#164249 try-job: test-x86_64-msvc* Cc @ChrisDenton
…uwer Rollup of 24 pull requests Successful merges: - #165709 (remove 'x miri' smoke test from PR CI) - #164217 (Prepare to make `rustc_trivial_field_reads` usable in user code) - #165569 (`Move` trait feature gate) - #165575 (Upgrade bundled musl to 1.2.6) - #163241 (Add enclosing item context when pointing at `FnMut` bound) - #163992 (add `core::arch::{x86, x86_64}::x87_f80`) - #165047 (Change the span building of paths from first-to-last to chained) - #165458 (fix incorrect byte count suffix on MSVC) - #165490 (Mark the compile unit for `-Zdebuginfo-for-profiling`) - #165586 (Remove `backend_optimization_level`.) - #165646 (fix NumScalableVectors::from_field_count) - #165655 (Unignore passing GCC backend tests) - #165740 (miri subtree update) - #165753 (avoid Terminator:None in MIR inliner) - #153261 (Partially stabilize `ptr_alignment_type` as `alignment_type`) - #164559 (Windows: fix Dir::remove and Dir::rename following symlinks) - #165562 (stop using gce in a test) - #165681 (Add safety requirements for Pattern and Searcher) - #165682 (interpret: ensure newly created unions have uninit in their padding) - #165693 (Move `check_attr` to attribute parsing) - #165715 (windows: check for null before wide encoding) - #165717 (mpsc_sync::stream_send_recv_stress: wait for all threads to finish) - #165733 (docs(num): remove needless whitespaces) - #165739 (remove NOP File::flush from fs tests) Failed merges: - #165727 (Normalize "beta release channel" in `const-supertrait-unstable` test) - #164218 (Tweak private re-export errors to point at correct span and have more context)
…uwer Rollup of 24 pull requests Successful merges: - #165709 (remove 'x miri' smoke test from PR CI) - #164217 (Prepare to make `rustc_trivial_field_reads` usable in user code) - #165569 (`Move` trait feature gate) - #165575 (Upgrade bundled musl to 1.2.6) - #163241 (Add enclosing item context when pointing at `FnMut` bound) - #163992 (add `core::arch::{x86, x86_64}::x87_f80`) - #165047 (Change the span building of paths from first-to-last to chained) - #165458 (fix incorrect byte count suffix on MSVC) - #165490 (Mark the compile unit for `-Zdebuginfo-for-profiling`) - #165586 (Remove `backend_optimization_level`.) - #165646 (fix NumScalableVectors::from_field_count) - #165655 (Unignore passing GCC backend tests) - #165740 (miri subtree update) - #165753 (avoid Terminator:None in MIR inliner) - #153261 (Partially stabilize `ptr_alignment_type` as `alignment_type`) - #164559 (Windows: fix Dir::remove and Dir::rename following symlinks) - #165562 (stop using gce in a test) - #165681 (Add safety requirements for Pattern and Searcher) - #165682 (interpret: ensure newly created unions have uninit in their padding) - #165693 (Move `check_attr` to attribute parsing) - #165715 (windows: check for null before wide encoding) - #165717 (mpsc_sync::stream_send_recv_stress: wait for all threads to finish) - #165733 (docs(num): remove needless whitespaces) - #165739 (remove NOP File::flush from fs tests) Failed merges: - #165727 (Normalize "beta release channel" in `const-supertrait-unstable` test) - #164218 (Tweak private re-export errors to point at correct span and have more context)
Rollup merge of #164559 - RalfJung:dir-remove-rename-symlinks, r=ChrisDenton Windows: fix Dir::remove and Dir::rename following symlinks Windows `fs::Dir` used to follow symlinks for operations that should instead act on the symlink itself. This fixes that. Fixes #164249 try-job: test-x86_64-msvc* Cc @ChrisDenton
View all comments
Windows
fs::Dirused to follow symlinks for operations that should instead act on the symlink itself. This fixes that.Fixes #164249
try-job: test-x86_64-msvc*
Cc @ChrisDenton