Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable MSRV checks on windows (#298) #394

Merged
merged 4 commits into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/msrv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@ 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
with:
profile: minimal
toolchain: "1.54.0"
toolchain: "1.59.0" # dictated by `windows` crates effectively
override: true
- run: make check-msrv-on-ci
59 changes: 33 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion git-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 2 additions & 3 deletions git-repository/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version = "0.17.0"
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
edition = "2018"
include = ["src/**/*", "CHANGELOG.md"]
rust-version = "1.54" # need VecDeque::binary_search
rust-version = "1.59"

[lib]
doctest = false
Expand Down Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion git-sec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions git-sec/src/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -80,15 +80,15 @@ 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();
} else {
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);
Expand Down
2 changes: 1 addition & 1 deletion tests/tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down