Uh oh!
There was an error while loading. Please reload this page.
run_make_support: rectify symlink handling - #130427
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
run_make_support: rectify symlink handling Avoid confusing Unix symlinks and Windows symlinks, and since their semantics are quite different we should avoid trying to make it to automagic in how symlinks are created and deleted. Notably, the tests should reflect what type of symlinks are to be created to match what std does to make it less surprising for test readers. r? `@ghost` try-job: x86_64-msvc try-job: aarch64-apple
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
1fd1378 to
49d4c6bCompare| } | ||
| #[cfg(windows)] | ||
| { | ||
| rfs::windows::symlink_file( |
There was a problem hiding this comment.
This seems quite cumbersome, error-prone and hard to read. Can't we create more precise variants of the symlink functions (symlink_file, symlink_dir - or whatever other versions needed) and then let each runmake test decide which exact variant it needs, and handle the implementation difference itself in rfs?
The test will probably always do the same thing on Unix and Windows; we just need to force the test to be more explicit in what kind of symlink it needs.
Like this:
// runmake test
rfs::symlink_file("a","b");
rfs::symlink_dir("x","y");// rfs
unix::symlink_file => symlink
unix::symlink_dir => symlink
windows::symlink_file => symlink_file
windows::symlink_dir => symlink_dirThere was a problem hiding this comment.
Yeah that seems reasonable. I'll change this tomorrow.
There was a problem hiding this comment.
(I lied I changed this today)
49d4c6b to
a46d4bbComparejieyouxu
commented
Sep 16, 2024
Should be ready for review now. r? @Kobzol since you're already looking at it |
a46d4bb to
555a732CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Avoid confusing Unix symlinks and Windows symlinks, and since their semantics are quite different we should avoid trying to make it to automagic in how symlinks are created and deleted. Notably, the tests should reflect what type of symlinks are to be created to match what std does to make it less surprising for test readers.
555a732 to
e81c05eCompare
Kobzol
left a comment
There was a problem hiding this comment.
Left one nit, otherwise LGTM. Is symlink_metadata intended for future usage or are you planning to modify more tests in this PR?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jieyouxu
commented
Sep 16, 2024
|
e81c05e to
7d76428Comparejieyouxu
commented
Sep 16, 2024
Fixed the tests to use |
Kobzol
commented
Sep 16, 2024
Good :) You can r=me once CI is green. |
jieyouxu
commented
Sep 17, 2024
bors
commented
Sep 17, 2024
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#130380 (coverage: Clarify some parts of coverage counter creation) - rust-lang#130427 (run_make_support: rectify symlink handling) - rust-lang#130447 (rustc_llvm: update for llvm/llvm-project@2ae968a0d9fb61606b020e898d88…) - rust-lang#130448 (fix: Remove duplicate `LazyLock` example.) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#130427 - jieyouxu:rmake-symlink, r=Kobzol run_make_support: rectify symlink handling Avoid confusing Unix symlinks and Windows symlinks. Since their semantics are quite different, we should avoid trying to make it automagic in how symlinks are created and deleted. Notably, the tests should reflect what type of symlinks are to be created to match what std does to make it less surprising for test readers.
Avoid confusing Unix symlinks and Windows symlinks. Since their
semantics are quite different, we should avoid trying to make it
automagic in how symlinks are created and deleted. Notably, the tests
should reflect what type of symlinks are to be created to match what std
does to make it less surprising for test readers.