From 504fe785be26a8adf61b408e5d6a9403b7e4d218 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 18 Apr 2022 16:25:03 +0800 Subject: [PATCH 1/4] Enable MSRV checks on windows (#298) Now that the `windows` crate is part of the dependency tree it must be tested specifically for MSRV support. Related to https://github.com/microsoft/windows-rs/issues/1699, let's hope that edition 2018 can be supported or we have to wait. --- .github/workflows/msrv.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index 58914b8d4ed..a0542353ca8 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -14,7 +14,12 @@ name: Minimum Supported Rust Version jobs: rustfmt: name: cargo check MSRV - runs-on: ubuntu-latest + strategy: + matrix: + os: + - windows-2019 + - ubuntu-latest + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 From 0f141ca5f29ea3f75372a8d030fd8ecfa4f72d10 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 3 May 2022 08:03:01 +0800 Subject: [PATCH 2/4] adjust msrv to the one required by `windows` crates (#298) --- .github/workflows/msrv.yml | 2 +- git-repository/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index a0542353ca8..f08c672d15b 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -25,6 +25,6 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: "1.54.0" + toolchain: "1.59.0" # dictated by `windows` crates effectively override: true - run: make check-msrv-on-ci diff --git a/git-repository/Cargo.toml b/git-repository/Cargo.toml index c3865265e90..a141442e260 100644 --- a/git-repository/Cargo.toml +++ b/git-repository/Cargo.toml @@ -7,7 +7,7 @@ version = "0.17.0" authors = ["Sebastian Thiel "] edition = "2018" include = ["src/**/*", "CHANGELOG.md"] -rust-version = "1.54" # need VecDeque::binary_search +rust-version = "1.59" [lib] doctest = false From b039d39613bb14d49670c4d8b586f76ffb420d03 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 3 May 2022 08:12:26 +0800 Subject: [PATCH 3/4] upgrade dependencies (#298) --- Cargo.lock | 59 ++++++++++++++++++++++----------------- git-config/Cargo.toml | 2 +- git-repository/Cargo.toml | 3 +- git-sec/Cargo.toml | 2 +- git-sec/src/identity.rs | 6 ++-- tests/tools/Cargo.toml | 2 +- 6 files changed, 40 insertions(+), 34 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cecbcc02eb0..950950b5423 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -556,18 +556,18 @@ dependencies = [ [[package]] name = "crc" -version = "2.1.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49fc9a695bca7f35f5f4c15cddc84415f66a74ea78eef08e90c5024f2b540e23" +checksum = "53757d12b596c16c78b83458d732a5d1a17ab3f53f2f7412f6fb57cc8a140ab3" dependencies = [ "crc-catalog", ] [[package]] name = "crc-catalog" -version = "1.1.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403" +checksum = "2d0165d2900ae6778e36e80bbc4da3b5eefccee9ba939761f9c2882a5d9af3ff" [[package]] name = "crc32fast" @@ -1448,7 +1448,6 @@ dependencies = [ "tempfile", "thiserror", "unicode-normalization", - "utf8-width", ] [[package]] @@ -2489,6 +2488,12 @@ dependencies = [ "semver", ] +[[package]] +name = "rustversion" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" + [[package]] name = "ryu" version = "1.0.9" @@ -2584,9 +2589,9 @@ dependencies = [ [[package]] name = "serial_test" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0bccbcf40c8938196944a3da0e133e031a33f4d6b72db3bda3cc556e361905d" +checksum = "e5bcc41d18f7a1d50525d080fd3e953be87c4f9f1a974f3c21798ca00d54ec15" dependencies = [ "lazy_static", "parking_lot 0.11.2", @@ -2595,12 +2600,14 @@ dependencies = [ [[package]] name = "serial_test_derive" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2acd6defeddb41eb60bb468f8825d0cfd0c2a76bc03bfd235b6a1dc4f6a1ad5" +checksum = "2881bccd7d60fb32dfa3d7b3136385312f8ad75e2674aab2852867a09790cae8" dependencies = [ + "proc-macro-error", "proc-macro2", "quote", + "rustversion", "syn", ] @@ -3159,15 +3166,15 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.35.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08746b4b7ac95f708b3cccceb97b7f9a21a8916dd47fc99b0e6aaf7208f26fd7" +checksum = "e53b97a83176b369b0eb2fd8158d4ae215357d02df9d40c1e1bf1879c5482c80" dependencies = [ - "windows_aarch64_msvc 0.35.0", - "windows_i686_gnu 0.35.0", - "windows_i686_msvc 0.35.0", - "windows_x86_64_gnu 0.35.0", - "windows_x86_64_msvc 0.35.0", + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", ] [[package]] @@ -3191,9 +3198,9 @@ checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" [[package]] name = "windows_aarch64_msvc" -version = "0.35.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3bc5134e8ce0da5d64dcec3529793f1d33aee5a51fc2b4662e0f881dd463e6" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" [[package]] name = "windows_i686_gnu" @@ -3203,9 +3210,9 @@ checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" [[package]] name = "windows_i686_gnu" -version = "0.35.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0343a6f35bf43a07b009b8591b78b10ea03de86b06f48e28c96206cd0f453b50" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" [[package]] name = "windows_i686_msvc" @@ -3215,9 +3222,9 @@ checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" [[package]] name = "windows_i686_msvc" -version = "0.35.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1acdcbf4ca63d8e7a501be86fee744347186275ec2754d129ddeab7a1e3a02e4" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" [[package]] name = "windows_x86_64_gnu" @@ -3227,9 +3234,9 @@ checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" [[package]] name = "windows_x86_64_gnu" -version = "0.35.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "893c0924c5a990ec73cd2264d1c0cba1773a929e1a3f5dbccffd769f8c4edebb" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" [[package]] name = "windows_x86_64_msvc" @@ -3239,9 +3246,9 @@ checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" [[package]] name = "windows_x86_64_msvc" -version = "0.35.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a29bd61f32889c822c99a8fdf2e93378bd2fae4d7efd2693fab09fcaaf7eff4b" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] name = "xz2" diff --git a/git-config/Cargo.toml b/git-config/Cargo.toml index 18a5d9dd077..0d615ecf674 100644 --- a/git-config/Cargo.toml +++ b/git-config/Cargo.toml @@ -27,7 +27,7 @@ unicode-bom = "1.1.4" bstr = { version = "0.2.13", default-features = false, features = ["std"] } [dev-dependencies] -serial_test = "0.5.1" +serial_test = "0.6.0" serde_derive = "1.0" criterion = "0.3" tempfile = "3.2.0" diff --git a/git-repository/Cargo.toml b/git-repository/Cargo.toml index a141442e260..2fcefd518cb 100644 --- a/git-repository/Cargo.toml +++ b/git-repository/Cargo.toml @@ -87,8 +87,7 @@ git-worktree = { version = "^0.1.0", path = "../git-worktree", optional = true } signal-hook = { version = "0.3.9", default-features = false } thiserror = "1.0.26" clru = "0.5.0" -byte-unit = "=4.0.13" # this version is the last with edition 2018, needed for msrv -utf8-width-to-force-version-only = { package = "utf8-width", version = "=0.1.5" } +byte-unit = "4.0" log = "0.4.14" document-features = { version = "0.2.0", optional = true } diff --git a/git-sec/Cargo.toml b/git-sec/Cargo.toml index 7a40bcb7b82..9c63eff2c84 100644 --- a/git-sec/Cargo.toml +++ b/git-sec/Cargo.toml @@ -24,7 +24,7 @@ bitflags = "1.3.2" libc = "0.2.123" [target.'cfg(windows)'.dependencies] -windows = { version = "0.35.0", features = [ "alloc", +windows = { version = "0.36.0", features = [ "alloc", "Win32_Foundation", "Win32_Security_Authorization", "Win32_Storage_FileSystem", diff --git a/git-sec/src/identity.rs b/git-sec/src/identity.rs index 2483c0fc356..a9acd4bef2e 100644 --- a/git-sec/src/identity.rs +++ b/git-sec/src/identity.rs @@ -51,7 +51,7 @@ mod impl_ { use windows::{ core::PCWSTR, Win32::{ - Foundation::{BOOL, ERROR_SUCCESS, HANDLE, PSID}, + Foundation::{BOOL, HANDLE, PSID}, Security::{ Authorization::{GetNamedSecurityInfoW, SE_FILE_OBJECT}, CheckTokenMembershipEx, OWNER_SECURITY_INFORMATION, PSECURITY_DESCRIPTOR, @@ -80,7 +80,7 @@ mod impl_ { &mut pdescriptor, ); - if result == ERROR_SUCCESS.0 { + if result.is_ok() { let mut is_member = BOOL(0); if CheckTokenMembershipEx(HANDLE::default(), psid, 0, &mut is_member).as_bool() { is_owned = is_member.as_bool(); @@ -88,7 +88,7 @@ mod impl_ { err_msg = String::from("Could not check token membership").into(); } } else { - err_msg = format!("Could not get security information for path with err: {}", result).into(); + err_msg = format!("Could not get security information for path with err: {:?}", result).into(); } LocalFree(pdescriptor.0 as isize); diff --git a/tests/tools/Cargo.toml b/tests/tools/Cargo.toml index 8ad5a3bdcd4..f5ec1348f7f 100644 --- a/tests/tools/Cargo.toml +++ b/tests/tools/Cargo.toml @@ -18,7 +18,7 @@ git-lock = { version = "^2.0.0", path = "../../git-lock" } nom = { version = "7", default-features = false, features = ["std"]} bstr = "0.2.15" -crc = "2.0.0" +crc = "3.0.0" once_cell = "1.8.0" tempfile = "3.2.0" fs_extra = "1.2.0" From aebc89f20d8477dbfca62fc8eca3f97b8594dd32 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 3 May 2022 08:38:49 +0800 Subject: [PATCH 4/4] Fix cargo-diet (#298) Seems like the automated version discovery isn't working anymore, so let's hard-code the tag. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93050917dbf..54b261e671a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: - name: Run cargo diet run: | curl -LSfs https://raw.githubusercontent.com/the-lean-crate/cargo-diet/master/ci/install.sh | \ - sh -s -- --git the-lean-crate/cargo-diet --target x86_64-unknown-linux-musl + sh -s -- --git the-lean-crate/cargo-diet --target x86_64-unknown-linux-musl --tag v1.2.4 # Let's not fail CI for this, it will fail locally often enough, and a crate a little bigger # than allows is no problem either if it comes to that.