From a4be49661a9cc18e3e61b8bfde3f469470b3f0a2 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Sun, 8 Sep 2024 02:34:25 +0700 Subject: [PATCH 1/4] doc(typo): master -> main --- HOW-TO-RELEASE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HOW-TO-RELEASE.md b/HOW-TO-RELEASE.md index eee2a9c6..b4466ae4 100644 --- a/HOW-TO-RELEASE.md +++ b/HOW-TO-RELEASE.md @@ -19,6 +19,6 @@ ```bash VER_NUM=v1.x.x git tag -as $VER_NUM -m $VER_NUM - git push origin master + git push origin main git push origin $VER_NUM ``` From 410a30e0cad1015d2df22675304970192cdccc66 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Sun, 8 Sep 2024 10:07:03 +0700 Subject: [PATCH 2/4] chore: Clearer assertions --- src/internals/cast.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/internals/cast.rs b/src/internals/cast.rs index 54b6cbd6..f6dd5637 100644 --- a/src/internals/cast.rs +++ b/src/internals/cast.rs @@ -10,13 +10,16 @@ pub struct BytesAsReparseDataBuffer { value: Box<[MaybeU8; MAXIMUM_REPARSE_DATA_BUFFER_SIZE as usize]>, } +// Asserts that pointers of `BytesAsReparseDataBuffer` can be casted to +// `REPARSE_DATA_BUFFER`. const _: () = { let a = align_of::(); let b = align_of::(); - [(); 1][!((a % b) == 0) as usize] + assert!((a % b) == 0); }; impl BytesAsReparseDataBuffer { + // MSRV(1.82): Use `Box::new_uninit_slice` instead. pub fn new() -> Self { type Raw = [MaybeU8; MAXIMUM_REPARSE_DATA_BUFFER_SIZE as usize]; const LAYOUT: Layout = Layout::new::(); From 32cca7b237f3d02e1e7d7a476d402aab8cfec175 Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Wed, 3 Sep 2025 09:30:50 +0700 Subject: [PATCH 3/4] Bump windows-sys to 0.60 --- .github/workflows/ci.yml | 4 +- Cargo.lock | 206 ++++++++++++++++----------------------- Cargo.toml | 12 +-- src/internals.rs | 8 +- 4 files changed, 95 insertions(+), 135 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe26eaab..83f5e1d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,8 +81,8 @@ jobs: runs-on: windows-latest # needs: [build] env: - # assert! in consts - MSRV: 1.57.0 + # windows-sys MSRV + MSRV: 1.60.0 steps: - uses: actions/checkout@v4 - run: | diff --git a/Cargo.lock b/Cargo.lock index 617e5054..419dcd3b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,80 +4,88 @@ version = 3 [[package]] name = "bitflags" -version = "1.3.2" +version = "2.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] name = "fastrand" -version = "2.1.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi", +] [[package]] name = "junction" -version = "1.2.0" +version = "1.3.0" dependencies = [ - "rustix", "scopeguard", "tempfile", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] name = "libc" -version = "0.2.158" +version = "0.2.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] -name = "redox_syscall" -version = "0.3.5" +name = "once_cell" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "rustix" -version = "0.38.9" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bfe0f2582b4931a45d1fa608f8a8722e8b3c7ac54dd6d5f3b3212791fedef49" +checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" dependencies = [ - "bitflags 2.6.0", + "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -88,152 +96,108 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "tempfile" -version = "3.8.0" +version = "3.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "15b61f8f20e3a6f7e0649d825294eaf317edce30f82cf6026e7e4cb9222a7d1e" dependencies = [ - "cfg-if", "fastrand", - "redox_syscall", + "getrandom", + "once_cell", "rustix", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] -name = "windows-sys" -version = "0.48.0" +name = "wasi" +version = "0.14.3+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "6a51ae83037bdd272a9e28ce236db8c07016dd0d50c27038b3f407533c030c95" dependencies = [ - "windows-targets 0.48.5", + "wit-bindgen", ] [[package]] -name = "windows-sys" -version = "0.52.0" +name = "windows-link" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" [[package]] -name = "windows-targets" -version = "0.48.5" +name = "windows-sys" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets", ] [[package]] name = "windows-targets" -version = "0.52.6" +version = "0.53.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", + "windows-link", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.5" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" [[package]] name = "windows_aarch64_msvc" -version = "0.48.5" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" [[package]] name = "windows_i686_gnu" -version = "0.52.6" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" [[package]] name = "windows_i686_gnullvm" -version = "0.52.6" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" [[package]] name = "windows_i686_msvc" -version = "0.48.5" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" [[package]] name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.6" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" [[package]] name = "windows_x86_64_msvc" -version = "0.48.5" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" [[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" +name = "wit-bindgen" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +checksum = "052283831dbae3d879dc7f51f3d92703a316ca49f91540417d38591826127814" diff --git a/Cargo.toml b/Cargo.toml index bc97f453..8842524d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "junction" -version = "1.2.0" # Also update `html_root_url` in lib.rs +version = "1.3.0" # Also update `html_root_url` in lib.rs authors = ["Lzu Tao "] categories = ["api-bindings", "os::windows-apis"] edition = "2021" -rust-version = "1.57" +rust-version = "1.60" exclude = [ "/.github", "/HOW-TO-RELEASE.md", @@ -43,7 +43,7 @@ version = "1" default-features = false [target.'cfg(windows)'.dependencies.windows-sys] -version = "0.52" +version = "0.60" default-features = false features = [ "Win32_System_Ioctl", @@ -56,8 +56,4 @@ features = [ ] [dev-dependencies] -tempfile = "=3.8.0" -# NOTE: rustix is used by tempfile, to force tempfile use an old version -# of it that is compatible with MSRV. -# MSRV: v0.38.9+ has newer dep:core syntax that old rustc (<1.60) confuses. -rustix = "=0.38.9" +tempfile = "3.21.0" diff --git a/src/internals.rs b/src/internals.rs index 1ec68b7c..72e179e9 100644 --- a/src/internals.rs +++ b/src/internals.rs @@ -78,12 +78,12 @@ pub fn create(target: &Path, junction: &Path) -> io::Result<()> { size.wrapping_add(c::REPARSE_DATA_BUFFER_HEADER_SIZE) }; - helpers::set_reparse_point(file.as_raw_handle() as isize, rdb, u32::from(in_buffer_size)) + helpers::set_reparse_point(file.as_raw_handle(), rdb, u32::from(in_buffer_size)) } pub fn delete(junction: &Path) -> io::Result<()> { let file = helpers::open_reparse_point(junction, true)?; - helpers::delete_reparse_point(file.as_raw_handle() as isize) + helpers::delete_reparse_point(file.as_raw_handle()) } pub fn exists(junction: &Path) -> io::Result { @@ -95,7 +95,7 @@ pub fn exists(junction: &Path) -> io::Result { let mut data = BytesAsReparseDataBuffer::new(); // XXX: Could also use FindFirstFile to read the reparse point type // Ref https://learn.microsoft.com/en-us/windows/win32/fileio/reparse-point-tags - helpers::get_reparse_data_point(file.as_raw_handle() as isize, data.as_mut_ptr())?; + helpers::get_reparse_data_point(file.as_raw_handle(), data.as_mut_ptr())?; // SATETY: rdb should be initialized now let rdb = unsafe { data.assume_init() }; // The reparse tag indicates if this is a junction or not @@ -109,7 +109,7 @@ pub fn get_target(junction: &Path) -> io::Result { } let file = helpers::open_reparse_point(junction, false)?; let mut data = BytesAsReparseDataBuffer::new(); - helpers::get_reparse_data_point(file.as_raw_handle() as isize, data.as_mut_ptr())?; + helpers::get_reparse_data_point(file.as_raw_handle(), data.as_mut_ptr())?; // SAFETY: rdb should be initialized now let rdb = unsafe { data.assume_init() }; if rdb.ReparseTag == c::IO_REPARSE_TAG_MOUNT_POINT { From 7258b9501c54baedccd9b9cdee778a28b5f46532 Mon Sep 17 00:00:00 2001 From: tesuji Date: Wed, 3 Sep 2025 09:37:08 +0700 Subject: [PATCH 4/4] doc: bump version --- CHANGELOG.md | 7 ++++++- README.md | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45558331..05b7970f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,9 +25,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * `Fixed` for any bug fixes. * `Security` in case of vulnerabilities. --> +## [v1.3.0] - 2025-09-03 +### Change MSRV from 1.57 to 1.60 +This is the same MSRV that our direct dependency `windows-sys` requires (pr#29). + ## [v1.2.0] - 2024-09-08 ### Change MSRV from 1.56 to 1.57 -Minor refactorings to abuse assertions in constants that Rust 1.57.0 allows. +Minor refactoring to abuse assertions in constants that Rust 1.57.0 allows. ## [v1.1.0] - 2024-04-30 ### Change MSRV from 1.51 to 1.56 @@ -66,6 +70,7 @@ It signals that the API is mature enough to be stable for a long time. First release +[v1.3.0]: https://github.com/lzutao/junction/compare/v1.2.0...v1.3.0 [v1.2.0]: https://github.com/lzutao/junction/compare/v1.1.0...v1.2.0 [v1.1.0]: https://github.com/lzutao/junction/compare/v1.0.0...v1.1.0 [v1.0.0]: https://github.com/lzutao/junction/compare/v0.2.1...v1.0.0 diff --git a/README.md b/README.md index 5623c349..f03a6ea5 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Quoted from [Computer Hope](https://www.computerhope.com/jargon/j/junction.htm): ### Minimal Supported Rust versions -1.57.0 +Specified in the `rust-version` field in `Cargo.toml`. ## All relevant references