Skip to content

Commit

Permalink
Release v1.0.0
Browse files Browse the repository at this point in the history
Pin down rust 1.51 as MSRV
  • Loading branch information
tesuji committed Feb 26, 2023
1 parent 0ddc572 commit 89a975b
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 14 deletions.
31 changes: 27 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ on:
- '!gh-pages'
pull_request:

env:
SPARSE_TOOLCHAIN: nightly-2023-02-25

jobs:
build:
if: false
runs-on: windows-latest
env:
RUST_BACKTRACE: 1
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
MINGW_URL: https://ci-mirrors.rust-lang.org/rustc
RUSTC_TOOLCHAIN: nightly-2023-02-25
MIRIFLAGS: -Zmiri-disable-isolation
strategy:
matrix:
Expand All @@ -29,9 +32,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: |
echo "${RUSTC_TOOLCHAIN}"
rustup toolchain install "nightly-2023-02-25-${{ matrix.target }}"
rustup default "nightly-2023-02-25-${{ matrix.target }}"
rustup toolchain install "${{ env.SPARSE_TOOLCHAIN }}-${{ matrix.target }}"
rustup default "${{ env.SPARSE_TOOLCHAIN }}-${{ matrix.target }}"
- name: Check out MinGW toolchain
run: |
set -x
Expand Down Expand Up @@ -63,6 +65,27 @@ jobs:
dir /aL C:\Users
shell: cmd

msrv:
runs-on: windows-latest
# needs: [build]
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
# add_of_mut! requires for soundness
MSRV: 1.51.0
steps:
- uses: actions/checkout@v3
- run: |
rustup toolchain install ${{ env.MSRV }}
rustup toolchain install ${{ env.SPARSE_TOOLCHAIN }}
rustup default ${{ env.MSRV }}
- run: |
rustup run ${{ env.SPARSE_TOOLCHAIN }} cargo generate-lockfile
rustup run ${{ env.SPARSE_TOOLCHAIN }} cargo fetch
- run: |
cargo build --all-targets --locked
- run: |
cargo test
rustfmt:
runs-on: ubuntu-latest
steps:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* `Security` in case of vulnerabilities.
-->

## [v1.0.0] - 2023-02-26
### First major version
The public API of this crate has been unchanged around 3 years without complains.
It signals that the API is mature enough to be stable for a long time.

## [v0.2.1] - 2023-02-25
### Fixed
* Fix weird build failure when cross-compiling from non-Windows hosts
Expand All @@ -52,6 +57,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

First release

[v1.0.0]: https://github.com/lzutao/junction/compare/v0.2.1...v1.0.0
[v0.2.1]: https://github.com/lzutao/junction/compare/v0.2.0...v0.2.1
[v0.2.0]: https://github.com/lzutao/junction/compare/v0.1.0...v0.2.0
[v0.1.5]: https://github.com/lzutao/junction/compare/v0.1.4...v0.1.5
[v0.1.4]: https://github.com/lzutao/junction/compare/v0.1.3...v0.1.4
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "junction"
version = "0.2.1" # Also update `html_root_url` in lib.rs
version = "1.0.0" # Also update `html_root_url` in lib.rs
authors = ["Lzu Tao <[email protected]>"]
categories = ["api-bindings", "os::windows-apis"]
documentation = "https://docs.rs/junction/*/x86_64-pc-windows-msvc/junction/"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Library for working with NTFS junctions.
[![Documentation](https://docs.rs/junction/badge.svg)](https://docs.rs/junction)
[![Crates.io](https://img.shields.io/crates/v/junction.svg)](https://crates.io/crates/junction)

### Supported Rust versions
### Minimal Supported Rust versions

Latest stable
1.48.0

## All relevant references

Expand Down
11 changes: 5 additions & 6 deletions src/internals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ const _: () = {
use std::alloc::Layout;
let std_layout = Layout::new::<std::os::windows::io::RawHandle>();
let winapi_layout = Layout::new::<winapi::um::winnt::HANDLE>();
assert!(std_layout.size() == winapi_layout.size());
assert!(std_layout.align() == winapi_layout.align());
// MSVR(Rust v1.57): use assert! instead
[(); 1][!(std_layout.size() == winapi_layout.size()) as usize];
[(); 1][!(std_layout.align() == winapi_layout.align()) as usize];
};

/// This prefix indicates to NTFS that the path is to be treated as a non-interpreted
Expand Down Expand Up @@ -141,14 +142,12 @@ pub fn get_target(junction: &Path) -> io::Result<PathBuf> {
if rdb.reparse_tag == IO_REPARSE_TAG_MOUNT_POINT {
let offset = rdb.reparse_buffer.substitute_name_offset / WCHAR_SIZE;
let len = rdb.reparse_buffer.substitute_name_length / WCHAR_SIZE;
let mut wide = unsafe {
let wide = unsafe {
let buf = rdb.reparse_buffer.path_buffer.as_ptr().add(offset as usize);
slice::from_raw_parts(buf, len as usize)
};
// In case of "\??\C:\foo\bar"
if wide.starts_with(&NON_INTERPRETED_PATH_PREFIX) {
wide = &wide[(NON_INTERPRETED_PATH_PREFIX.len())..];
}
let wide = wide.strip_prefix(&NON_INTERPRETED_PATH_PREFIX).unwrap_or(wide);
Ok(PathBuf::from(OsString::from_wide(wide)))
} else {
Err(io::Error::new(io::ErrorKind::Other, "not a reparse tag mount point"))
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if the directory `D:\SYMLINK` specified `C:\WINNT\SYSTEM32` as its target, then
an application accessing `D:\SYMLINK\DRIVERS` would in reality be accessing
`C:\WINNT\SYSTEM32\DRIVERS`.
*/
#![doc(html_root_url = "https://docs.rs/junction/0.2.1")]
#![doc(html_root_url = "https://docs.rs/junction/~1")]
#![cfg(windows)]
#![deny(rust_2018_idioms)]

Expand Down

0 comments on commit 89a975b

Please sign in to comment.