* [PATCH libgpiod v2 0/9] bindings: rust: prepare v1.0.0 release
@ 2025-08-15 8:57 Bartosz Golaszewski
2025-08-15 8:57 ` [PATCH libgpiod v2 1/9] bindings: rust: make Buffer::read_edge_events() lifetimes more explicit Bartosz Golaszewski
` (9 more replies)
0 siblings, 10 replies; 15+ messages in thread
From: Bartosz Golaszewski @ 2025-08-15 8:57 UTC (permalink / raw)
To: Viresh Kumar, Linus Walleij, Erik Wierich; +Cc: linux-gpio, Bartosz Golaszewski
The libgpiod rust bindings interface has stayed quite stable over the
last months so it's time for it to stop being a v0.x release and become
officially carved in stone. Bump dependencies to the most recent versions
available, fix some issues and then bump versions of the crates ahead of
the official release.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
Changes in v2:
- drop the patch bumping the minimum required rust version
- loosen the requirements on the dependency versions: specify only the
major number for stable crates and the major.minor for unstable ones
- Link to v1: https://lore.kernel.org/r/20250812-rust-1-0-0-release-v1-0-372d698f23e8@linaro.org
---
Bartosz Golaszewski (9):
bindings: rust: make Buffer::read_edge_events() lifetimes more explicit
bindings: rust: add missing unsafe block ahead of rust version bump
bindings: rust: update bindgen dependency
bindings: rust: update errno dependency
bindings: rust: update cc dependency
bindings: rust: update system-deps dependency
bindings: rust: update thiserror dependency
bindings: rust: update intmap dependency
bindings: rust: update crate versions to v1.0.0
bindings/rust/gpiosim-sys/Cargo.toml | 8 ++++----
bindings/rust/gpiosim-sys/build.rs | 2 +-
bindings/rust/libgpiod-sys/Cargo.toml | 6 +++---
bindings/rust/libgpiod-sys/build.rs | 6 +++---
bindings/rust/libgpiod/Cargo.toml | 10 +++++-----
bindings/rust/libgpiod/src/event_buffer.rs | 2 +-
bindings/rust/libgpiod/src/lib.rs | 4 ++--
bindings/rust/libgpiod/src/line_config.rs | 2 +-
bindings/rust/libgpiod/src/line_info.rs | 2 +-
bindings/rust/libgpiod/src/line_request.rs | 4 ++--
10 files changed, 23 insertions(+), 23 deletions(-)
---
base-commit: cd32f27dd550753488bff4918aef4e230ce01512
change-id: 20250811-rust-1-0-0-release-65342607040e
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH libgpiod v2 1/9] bindings: rust: make Buffer::read_edge_events() lifetimes more explicit
2025-08-15 8:57 [PATCH libgpiod v2 0/9] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
@ 2025-08-15 8:57 ` Bartosz Golaszewski
2025-08-15 8:57 ` [PATCH libgpiod v2 2/9] bindings: rust: add missing unsafe block ahead of rust version bump Bartosz Golaszewski
` (8 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Bartosz Golaszewski @ 2025-08-15 8:57 UTC (permalink / raw)
To: Viresh Kumar, Linus Walleij, Erik Wierich; +Cc: linux-gpio, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Fix an issue pointed out by newer rustc version in the Buffer struct.
struct Events stores a reference to the buffer so tie the lifetime of the
latter to it explicitly.
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
bindings/rust/libgpiod/src/event_buffer.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bindings/rust/libgpiod/src/event_buffer.rs b/bindings/rust/libgpiod/src/event_buffer.rs
index 13fa7ba2c8870e0a325e251c073d6d73bb8c4374..059de1adabb858ba211446b27312c60429c6cc07 100644
--- a/bindings/rust/libgpiod/src/event_buffer.rs
+++ b/bindings/rust/libgpiod/src/event_buffer.rs
@@ -108,7 +108,7 @@ impl Buffer {
/// Get edge events from a line request.
///
/// This function will block if no event was queued for the line.
- pub fn read_edge_events(&mut self, request: &Request) -> Result<Events> {
+ pub fn read_edge_events<'a>(&'a mut self, request: &Request) -> Result<Events<'a>> {
for i in 0..self.events.len() {
self.events[i] = ptr::null_mut();
}
--
2.48.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH libgpiod v2 2/9] bindings: rust: add missing unsafe block ahead of rust version bump
2025-08-15 8:57 [PATCH libgpiod v2 0/9] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
2025-08-15 8:57 ` [PATCH libgpiod v2 1/9] bindings: rust: make Buffer::read_edge_events() lifetimes more explicit Bartosz Golaszewski
@ 2025-08-15 8:57 ` Bartosz Golaszewski
2025-08-15 8:57 ` [PATCH libgpiod v2 3/9] bindings: rust: update bindgen dependency Bartosz Golaszewski
` (7 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Bartosz Golaszewski @ 2025-08-15 8:57 UTC (permalink / raw)
To: Viresh Kumar, Linus Walleij, Erik Wierich; +Cc: linux-gpio, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Rust edition 2024 changed the semantics of the unsafe keyword used as
function modifier[1]. Unsafe operations inside unsafe functions must
still be wrapped in an unsafe {} block. Update the code in case we want
to bump the rust version or check it with clippy --edition 2024.
[1] https://rust-lang.github.io/rfcs/2585-unsafe-block-in-unsafe-fn.html
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
bindings/rust/libgpiod/src/line_info.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bindings/rust/libgpiod/src/line_info.rs b/bindings/rust/libgpiod/src/line_info.rs
index bd290f6e1369a3968a39178c5bcfb9f6aaf26239..8def1ab4e52962fffa6911976e64204c3d02df6f 100644
--- a/bindings/rust/libgpiod/src/line_info.rs
+++ b/bindings/rust/libgpiod/src/line_info.rs
@@ -51,7 +51,7 @@ impl InfoRef {
/// owned by the thread invoking this method. The owning object may not be
/// moved to another thread for the entire lifetime 'a.
pub(crate) unsafe fn from_raw<'a>(info: *mut gpiod::gpiod_line_info) -> &'a InfoRef {
- &*(info as *mut _)
+ unsafe { &*(info as *mut _) }
}
fn as_raw_ptr(&self) -> *mut gpiod::gpiod_line_info {
--
2.48.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH libgpiod v2 3/9] bindings: rust: update bindgen dependency
2025-08-15 8:57 [PATCH libgpiod v2 0/9] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
2025-08-15 8:57 ` [PATCH libgpiod v2 1/9] bindings: rust: make Buffer::read_edge_events() lifetimes more explicit Bartosz Golaszewski
2025-08-15 8:57 ` [PATCH libgpiod v2 2/9] bindings: rust: add missing unsafe block ahead of rust version bump Bartosz Golaszewski
@ 2025-08-15 8:57 ` Bartosz Golaszewski
2025-08-15 8:57 ` [PATCH libgpiod v2 4/9] bindings: rust: update errno dependency Bartosz Golaszewski
` (6 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Bartosz Golaszewski @ 2025-08-15 8:57 UTC (permalink / raw)
To: Viresh Kumar, Linus Walleij, Erik Wierich; +Cc: linux-gpio, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Bump bindgen dependency in both gpiosim-sys and libgpiod-sys to the most
recent version. We now need to call CargoCallbacks::new() when boxing
the ParseCallbacks trait.
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
bindings/rust/gpiosim-sys/Cargo.toml | 2 +-
bindings/rust/gpiosim-sys/build.rs | 2 +-
bindings/rust/libgpiod-sys/Cargo.toml | 2 +-
bindings/rust/libgpiod-sys/build.rs | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/bindings/rust/gpiosim-sys/Cargo.toml b/bindings/rust/gpiosim-sys/Cargo.toml
index 1f44a312563f21181b4b3ff79f1fa3b70ededc5d..7099abe41226236b9cba70a36643b921021952ee 100644
--- a/bindings/rust/gpiosim-sys/Cargo.toml
+++ b/bindings/rust/gpiosim-sys/Cargo.toml
@@ -19,5 +19,5 @@ errno = "0.2.8"
libgpiod = { path = "../libgpiod" }
[build-dependencies]
-bindgen = "0.63"
+bindgen = "0.72"
cc = "1.0.46"
diff --git a/bindings/rust/gpiosim-sys/build.rs b/bindings/rust/gpiosim-sys/build.rs
index c31fccb096841c248706089be7d8b9d232073265..81127e8ba2de336ec20ba2051fa8403b6d86eb06 100644
--- a/bindings/rust/gpiosim-sys/build.rs
+++ b/bindings/rust/gpiosim-sys/build.rs
@@ -20,7 +20,7 @@ fn generate_bindings() {
.header("../../../tests/gpiosim/gpiosim.h")
// Tell cargo to invalidate the built crate whenever any of the
// included header files changed.
- .parse_callbacks(Box::new(bindgen::CargoCallbacks))
+ .parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
// Finish the builder and generate the bindings.
.generate()
// Unwrap the Result and panic on failure.
diff --git a/bindings/rust/libgpiod-sys/Cargo.toml b/bindings/rust/libgpiod-sys/Cargo.toml
index eb600a9ee087638e1a3ea5013dec6ccbbaa29d1e..269d69bff9d62c07dcceb573ccc705cfbe2a4cdf 100644
--- a/bindings/rust/libgpiod-sys/Cargo.toml
+++ b/bindings/rust/libgpiod-sys/Cargo.toml
@@ -24,7 +24,7 @@ v2_1 = []
[dependencies]
[build-dependencies]
-bindgen = "0.63"
+bindgen = "0.72"
system-deps = "2.0"
[package.metadata.system-deps.libgpiod]
diff --git a/bindings/rust/libgpiod-sys/build.rs b/bindings/rust/libgpiod-sys/build.rs
index 9e6a93c04324b419f157fcb20fe2bedf98b6fd91..ab5b11308c92579a5b16883d47ec5a616c2db78c 100644
--- a/bindings/rust/libgpiod-sys/build.rs
+++ b/bindings/rust/libgpiod-sys/build.rs
@@ -24,7 +24,7 @@ fn main() {
.header("wrapper.h")
// Tell cargo to invalidate the built crate whenever any of the
// included header files changed.
- .parse_callbacks(Box::new(bindgen::CargoCallbacks));
+ .parse_callbacks(Box::new(bindgen::CargoCallbacks::new()));
// Inform bindgen about the include paths identified by system_deps.
for (_name, lib) in libs {
--
2.48.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH libgpiod v2 4/9] bindings: rust: update errno dependency
2025-08-15 8:57 [PATCH libgpiod v2 0/9] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
` (2 preceding siblings ...)
2025-08-15 8:57 ` [PATCH libgpiod v2 3/9] bindings: rust: update bindgen dependency Bartosz Golaszewski
@ 2025-08-15 8:57 ` Bartosz Golaszewski
2025-08-15 8:57 ` [PATCH libgpiod v2 5/9] bindings: rust: update cc dependency Bartosz Golaszewski
` (5 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Bartosz Golaszewski @ 2025-08-15 8:57 UTC (permalink / raw)
To: Viresh Kumar, Linus Walleij, Erik Wierich; +Cc: linux-gpio, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Bump the errno dependency for gpiosim-sys and libgpiod crates to the
most recent version which is a minor update from the one we have now.
However: let cargo select it automatically by not specifying the bugfix
version. We need to be stricter than just selecting the major version
alone because crates with major versions starting with 0 can introduce
breaking changes in minor releases. No code changes required.
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
bindings/rust/gpiosim-sys/Cargo.toml | 2 +-
bindings/rust/libgpiod/Cargo.toml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/bindings/rust/gpiosim-sys/Cargo.toml b/bindings/rust/gpiosim-sys/Cargo.toml
index 7099abe41226236b9cba70a36643b921021952ee..c5e044acdfe94f8ab32d288c90db1233dd223bf9 100644
--- a/bindings/rust/gpiosim-sys/Cargo.toml
+++ b/bindings/rust/gpiosim-sys/Cargo.toml
@@ -15,7 +15,7 @@ license = "Apache-2.0 OR BSD-3-Clause"
edition = "2021"
[dependencies]
-errno = "0.2.8"
+errno = "0.3"
libgpiod = { path = "../libgpiod" }
[build-dependencies]
diff --git a/bindings/rust/libgpiod/Cargo.toml b/bindings/rust/libgpiod/Cargo.toml
index 23c34799715339be02f769a6b4b7de8ae5c1639f..81478209f6746ff0e8d9d311614e8fb218ed6a3e 100644
--- a/bindings/rust/libgpiod/Cargo.toml
+++ b/bindings/rust/libgpiod/Cargo.toml
@@ -23,7 +23,7 @@ v2_1 = ["libgpiod-sys/v2_1"]
vnext = ["v2_1"]
[dependencies]
-errno = "0.2.8"
+errno = "0.3"
intmap = "2.0.0"
libc = "0.2.39"
libgpiod-sys = { version = "0.1", path = "../libgpiod-sys" }
--
2.48.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH libgpiod v2 5/9] bindings: rust: update cc dependency
2025-08-15 8:57 [PATCH libgpiod v2 0/9] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
` (3 preceding siblings ...)
2025-08-15 8:57 ` [PATCH libgpiod v2 4/9] bindings: rust: update errno dependency Bartosz Golaszewski
@ 2025-08-15 8:57 ` Bartosz Golaszewski
2025-08-15 8:57 ` [PATCH libgpiod v2 6/9] bindings: rust: update system-deps dependency Bartosz Golaszewski
` (4 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Bartosz Golaszewski @ 2025-08-15 8:57 UTC (permalink / raw)
To: Viresh Kumar, Linus Walleij, Erik Wierich; +Cc: linux-gpio, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Bump the cc dependency for gpiosim-sys to the most recent version which
happens to be a minor upgrade from the one we have currently. However:
let cargo select it automatically by no longer specifying the minor
number. No code changes required.
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
bindings/rust/gpiosim-sys/Cargo.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bindings/rust/gpiosim-sys/Cargo.toml b/bindings/rust/gpiosim-sys/Cargo.toml
index c5e044acdfe94f8ab32d288c90db1233dd223bf9..86324b3e192d8ac4ecb45cc900c75537d2df794e 100644
--- a/bindings/rust/gpiosim-sys/Cargo.toml
+++ b/bindings/rust/gpiosim-sys/Cargo.toml
@@ -20,4 +20,4 @@ libgpiod = { path = "../libgpiod" }
[build-dependencies]
bindgen = "0.72"
-cc = "1.0.46"
+cc = "1"
--
2.48.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH libgpiod v2 6/9] bindings: rust: update system-deps dependency
2025-08-15 8:57 [PATCH libgpiod v2 0/9] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
` (4 preceding siblings ...)
2025-08-15 8:57 ` [PATCH libgpiod v2 5/9] bindings: rust: update cc dependency Bartosz Golaszewski
@ 2025-08-15 8:57 ` Bartosz Golaszewski
2025-08-15 8:57 ` [PATCH libgpiod v2 7/9] bindings: rust: update thiserror dependency Bartosz Golaszewski
` (3 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Bartosz Golaszewski @ 2025-08-15 8:57 UTC (permalink / raw)
To: Viresh Kumar, Linus Walleij, Erik Wierich; +Cc: linux-gpio, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Bump the system-deps dependency for libgpiod-sys to the most recent major
version. The way we iterate over libs has changed, we now need to convert
it explicitly to an iterable. No longer require a specific minor
version.
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
bindings/rust/libgpiod-sys/Cargo.toml | 2 +-
bindings/rust/libgpiod-sys/build.rs | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/bindings/rust/libgpiod-sys/Cargo.toml b/bindings/rust/libgpiod-sys/Cargo.toml
index 269d69bff9d62c07dcceb573ccc705cfbe2a4cdf..dc08f83ce3ec77165d240516aa2a224075685f42 100644
--- a/bindings/rust/libgpiod-sys/Cargo.toml
+++ b/bindings/rust/libgpiod-sys/Cargo.toml
@@ -25,7 +25,7 @@ v2_1 = []
[build-dependencies]
bindgen = "0.72"
-system-deps = "2.0"
+system-deps = "7"
[package.metadata.system-deps.libgpiod]
name = "libgpiod"
diff --git a/bindings/rust/libgpiod-sys/build.rs b/bindings/rust/libgpiod-sys/build.rs
index ab5b11308c92579a5b16883d47ec5a616c2db78c..14fd0b011bd6077b0c9be1905b8faaa1a5a39e0d 100644
--- a/bindings/rust/libgpiod-sys/build.rs
+++ b/bindings/rust/libgpiod-sys/build.rs
@@ -27,8 +27,8 @@ fn main() {
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()));
// Inform bindgen about the include paths identified by system_deps.
- for (_name, lib) in libs {
- for include_path in lib.include_paths {
+ for (_name, lib) in libs.iter() {
+ for include_path in &lib.include_paths {
builder = builder.clang_arg("-I").clang_arg(
include_path
.to_str()
--
2.48.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH libgpiod v2 7/9] bindings: rust: update thiserror dependency
2025-08-15 8:57 [PATCH libgpiod v2 0/9] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
` (5 preceding siblings ...)
2025-08-15 8:57 ` [PATCH libgpiod v2 6/9] bindings: rust: update system-deps dependency Bartosz Golaszewski
@ 2025-08-15 8:57 ` Bartosz Golaszewski
2025-08-15 8:57 ` [PATCH libgpiod v2 8/9] bindings: rust: update intmap dependency Bartosz Golaszewski
` (2 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Bartosz Golaszewski @ 2025-08-15 8:57 UTC (permalink / raw)
To: Viresh Kumar, Linus Walleij, Erik Wierich; +Cc: linux-gpio, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Bump the thiserror dependency for libgpiod to the most recent major
version. No code changes required. No longer require a specific minor
version.
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
bindings/rust/libgpiod/Cargo.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bindings/rust/libgpiod/Cargo.toml b/bindings/rust/libgpiod/Cargo.toml
index 81478209f6746ff0e8d9d311614e8fb218ed6a3e..e26e893b0250a79077a46ced38012367c78fa5c5 100644
--- a/bindings/rust/libgpiod/Cargo.toml
+++ b/bindings/rust/libgpiod/Cargo.toml
@@ -27,7 +27,7 @@ errno = "0.3"
intmap = "2.0.0"
libc = "0.2.39"
libgpiod-sys = { version = "0.1", path = "../libgpiod-sys" }
-thiserror = "1.0"
+thiserror = "2"
[dev-dependencies]
gpiosim-sys = { path = "../gpiosim-sys" }
--
2.48.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH libgpiod v2 8/9] bindings: rust: update intmap dependency
2025-08-15 8:57 [PATCH libgpiod v2 0/9] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
` (6 preceding siblings ...)
2025-08-15 8:57 ` [PATCH libgpiod v2 7/9] bindings: rust: update thiserror dependency Bartosz Golaszewski
@ 2025-08-15 8:57 ` Bartosz Golaszewski
2025-08-15 8:57 ` [PATCH libgpiod v2 9/9] bindings: rust: update crate versions to v1.0.0 Bartosz Golaszewski
2025-08-18 7:25 ` [PATCH libgpiod v2 0/9] bindings: rust: prepare v1.0.0 release Erik Schilling
9 siblings, 0 replies; 15+ messages in thread
From: Bartosz Golaszewski @ 2025-08-15 8:57 UTC (permalink / raw)
To: Viresh Kumar, Linus Walleij, Erik Wierich; +Cc: linux-gpio, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Bump the intmap dependency for libgpiod to the most recent major version.
The IntMap type now takes two explicit type arguments for the key and
value so adjust the code accordingly. No longer require a specific minor
version.
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
bindings/rust/libgpiod/Cargo.toml | 2 +-
bindings/rust/libgpiod/src/lib.rs | 4 ++--
bindings/rust/libgpiod/src/line_config.rs | 2 +-
bindings/rust/libgpiod/src/line_request.rs | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/bindings/rust/libgpiod/Cargo.toml b/bindings/rust/libgpiod/Cargo.toml
index e26e893b0250a79077a46ced38012367c78fa5c5..4902d3707bc84dfcfafa3e70493303dd1027dd26 100644
--- a/bindings/rust/libgpiod/Cargo.toml
+++ b/bindings/rust/libgpiod/Cargo.toml
@@ -24,7 +24,7 @@ vnext = ["v2_1"]
[dependencies]
errno = "0.3"
-intmap = "2.0.0"
+intmap = "3"
libc = "0.2.39"
libgpiod-sys = { version = "0.1", path = "../libgpiod-sys" }
thiserror = "2"
diff --git a/bindings/rust/libgpiod/src/lib.rs b/bindings/rust/libgpiod/src/lib.rs
index f4e511d535b70fbc01f91fa059921545b405656a..76a2c1b76f3cf365866797742011b780ee5795d8 100644
--- a/bindings/rust/libgpiod/src/lib.rs
+++ b/bindings/rust/libgpiod/src/lib.rs
@@ -178,10 +178,10 @@ pub mod line {
}
/// Maps offset to Value.
- pub type ValueMap = IntMap<Value>;
+ pub type ValueMap = IntMap<Offset, Value>;
/// Maps offsets to Settings
- pub type SettingsMap = IntMap<Settings>;
+ pub type SettingsMap = IntMap<Offset, Settings>;
impl Value {
pub fn new(val: gpiod::gpiod_line_value) -> Result<Self> {
diff --git a/bindings/rust/libgpiod/src/line_config.rs b/bindings/rust/libgpiod/src/line_config.rs
index 34b6c227b0c8e156ea1bac396cc19ea4f182012c..5850b9da3cba0d75f475246592796c2c52570e8e 100644
--- a/bindings/rust/libgpiod/src/line_config.rs
+++ b/bindings/rust/libgpiod/src/line_config.rs
@@ -139,7 +139,7 @@ impl Config {
// We no longer use the pointer for any other purpose.
let settings = unsafe { Settings::from_raw(settings) };
- map.insert(*offset as u64, settings);
+ map.insert(*offset as Offset, settings);
}
Ok(map)
diff --git a/bindings/rust/libgpiod/src/line_request.rs b/bindings/rust/libgpiod/src/line_request.rs
index 49fe56542ab876bd2360b5e846e18ced0de51fbd..48d8d1a3a6fb5110ef295971cf44bcc70ff68c58 100644
--- a/bindings/rust/libgpiod/src/line_request.rs
+++ b/bindings/rust/libgpiod/src/line_request.rs
@@ -110,7 +110,7 @@ impl Request {
let mut map = ValueMap::new();
for (i, val) in values.iter().enumerate() {
- map.insert(offsets[i].into(), Value::new(*val)?);
+ map.insert(offsets[i], Value::new(*val)?);
}
Ok(map)
@@ -144,7 +144,7 @@ impl Request {
let mut values = Vec::new();
for (offset, value) in map {
- offsets.push(offset as u32);
+ offsets.push(offset);
values.push(value.value());
}
--
2.48.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH libgpiod v2 9/9] bindings: rust: update crate versions to v1.0.0
2025-08-15 8:57 [PATCH libgpiod v2 0/9] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
` (7 preceding siblings ...)
2025-08-15 8:57 ` [PATCH libgpiod v2 8/9] bindings: rust: update intmap dependency Bartosz Golaszewski
@ 2025-08-15 8:57 ` Bartosz Golaszewski
2025-08-18 7:25 ` [PATCH libgpiod v2 0/9] bindings: rust: prepare v1.0.0 release Erik Schilling
9 siblings, 0 replies; 15+ messages in thread
From: Bartosz Golaszewski @ 2025-08-15 8:57 UTC (permalink / raw)
To: Viresh Kumar, Linus Walleij, Erik Wierich; +Cc: linux-gpio, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Ahead of the first stable release, update versions for all libgpiod
crates to v1.0.0.
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
bindings/rust/gpiosim-sys/Cargo.toml | 2 +-
bindings/rust/libgpiod-sys/Cargo.toml | 2 +-
bindings/rust/libgpiod/Cargo.toml | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/bindings/rust/gpiosim-sys/Cargo.toml b/bindings/rust/gpiosim-sys/Cargo.toml
index 86324b3e192d8ac4ecb45cc900c75537d2df794e..6611142f2ac9e4bd59b725baf75ac4be7d78e4f0 100644
--- a/bindings/rust/gpiosim-sys/Cargo.toml
+++ b/bindings/rust/gpiosim-sys/Cargo.toml
@@ -4,7 +4,7 @@
[package]
name = "gpiosim-sys"
-version = "0.1.0"
+version = "1.0.0"
authors = ["Viresh Kumar <viresh.kumar@linaro.org>"]
description = "gpiosim header bindings"
repository = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git"
diff --git a/bindings/rust/libgpiod-sys/Cargo.toml b/bindings/rust/libgpiod-sys/Cargo.toml
index dc08f83ce3ec77165d240516aa2a224075685f42..2ad53ce98e4bdced3451c9ddec0f25c947b9dfcf 100644
--- a/bindings/rust/libgpiod-sys/Cargo.toml
+++ b/bindings/rust/libgpiod-sys/Cargo.toml
@@ -4,7 +4,7 @@
[package]
name = "libgpiod-sys"
-version = "0.1.1"
+version = "1.0.0"
authors = ["Viresh Kumar <viresh.kumar@linaro.org>"]
description = "libgpiod public header bindings"
repository = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git"
diff --git a/bindings/rust/libgpiod/Cargo.toml b/bindings/rust/libgpiod/Cargo.toml
index 4902d3707bc84dfcfafa3e70493303dd1027dd26..02f7396c5d37abc502ed4dc63fd8d33078e91c5e 100644
--- a/bindings/rust/libgpiod/Cargo.toml
+++ b/bindings/rust/libgpiod/Cargo.toml
@@ -4,7 +4,7 @@
[package]
name = "libgpiod"
-version = "0.2.2"
+version = "1.0.0"
authors = ["Viresh Kumar <viresh.kumar@linaro.org>"]
description = "libgpiod wrappers"
repository = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git"
@@ -26,7 +26,7 @@ vnext = ["v2_1"]
errno = "0.3"
intmap = "3"
libc = "0.2.39"
-libgpiod-sys = { version = "0.1", path = "../libgpiod-sys" }
+libgpiod-sys = { version = "1", path = "../libgpiod-sys" }
thiserror = "2"
[dev-dependencies]
--
2.48.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH libgpiod v2 0/9] bindings: rust: prepare v1.0.0 release
2025-08-15 8:57 [PATCH libgpiod v2 0/9] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
` (8 preceding siblings ...)
2025-08-15 8:57 ` [PATCH libgpiod v2 9/9] bindings: rust: update crate versions to v1.0.0 Bartosz Golaszewski
@ 2025-08-18 7:25 ` Erik Schilling
2025-08-26 18:07 ` Bartosz Golaszewski
9 siblings, 1 reply; 15+ messages in thread
From: Erik Schilling @ 2025-08-18 7:25 UTC (permalink / raw)
To: Bartosz Golaszewski, Viresh Kumar, Linus Walleij
Cc: linux-gpio, Bartosz Golaszewski
On Fri Aug 15, 2025 at 10:57 AM CEST, Bartosz Golaszewski wrote:
> The libgpiod rust bindings interface has stayed quite stable over the
> last months so it's time for it to stop being a v0.x release and become
> officially carved in stone. Bump dependencies to the most recent versions
> available, fix some issues and then bump versions of the crates ahead of
> the official release.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
> Changes in v2:
> - drop the patch bumping the minimum required rust version
> - loosen the requirements on the dependency versions: specify only the
> major number for stable crates and the major.minor for unstable ones
> - Link to v1: https://lore.kernel.org/r/20250812-rust-1-0-0-release-v1-0-372d698f23e8@linaro.org
>
> ---
> Bartosz Golaszewski (9):
> bindings: rust: make Buffer::read_edge_events() lifetimes more explicit
> bindings: rust: add missing unsafe block ahead of rust version bump
> bindings: rust: update bindgen dependency
> bindings: rust: update errno dependency
> bindings: rust: update cc dependency
> bindings: rust: update system-deps dependency
> bindings: rust: update thiserror dependency
> bindings: rust: update intmap dependency
> bindings: rust: update crate versions to v1.0.0
>
> bindings/rust/gpiosim-sys/Cargo.toml | 8 ++++----
> bindings/rust/gpiosim-sys/build.rs | 2 +-
> bindings/rust/libgpiod-sys/Cargo.toml | 6 +++---
> bindings/rust/libgpiod-sys/build.rs | 6 +++---
> bindings/rust/libgpiod/Cargo.toml | 10 +++++-----
> bindings/rust/libgpiod/src/event_buffer.rs | 2 +-
> bindings/rust/libgpiod/src/lib.rs | 4 ++--
> bindings/rust/libgpiod/src/line_config.rs | 2 +-
> bindings/rust/libgpiod/src/line_info.rs | 2 +-
> bindings/rust/libgpiod/src/line_request.rs | 4 ++--
> 10 files changed, 23 insertions(+), 23 deletions(-)
> ---
> base-commit: cd32f27dd550753488bff4918aef4e230ce01512
> change-id: 20250811-rust-1-0-0-release-65342607040e
>
> Best regards,
> --
> Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Trying to build with the 1.60 that we claim as lower floor gives me:
> cargo +1.60 build
[...]
error: package `bindgen v0.72.0` cannot be built because it requires rustc 1.70.0 or newer, while the currently active rustc version is 1.60.0
With 1.70 I get:
~/projects/libgpiod/bindings/rust (master)> cargo +1.70 build
[...]
error: package `system-deps v7.0.5` cannot be built because it requires rustc 1.78.0 or newer, while the currently active rustc version is 1.70.0
1.78 builds fine (when having cfg-expr pinned to a pre-2024-edition
version).
So we will need to bump the MSRV to at least 1.78. The critical path
seems to be cfg-expr -> system-deps where cfg-expr seems to be extremely
aggressive with updating it's MSRV...
1.78 with a release in May 2024 looks reasonable to me.
Otherwise this looks good to me!
- Erik
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH libgpiod v2 0/9] bindings: rust: prepare v1.0.0 release
2025-08-18 7:25 ` [PATCH libgpiod v2 0/9] bindings: rust: prepare v1.0.0 release Erik Schilling
@ 2025-08-26 18:07 ` Bartosz Golaszewski
2025-08-27 6:36 ` Erik Schilling
0 siblings, 1 reply; 15+ messages in thread
From: Bartosz Golaszewski @ 2025-08-26 18:07 UTC (permalink / raw)
To: Erik Schilling
Cc: Viresh Kumar, Linus Walleij, linux-gpio, Bartosz Golaszewski
On Mon, Aug 18, 2025 at 9:26 AM Erik Schilling <erik@riscstar.com> wrote:
>
> On Fri Aug 15, 2025 at 10:57 AM CEST, Bartosz Golaszewski wrote:
> > The libgpiod rust bindings interface has stayed quite stable over the
> > last months so it's time for it to stop being a v0.x release and become
> > officially carved in stone. Bump dependencies to the most recent versions
> > available, fix some issues and then bump versions of the crates ahead of
> > the official release.
> >
> > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > ---
> > Changes in v2:
> > - drop the patch bumping the minimum required rust version
> > - loosen the requirements on the dependency versions: specify only the
> > major number for stable crates and the major.minor for unstable ones
> > - Link to v1: https://lore.kernel.org/r/20250812-rust-1-0-0-release-v1-0-372d698f23e8@linaro.org
> >
> > ---
> > Bartosz Golaszewski (9):
> > bindings: rust: make Buffer::read_edge_events() lifetimes more explicit
> > bindings: rust: add missing unsafe block ahead of rust version bump
> > bindings: rust: update bindgen dependency
> > bindings: rust: update errno dependency
> > bindings: rust: update cc dependency
> > bindings: rust: update system-deps dependency
> > bindings: rust: update thiserror dependency
> > bindings: rust: update intmap dependency
> > bindings: rust: update crate versions to v1.0.0
> >
> > bindings/rust/gpiosim-sys/Cargo.toml | 8 ++++----
> > bindings/rust/gpiosim-sys/build.rs | 2 +-
> > bindings/rust/libgpiod-sys/Cargo.toml | 6 +++---
> > bindings/rust/libgpiod-sys/build.rs | 6 +++---
> > bindings/rust/libgpiod/Cargo.toml | 10 +++++-----
> > bindings/rust/libgpiod/src/event_buffer.rs | 2 +-
> > bindings/rust/libgpiod/src/lib.rs | 4 ++--
> > bindings/rust/libgpiod/src/line_config.rs | 2 +-
> > bindings/rust/libgpiod/src/line_info.rs | 2 +-
> > bindings/rust/libgpiod/src/line_request.rs | 4 ++--
> > 10 files changed, 23 insertions(+), 23 deletions(-)
> > ---
> > base-commit: cd32f27dd550753488bff4918aef4e230ce01512
> > change-id: 20250811-rust-1-0-0-release-65342607040e
> >
> > Best regards,
> > --
> > Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> Trying to build with the 1.60 that we claim as lower floor gives me:
>
> > cargo +1.60 build
> [...]
> error: package `bindgen v0.72.0` cannot be built because it requires rustc 1.70.0 or newer, while the currently active rustc version is 1.60.0
>
> With 1.70 I get:
>
> ~/projects/libgpiod/bindings/rust (master)> cargo +1.70 build
> [...]
> error: package `system-deps v7.0.5` cannot be built because it requires rustc 1.78.0 or newer, while the currently active rustc version is 1.70.0
>
>
> 1.78 builds fine (when having cfg-expr pinned to a pre-2024-edition
> version).
>
> So we will need to bump the MSRV to at least 1.78. The critical path
> seems to be cfg-expr -> system-deps where cfg-expr seems to be extremely
> aggressive with updating it's MSRV...
>
> 1.78 with a release in May 2024 looks reasonable to me.
>
> Otherwise this looks good to me!
>
> - Erik
>
Am I getting this right, should I bump min rust version to 1.78 but
leave the edition at 2021? And what does "pinned to a pre
2024-edition" even mean?
Bart
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH libgpiod v2 0/9] bindings: rust: prepare v1.0.0 release
2025-08-26 18:07 ` Bartosz Golaszewski
@ 2025-08-27 6:36 ` Erik Schilling
2025-08-27 13:57 ` Bartosz Golaszewski
0 siblings, 1 reply; 15+ messages in thread
From: Erik Schilling @ 2025-08-27 6:36 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Viresh Kumar, Linus Walleij, linux-gpio, Bartosz Golaszewski
On Tue Aug 26, 2025 at 8:07 PM CEST, Bartosz Golaszewski wrote:
> On Mon, Aug 18, 2025 at 9:26 AM Erik Schilling <erik@riscstar.com> wrote:
>>
>> On Fri Aug 15, 2025 at 10:57 AM CEST, Bartosz Golaszewski wrote:
>> > The libgpiod rust bindings interface has stayed quite stable over the
>> > last months so it's time for it to stop being a v0.x release and become
>> > officially carved in stone. Bump dependencies to the most recent versions
>> > available, fix some issues and then bump versions of the crates ahead of
>> > the official release.
>> >
>> > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>> > ---
>> > Changes in v2:
>> > - drop the patch bumping the minimum required rust version
>> > - loosen the requirements on the dependency versions: specify only the
>> > major number for stable crates and the major.minor for unstable ones
>> > - Link to v1: https://lore.kernel.org/r/20250812-rust-1-0-0-release-v1-0-372d698f23e8@linaro.org
>> >
>> > ---
>> > Bartosz Golaszewski (9):
>> > bindings: rust: make Buffer::read_edge_events() lifetimes more explicit
>> > bindings: rust: add missing unsafe block ahead of rust version bump
>> > bindings: rust: update bindgen dependency
>> > bindings: rust: update errno dependency
>> > bindings: rust: update cc dependency
>> > bindings: rust: update system-deps dependency
>> > bindings: rust: update thiserror dependency
>> > bindings: rust: update intmap dependency
>> > bindings: rust: update crate versions to v1.0.0
>> >
>> > bindings/rust/gpiosim-sys/Cargo.toml | 8 ++++----
>> > bindings/rust/gpiosim-sys/build.rs | 2 +-
>> > bindings/rust/libgpiod-sys/Cargo.toml | 6 +++---
>> > bindings/rust/libgpiod-sys/build.rs | 6 +++---
>> > bindings/rust/libgpiod/Cargo.toml | 10 +++++-----
>> > bindings/rust/libgpiod/src/event_buffer.rs | 2 +-
>> > bindings/rust/libgpiod/src/lib.rs | 4 ++--
>> > bindings/rust/libgpiod/src/line_config.rs | 2 +-
>> > bindings/rust/libgpiod/src/line_info.rs | 2 +-
>> > bindings/rust/libgpiod/src/line_request.rs | 4 ++--
>> > 10 files changed, 23 insertions(+), 23 deletions(-)
>> > ---
>> > base-commit: cd32f27dd550753488bff4918aef4e230ce01512
>> > change-id: 20250811-rust-1-0-0-release-65342607040e
>> >
>> > Best regards,
>> > --
>> > Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>>
>> Trying to build with the 1.60 that we claim as lower floor gives me:
>>
>> > cargo +1.60 build
>> [...]
>> error: package `bindgen v0.72.0` cannot be built because it requires rustc 1.70.0 or newer, while the currently active rustc version is 1.60.0
>>
>> With 1.70 I get:
>>
>> ~/projects/libgpiod/bindings/rust (master)> cargo +1.70 build
>> [...]
>> error: package `system-deps v7.0.5` cannot be built because it requires rustc 1.78.0 or newer, while the currently active rustc version is 1.70.0
>>
>>
>> 1.78 builds fine (when having cfg-expr pinned to a pre-2024-edition
>> version).
>>
>> So we will need to bump the MSRV to at least 1.78. The critical path
>> seems to be cfg-expr -> system-deps where cfg-expr seems to be extremely
>> aggressive with updating it's MSRV...
>>
>> 1.78 with a release in May 2024 looks reasonable to me.
>>
>> Otherwise this looks good to me!
>>
>> - Erik
>>
>
> Am I getting this right, should I bump min rust version to 1.78 but
> leave the edition at 2021?
Yes. The 2024 edition came with 1.85. So neither our libs nor we
ourselves require that yet. But we _do_ require 1.78 with these changes
now.
> And what does "pinned to a pre 2024-edition" even mean?
The latest cfg-expr version sets edition = "2024". It looks like that
fails the Cargo.toml parse and the rust-version in the .toml does not
work to restrict the automatic update. To fix that I had to set the
version in the Cargo.lock file manually:
cargo +1.78 update -p cfg-expr --precise 0.18.0
This was the last version before the bump to 2024 edition and 1.85 MSRV.
We - as a library - do not have a .lock file. So cargo will try to use
the latest and greatest. But a consumer of libgpiod will have such a
.lock file and is still able to build libgpiod with these changes under
1.78.
- Erik
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH libgpiod v2 0/9] bindings: rust: prepare v1.0.0 release
2025-08-27 6:36 ` Erik Schilling
@ 2025-08-27 13:57 ` Bartosz Golaszewski
2025-08-28 8:11 ` Erik Schilling
0 siblings, 1 reply; 15+ messages in thread
From: Bartosz Golaszewski @ 2025-08-27 13:57 UTC (permalink / raw)
To: Erik Schilling
Cc: Viresh Kumar, Linus Walleij, linux-gpio, Bartosz Golaszewski
On Wed, Aug 27, 2025 at 8:36 AM Erik Schilling <erik@riscstar.com> wrote:
>
> On Tue Aug 26, 2025 at 8:07 PM CEST, Bartosz Golaszewski wrote:
> > On Mon, Aug 18, 2025 at 9:26 AM Erik Schilling <erik@riscstar.com> wrote:
> >>
> >> On Fri Aug 15, 2025 at 10:57 AM CEST, Bartosz Golaszewski wrote:
> >> > The libgpiod rust bindings interface has stayed quite stable over the
> >> > last months so it's time for it to stop being a v0.x release and become
> >> > officially carved in stone. Bump dependencies to the most recent versions
> >> > available, fix some issues and then bump versions of the crates ahead of
> >> > the official release.
> >> >
> >> > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >> > ---
> >> > Changes in v2:
> >> > - drop the patch bumping the minimum required rust version
> >> > - loosen the requirements on the dependency versions: specify only the
> >> > major number for stable crates and the major.minor for unstable ones
> >> > - Link to v1: https://lore.kernel.org/r/20250812-rust-1-0-0-release-v1-0-372d698f23e8@linaro.org
> >> >
> >> > ---
> >> > Bartosz Golaszewski (9):
> >> > bindings: rust: make Buffer::read_edge_events() lifetimes more explicit
> >> > bindings: rust: add missing unsafe block ahead of rust version bump
> >> > bindings: rust: update bindgen dependency
> >> > bindings: rust: update errno dependency
> >> > bindings: rust: update cc dependency
> >> > bindings: rust: update system-deps dependency
> >> > bindings: rust: update thiserror dependency
> >> > bindings: rust: update intmap dependency
> >> > bindings: rust: update crate versions to v1.0.0
> >> >
> >> > bindings/rust/gpiosim-sys/Cargo.toml | 8 ++++----
> >> > bindings/rust/gpiosim-sys/build.rs | 2 +-
> >> > bindings/rust/libgpiod-sys/Cargo.toml | 6 +++---
> >> > bindings/rust/libgpiod-sys/build.rs | 6 +++---
> >> > bindings/rust/libgpiod/Cargo.toml | 10 +++++-----
> >> > bindings/rust/libgpiod/src/event_buffer.rs | 2 +-
> >> > bindings/rust/libgpiod/src/lib.rs | 4 ++--
> >> > bindings/rust/libgpiod/src/line_config.rs | 2 +-
> >> > bindings/rust/libgpiod/src/line_info.rs | 2 +-
> >> > bindings/rust/libgpiod/src/line_request.rs | 4 ++--
> >> > 10 files changed, 23 insertions(+), 23 deletions(-)
> >> > ---
> >> > base-commit: cd32f27dd550753488bff4918aef4e230ce01512
> >> > change-id: 20250811-rust-1-0-0-release-65342607040e
> >> >
> >> > Best regards,
> >> > --
> >> > Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >>
> >> Trying to build with the 1.60 that we claim as lower floor gives me:
> >>
> >> > cargo +1.60 build
> >> [...]
> >> error: package `bindgen v0.72.0` cannot be built because it requires rustc 1.70.0 or newer, while the currently active rustc version is 1.60.0
> >>
> >> With 1.70 I get:
> >>
> >> ~/projects/libgpiod/bindings/rust (master)> cargo +1.70 build
> >> [...]
> >> error: package `system-deps v7.0.5` cannot be built because it requires rustc 1.78.0 or newer, while the currently active rustc version is 1.70.0
> >>
> >>
> >> 1.78 builds fine (when having cfg-expr pinned to a pre-2024-edition
> >> version).
> >>
> >> So we will need to bump the MSRV to at least 1.78. The critical path
> >> seems to be cfg-expr -> system-deps where cfg-expr seems to be extremely
> >> aggressive with updating it's MSRV...
> >>
> >> 1.78 with a release in May 2024 looks reasonable to me.
> >>
> >> Otherwise this looks good to me!
> >>
> >> - Erik
> >>
> >
> > Am I getting this right, should I bump min rust version to 1.78 but
> > leave the edition at 2021?
>
> Yes. The 2024 edition came with 1.85. So neither our libs nor we
> ourselves require that yet. But we _do_ require 1.78 with these changes
> now.
>
> > And what does "pinned to a pre 2024-edition" even mean?
>
> The latest cfg-expr version sets edition = "2024". It looks like that
> fails the Cargo.toml parse and the rust-version in the .toml does not
> work to restrict the automatic update. To fix that I had to set the
> version in the Cargo.lock file manually:
>
> cargo +1.78 update -p cfg-expr --precise 0.18.0
>
> This was the last version before the bump to 2024 edition and 1.85 MSRV.
>
> We - as a library - do not have a .lock file. So cargo will try to use
> the latest and greatest. But a consumer of libgpiod will have such a
> .lock file and is still able to build libgpiod with these changes under
> 1.78.
>
Will the user-experience be: build fails -> user needs to manually
downgrade cfg-expr in Cargo.lock -> build now succeeds? That doesn't
sound very convenient and I'm afraid people will just bounce right
off. Am I missing something?
Bart
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH libgpiod v2 0/9] bindings: rust: prepare v1.0.0 release
2025-08-27 13:57 ` Bartosz Golaszewski
@ 2025-08-28 8:11 ` Erik Schilling
0 siblings, 0 replies; 15+ messages in thread
From: Erik Schilling @ 2025-08-28 8:11 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Viresh Kumar, Linus Walleij, linux-gpio, Bartosz Golaszewski
On Wed Aug 27, 2025 at 3:57 PM CEST, Bartosz Golaszewski wrote:
> On Wed, Aug 27, 2025 at 8:36 AM Erik Schilling <erik@riscstar.com> wrote:
>>
>> On Tue Aug 26, 2025 at 8:07 PM CEST, Bartosz Golaszewski wrote:
>> > On Mon, Aug 18, 2025 at 9:26 AM Erik Schilling <erik@riscstar.com> wrote:
>> >>
>> >> On Fri Aug 15, 2025 at 10:57 AM CEST, Bartosz Golaszewski wrote:
>> >> > The libgpiod rust bindings interface has stayed quite stable over the
>> >> > last months so it's time for it to stop being a v0.x release and become
>> >> > officially carved in stone. Bump dependencies to the most recent versions
>> >> > available, fix some issues and then bump versions of the crates ahead of
>> >> > the official release.
>> >> >
>> >> > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>> >> > ---
>> >> > Changes in v2:
>> >> > - drop the patch bumping the minimum required rust version
>> >> > - loosen the requirements on the dependency versions: specify only the
>> >> > major number for stable crates and the major.minor for unstable ones
>> >> > - Link to v1: https://lore.kernel.org/r/20250812-rust-1-0-0-release-v1-0-372d698f23e8@linaro.org
>> >> >
>> >> > ---
>> >> > Bartosz Golaszewski (9):
>> >> > bindings: rust: make Buffer::read_edge_events() lifetimes more explicit
>> >> > bindings: rust: add missing unsafe block ahead of rust version bump
>> >> > bindings: rust: update bindgen dependency
>> >> > bindings: rust: update errno dependency
>> >> > bindings: rust: update cc dependency
>> >> > bindings: rust: update system-deps dependency
>> >> > bindings: rust: update thiserror dependency
>> >> > bindings: rust: update intmap dependency
>> >> > bindings: rust: update crate versions to v1.0.0
>> >> >
>> >> > bindings/rust/gpiosim-sys/Cargo.toml | 8 ++++----
>> >> > bindings/rust/gpiosim-sys/build.rs | 2 +-
>> >> > bindings/rust/libgpiod-sys/Cargo.toml | 6 +++---
>> >> > bindings/rust/libgpiod-sys/build.rs | 6 +++---
>> >> > bindings/rust/libgpiod/Cargo.toml | 10 +++++-----
>> >> > bindings/rust/libgpiod/src/event_buffer.rs | 2 +-
>> >> > bindings/rust/libgpiod/src/lib.rs | 4 ++--
>> >> > bindings/rust/libgpiod/src/line_config.rs | 2 +-
>> >> > bindings/rust/libgpiod/src/line_info.rs | 2 +-
>> >> > bindings/rust/libgpiod/src/line_request.rs | 4 ++--
>> >> > 10 files changed, 23 insertions(+), 23 deletions(-)
>> >> > ---
>> >> > base-commit: cd32f27dd550753488bff4918aef4e230ce01512
>> >> > change-id: 20250811-rust-1-0-0-release-65342607040e
>> >> >
>> >> > Best regards,
>> >> > --
>> >> > Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>> >>
>> >> Trying to build with the 1.60 that we claim as lower floor gives me:
>> >>
>> >> > cargo +1.60 build
>> >> [...]
>> >> error: package `bindgen v0.72.0` cannot be built because it requires rustc 1.70.0 or newer, while the currently active rustc version is 1.60.0
>> >>
>> >> With 1.70 I get:
>> >>
>> >> ~/projects/libgpiod/bindings/rust (master)> cargo +1.70 build
>> >> [...]
>> >> error: package `system-deps v7.0.5` cannot be built because it requires rustc 1.78.0 or newer, while the currently active rustc version is 1.70.0
>> >>
>> >>
>> >> 1.78 builds fine (when having cfg-expr pinned to a pre-2024-edition
>> >> version).
>> >>
>> >> So we will need to bump the MSRV to at least 1.78. The critical path
>> >> seems to be cfg-expr -> system-deps where cfg-expr seems to be extremely
>> >> aggressive with updating it's MSRV...
>> >>
>> >> 1.78 with a release in May 2024 looks reasonable to me.
>> >>
>> >> Otherwise this looks good to me!
>> >>
>> >> - Erik
>> >>
>> >
>> > Am I getting this right, should I bump min rust version to 1.78 but
>> > leave the edition at 2021?
>>
>> Yes. The 2024 edition came with 1.85. So neither our libs nor we
>> ourselves require that yet. But we _do_ require 1.78 with these changes
>> now.
>>
>> > And what does "pinned to a pre 2024-edition" even mean?
>>
>> The latest cfg-expr version sets edition = "2024". It looks like that
>> fails the Cargo.toml parse and the rust-version in the .toml does not
>> work to restrict the automatic update. To fix that I had to set the
>> version in the Cargo.lock file manually:
>>
>> cargo +1.78 update -p cfg-expr --precise 0.18.0
>>
>> This was the last version before the bump to 2024 edition and 1.85 MSRV.
>>
>> We - as a library - do not have a .lock file. So cargo will try to use
>> the latest and greatest. But a consumer of libgpiod will have such a
>> .lock file and is still able to build libgpiod with these changes under
>> 1.78.
>>
>
> Will the user-experience be: build fails -> user needs to manually
> downgrade cfg-expr in Cargo.lock -> build now succeeds? That doesn't
> sound very convenient and I'm afraid people will just bounce right
> off. Am I missing something?
Hm. This only impacts people using older Rust versions. It requires the
manual pinning of an old version, but allows them to use their Rust
version. If we bump the MSRV then we lock them out altogether. So a
"manual pinning" of versions seems like an improvement over "not
supported at all". So it mostly makes an already misrable life slightly
less miserable.
Users of newer Rust versions won't be impacted by any of these problems
and experience no down-sides.
Does that make more sense?
Aside: I found a somewhat related ticket on the cargo bug tracker and
left a comment there:
https://github.com/rust-lang/cargo/issues/15305#issuecomment-3232412629
- Erik
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2025-08-28 8:11 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-15 8:57 [PATCH libgpiod v2 0/9] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
2025-08-15 8:57 ` [PATCH libgpiod v2 1/9] bindings: rust: make Buffer::read_edge_events() lifetimes more explicit Bartosz Golaszewski
2025-08-15 8:57 ` [PATCH libgpiod v2 2/9] bindings: rust: add missing unsafe block ahead of rust version bump Bartosz Golaszewski
2025-08-15 8:57 ` [PATCH libgpiod v2 3/9] bindings: rust: update bindgen dependency Bartosz Golaszewski
2025-08-15 8:57 ` [PATCH libgpiod v2 4/9] bindings: rust: update errno dependency Bartosz Golaszewski
2025-08-15 8:57 ` [PATCH libgpiod v2 5/9] bindings: rust: update cc dependency Bartosz Golaszewski
2025-08-15 8:57 ` [PATCH libgpiod v2 6/9] bindings: rust: update system-deps dependency Bartosz Golaszewski
2025-08-15 8:57 ` [PATCH libgpiod v2 7/9] bindings: rust: update thiserror dependency Bartosz Golaszewski
2025-08-15 8:57 ` [PATCH libgpiod v2 8/9] bindings: rust: update intmap dependency Bartosz Golaszewski
2025-08-15 8:57 ` [PATCH libgpiod v2 9/9] bindings: rust: update crate versions to v1.0.0 Bartosz Golaszewski
2025-08-18 7:25 ` [PATCH libgpiod v2 0/9] bindings: rust: prepare v1.0.0 release Erik Schilling
2025-08-26 18:07 ` Bartosz Golaszewski
2025-08-27 6:36 ` Erik Schilling
2025-08-27 13:57 ` Bartosz Golaszewski
2025-08-28 8:11 ` Erik Schilling
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).