Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
397 changes: 336 additions & 61 deletions Cargo.lock

Large diffs are not rendered by default.

38 changes: 3 additions & 35 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,3 @@
[package]
name = "which"
version = "9.0.0"
edition = "2021"
rust-version = "1.85"
authors = ["Harry Fei <tiziyuanfang@gmail.com>, Jacob Kiesel <jake@bitcrafters.co>"]
repository = "https://github.com/harryfei/which-rs.git"
documentation = "https://docs.rs/which/"
license = "MIT"
description = "A Rust equivalent of Unix command \"which\". Locate installed executable in cross platforms."
readme = "README.md"
categories = ["os", "filesystem"]
keywords = ["which", "which-rs", "unix", "command"]

[features]
default = ["real-sys"]
regex = ["dep:regex"]
tracing = ["dep:tracing"]
real-sys = ["dep:rustix", "dep:winsafe"]

[dependencies]
regex = { version = "1.10.2", optional = true }
tracing = { version = "0.1.40", default-features = false, optional = true }

[target.'cfg(any(unix, target_os = "wasi", target_os = "redox"))'.dependencies]
rustix = { version = "1.0.5", default-features = false, features = ["fs", "std"], optional = true }

[target.'cfg(windows)'.dependencies]
winsafe = { version = "0.0.19", features = ["kernel"], optional = true }

[dev-dependencies]
tempfile = "3.9.0"

[package.metadata.docs.rs]
all-features = true
[workspace]
members = ["which", "gen-windows-bindings"]
resolver = "3"
1 change: 1 addition & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ ignore = [
allow = [
"MIT",
"Apache-2.0",
"Unicode-3.0",
]
# The confidence threshold for detecting a license from license text.
# The higher the value, the more closely the license text must be to the
Expand Down
8 changes: 8 additions & 0 deletions gen-windows-bindings/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "gen-windows-bindings"
version = "0.1.0"
edition = "2024"
license = "MIT"
Comment thread
Xaeroxe marked this conversation as resolved.
Outdated

[dependencies]
windows-bindgen = "0.62"
4 changes: 4 additions & 0 deletions gen-windows-bindings/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# gen-windows-bindings

This binary is used for generating bindings to Windows APIs. It is not intended for distribution.
The bindings output by this are committed to the repo.
14 changes: 14 additions & 0 deletions gen-windows-bindings/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
fn main() {
windows_bindgen::bindgen([
"--out",
concat!(env!("CARGO_MANIFEST_DIR"), "/../which/src/win_ffi.rs"),
"--flat",
"--sys",
"--no-deps",
"--filter",
"Windows.Win32.Storage.FileSystem.GetBinaryTypeW",
"--filter",
"Windows.Win32.Foundation.GetLastError",
])
.unwrap();
}
1 change: 1 addition & 0 deletions CHANGELOG.md → which/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- MSRV bumped to Rust 1.85.0
- Dependency on `home_env` removed, the implementation found in rust 1.85.0 for a home directory has been fixed.
Thanks, [@madsmtm],(https://github.com/madsmtm) for this contribution to which!
- Dependency on `winsafe` swapped out for generated bindings to the two Windows functions that we actually need.

## 8.0.1

Expand Down
272 changes: 272 additions & 0 deletions which/Cargo.lock

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

35 changes: 35 additions & 0 deletions which/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[package]
name = "which"
version = "9.0.0"
edition = "2024"
rust-version = "1.85"
Comment thread
Xaeroxe marked this conversation as resolved.
Outdated
authors = ["Harry Fei <tiziyuanfang@gmail.com>, Jacob Kiesel <jake@bitcrafters.co>"]
repository = "https://github.com/harryfei/which-rs.git"
documentation = "https://docs.rs/which/"
license = "MIT"
description = "A Rust equivalent of Unix command \"which\". Locate installed executable in cross platforms."
readme = "../README.md"
categories = ["os", "filesystem"]
keywords = ["which", "which-rs", "unix", "command"]

[features]
default = ["real-sys"]
regex = ["dep:regex"]
tracing = ["dep:tracing"]
real-sys = ["dep:rustix", "dep:windows-link"]

[dependencies]
regex = { version = "1.10.2", optional = true }
tracing = { version = "0.1.40", default-features = false, optional = true }

[target.'cfg(any(unix, target_os = "wasi", target_os = "redox"))'.dependencies]
rustix = { version = "1.0.5", default-features = false, features = ["fs", "std"], optional = true }

[target.'cfg(windows)'.dependencies]
windows-link= { version = "0.2", optional = true }

[dev-dependencies]
tempfile = "3.9.0"

[package.metadata.docs.rs]
all-features = true
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading