linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH libgpiod v3 00/10] bindings: rust: prepare v1.0.0 release
@ 2025-08-28 17:43 Bartosz Golaszewski
  2025-08-28 17:43 ` [PATCH libgpiod v3 01/10] bindings: rust: make Buffer::read_edge_events() lifetimes more explicit Bartosz Golaszewski
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2025-08-28 17:43 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 v3:
- Bump the minimum required rustc version to v1.78 after all to satisfy
  more recent versions of bindgen and system-deps
- Link to v2: https://lore.kernel.org/r/20250815-rust-1-0-0-release-v2-0-b1794cb4b9be@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 (10):
      bindings: rust: make Buffer::read_edge_events() lifetimes more explicit
      bindings: rust: add missing unsafe block ahead of rust version bump
      bindings: rust: bump the minimum required rustc version
      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       | 10 +++++-----
 bindings/rust/gpiosim-sys/build.rs         |  2 +-
 bindings/rust/libgpiod-sys/Cargo.toml      |  8 ++++----
 bindings/rust/libgpiod-sys/build.rs        |  6 +++---
 bindings/rust/libgpiod/Cargo.toml          | 12 ++++++------
 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, 26 insertions(+), 26 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] 13+ messages in thread

* [PATCH libgpiod v3 01/10] bindings: rust: make Buffer::read_edge_events() lifetimes more explicit
  2025-08-28 17:43 [PATCH libgpiod v3 00/10] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
@ 2025-08-28 17:43 ` Bartosz Golaszewski
  2025-08-28 17:43 ` [PATCH libgpiod v3 02/10] bindings: rust: add missing unsafe block ahead of rust version bump Bartosz Golaszewski
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2025-08-28 17:43 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] 13+ messages in thread

* [PATCH libgpiod v3 02/10] bindings: rust: add missing unsafe block ahead of rust version bump
  2025-08-28 17:43 [PATCH libgpiod v3 00/10] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
  2025-08-28 17:43 ` [PATCH libgpiod v3 01/10] bindings: rust: make Buffer::read_edge_events() lifetimes more explicit Bartosz Golaszewski
@ 2025-08-28 17:43 ` Bartosz Golaszewski
  2025-08-28 17:43 ` [PATCH libgpiod v3 03/10] bindings: rust: bump the minimum required rustc version Bartosz Golaszewski
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2025-08-28 17:43 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] 13+ messages in thread

* [PATCH libgpiod v3 03/10] bindings: rust: bump the minimum required rustc version
  2025-08-28 17:43 [PATCH libgpiod v3 00/10] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
  2025-08-28 17:43 ` [PATCH libgpiod v3 01/10] bindings: rust: make Buffer::read_edge_events() lifetimes more explicit Bartosz Golaszewski
  2025-08-28 17:43 ` [PATCH libgpiod v3 02/10] bindings: rust: add missing unsafe block ahead of rust version bump Bartosz Golaszewski
@ 2025-08-28 17:43 ` Bartosz Golaszewski
  2025-08-28 17:43 ` [PATCH libgpiod v3 04/10] bindings: rust: update bindgen dependency Bartosz Golaszewski
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2025-08-28 17:43 UTC (permalink / raw)
  To: Viresh Kumar, Linus Walleij, Erik Wierich; +Cc: linux-gpio, Bartosz Golaszewski

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

In order to satisfy the requirements of more recent versions of bindgen
and system-deps, bump the minimum required rustc version to v1.78.

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     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bindings/rust/gpiosim-sys/Cargo.toml b/bindings/rust/gpiosim-sys/Cargo.toml
index 1f44a312563f21181b4b3ff79f1fa3b70ededc5d..47b74cda2f391eb5a15f8aa2be3ccbeed0c92604 100644
--- a/bindings/rust/gpiosim-sys/Cargo.toml
+++ b/bindings/rust/gpiosim-sys/Cargo.toml
@@ -9,7 +9,7 @@ authors = ["Viresh Kumar <viresh.kumar@linaro.org>"]
 description = "gpiosim header bindings"
 repository = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git"
 categories = ["external-ffi-bindings", "os::linux-apis"]
-rust-version = "1.60"
+rust-version = "1.78"
 keywords = ["libgpiod", "gpio", "gpiosim"]
 license = "Apache-2.0 OR BSD-3-Clause"
 edition = "2021"
diff --git a/bindings/rust/libgpiod-sys/Cargo.toml b/bindings/rust/libgpiod-sys/Cargo.toml
index eb600a9ee087638e1a3ea5013dec6ccbbaa29d1e..e789a874cade99d6fc792136079d6ddb6988dfee 100644
--- a/bindings/rust/libgpiod-sys/Cargo.toml
+++ b/bindings/rust/libgpiod-sys/Cargo.toml
@@ -9,7 +9,7 @@ authors = ["Viresh Kumar <viresh.kumar@linaro.org>"]
 description = "libgpiod public header bindings"
 repository = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git"
 categories = ["external-ffi-bindings", "os::linux-apis"]
-rust-version = "1.60"
+rust-version = "1.78"
 keywords = ["libgpiod", "gpio"]
 license = "Apache-2.0 OR BSD-3-Clause"
 edition = "2021"
diff --git a/bindings/rust/libgpiod/Cargo.toml b/bindings/rust/libgpiod/Cargo.toml
index 23c34799715339be02f769a6b4b7de8ae5c1639f..82ea2f32a0fc9a18eca406f5c0fa6c3f1aa2c57e 100644
--- a/bindings/rust/libgpiod/Cargo.toml
+++ b/bindings/rust/libgpiod/Cargo.toml
@@ -9,7 +9,7 @@ authors = ["Viresh Kumar <viresh.kumar@linaro.org>"]
 description = "libgpiod wrappers"
 repository = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git"
 categories = ["api-bindings", "hardware-support", "embedded", "os::linux-apis"]
-rust-version = "1.60"
+rust-version = "1.78"
 keywords = ["libgpiod", "gpio"]
 license = "Apache-2.0 OR BSD-3-Clause"
 edition = "2021"

-- 
2.48.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH libgpiod v3 04/10] bindings: rust: update bindgen dependency
  2025-08-28 17:43 [PATCH libgpiod v3 00/10] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
                   ` (2 preceding siblings ...)
  2025-08-28 17:43 ` [PATCH libgpiod v3 03/10] bindings: rust: bump the minimum required rustc version Bartosz Golaszewski
@ 2025-08-28 17:43 ` Bartosz Golaszewski
  2025-08-28 17:43 ` [PATCH libgpiod v3 05/10] bindings: rust: update errno dependency Bartosz Golaszewski
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2025-08-28 17:43 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 47b74cda2f391eb5a15f8aa2be3ccbeed0c92604..020c6e7ec0d8c07da833f8a67f1c65ee6041a14a 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 e789a874cade99d6fc792136079d6ddb6988dfee..d5901b96721255c4ebefaef6b18a6bd9847d3b4e 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] 13+ messages in thread

* [PATCH libgpiod v3 05/10] bindings: rust: update errno dependency
  2025-08-28 17:43 [PATCH libgpiod v3 00/10] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
                   ` (3 preceding siblings ...)
  2025-08-28 17:43 ` [PATCH libgpiod v3 04/10] bindings: rust: update bindgen dependency Bartosz Golaszewski
@ 2025-08-28 17:43 ` Bartosz Golaszewski
  2025-08-28 17:43 ` [PATCH libgpiod v3 06/10] bindings: rust: update cc dependency Bartosz Golaszewski
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2025-08-28 17:43 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 020c6e7ec0d8c07da833f8a67f1c65ee6041a14a..bd6223cf66497e960617ee4cd04db6d68496df1e 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 82ea2f32a0fc9a18eca406f5c0fa6c3f1aa2c57e..37a5c277593aab812a01626648c2e30dbee8ebf1 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] 13+ messages in thread

* [PATCH libgpiod v3 06/10] bindings: rust: update cc dependency
  2025-08-28 17:43 [PATCH libgpiod v3 00/10] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
                   ` (4 preceding siblings ...)
  2025-08-28 17:43 ` [PATCH libgpiod v3 05/10] bindings: rust: update errno dependency Bartosz Golaszewski
@ 2025-08-28 17:43 ` Bartosz Golaszewski
  2025-08-28 17:43 ` [PATCH libgpiod v3 07/10] bindings: rust: update system-deps dependency Bartosz Golaszewski
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2025-08-28 17:43 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 bd6223cf66497e960617ee4cd04db6d68496df1e..148f7bb76501886e894bdd1649ac02567b10616a 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] 13+ messages in thread

* [PATCH libgpiod v3 07/10] bindings: rust: update system-deps dependency
  2025-08-28 17:43 [PATCH libgpiod v3 00/10] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
                   ` (5 preceding siblings ...)
  2025-08-28 17:43 ` [PATCH libgpiod v3 06/10] bindings: rust: update cc dependency Bartosz Golaszewski
@ 2025-08-28 17:43 ` Bartosz Golaszewski
  2025-08-28 17:43 ` [PATCH libgpiod v3 08/10] bindings: rust: update thiserror dependency Bartosz Golaszewski
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2025-08-28 17:43 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 d5901b96721255c4ebefaef6b18a6bd9847d3b4e..db2616f74c2d116878abca6b5391647f6b6fd2d4 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] 13+ messages in thread

* [PATCH libgpiod v3 08/10] bindings: rust: update thiserror dependency
  2025-08-28 17:43 [PATCH libgpiod v3 00/10] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
                   ` (6 preceding siblings ...)
  2025-08-28 17:43 ` [PATCH libgpiod v3 07/10] bindings: rust: update system-deps dependency Bartosz Golaszewski
@ 2025-08-28 17:43 ` Bartosz Golaszewski
  2025-08-28 17:43 ` [PATCH libgpiod v3 09/10] bindings: rust: update intmap dependency Bartosz Golaszewski
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2025-08-28 17:43 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 37a5c277593aab812a01626648c2e30dbee8ebf1..c7542d61fdf0ddac79a1c2c5e1d4a587d32c5b16 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] 13+ messages in thread

* [PATCH libgpiod v3 09/10] bindings: rust: update intmap dependency
  2025-08-28 17:43 [PATCH libgpiod v3 00/10] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
                   ` (7 preceding siblings ...)
  2025-08-28 17:43 ` [PATCH libgpiod v3 08/10] bindings: rust: update thiserror dependency Bartosz Golaszewski
@ 2025-08-28 17:43 ` Bartosz Golaszewski
  2025-08-28 17:43 ` [PATCH libgpiod v3 10/10] bindings: rust: update crate versions to v1.0.0 Bartosz Golaszewski
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2025-08-28 17:43 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 c7542d61fdf0ddac79a1c2c5e1d4a587d32c5b16..533a482f7cf45d5174b78824203befdeeb2901a3 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] 13+ messages in thread

* [PATCH libgpiod v3 10/10] bindings: rust: update crate versions to v1.0.0
  2025-08-28 17:43 [PATCH libgpiod v3 00/10] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
                   ` (8 preceding siblings ...)
  2025-08-28 17:43 ` [PATCH libgpiod v3 09/10] bindings: rust: update intmap dependency Bartosz Golaszewski
@ 2025-08-28 17:43 ` Bartosz Golaszewski
  2025-08-29  8:02 ` [PATCH libgpiod v3 00/10] bindings: rust: prepare v1.0.0 release Erik Schilling
  2025-09-01  8:35 ` Bartosz Golaszewski
  11 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2025-08-28 17:43 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 148f7bb76501886e894bdd1649ac02567b10616a..7458b00efc342ace9ddb040e2f3c0575a8054dfa 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 db2616f74c2d116878abca6b5391647f6b6fd2d4..97bba2f475e8a8a307c0d96ef3c82df56070b75c 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 533a482f7cf45d5174b78824203befdeeb2901a3..4d88b071442eadec0159c5b7c082df667d5e126c 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] 13+ messages in thread

* Re: [PATCH libgpiod v3 00/10] bindings: rust: prepare v1.0.0 release
  2025-08-28 17:43 [PATCH libgpiod v3 00/10] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
                   ` (9 preceding siblings ...)
  2025-08-28 17:43 ` [PATCH libgpiod v3 10/10] bindings: rust: update crate versions to v1.0.0 Bartosz Golaszewski
@ 2025-08-29  8:02 ` Erik Schilling
  2025-09-01  8:35 ` Bartosz Golaszewski
  11 siblings, 0 replies; 13+ messages in thread
From: Erik Schilling @ 2025-08-29  8:02 UTC (permalink / raw)
  To: Bartosz Golaszewski, Viresh Kumar, Linus Walleij
  Cc: linux-gpio, Bartosz Golaszewski

On Thu Aug 28, 2025 at 7:43 PM 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 v3:
> - Bump the minimum required rustc version to v1.78 after all to satisfy
>   more recent versions of bindgen and system-deps
> - Link to v2: https://lore.kernel.org/r/20250815-rust-1-0-0-release-v2-0-b1794cb4b9be@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 (10):
>       bindings: rust: make Buffer::read_edge_events() lifetimes more explicit
>       bindings: rust: add missing unsafe block ahead of rust version bump
>       bindings: rust: bump the minimum required rustc version
>       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       | 10 +++++-----
>  bindings/rust/gpiosim-sys/build.rs         |  2 +-
>  bindings/rust/libgpiod-sys/Cargo.toml      |  8 ++++----
>  bindings/rust/libgpiod-sys/build.rs        |  6 +++---
>  bindings/rust/libgpiod/Cargo.toml          | 12 ++++++------
>  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, 26 insertions(+), 26 deletions(-)
> ---
> base-commit: cd32f27dd550753488bff4918aef4e230ce01512
> change-id: 20250811-rust-1-0-0-release-65342607040e
>
> Best regards,
> -- 
> Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Reviewed-by: Erik Wierich <erik@riscstar.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH libgpiod v3 00/10] bindings: rust: prepare v1.0.0 release
  2025-08-28 17:43 [PATCH libgpiod v3 00/10] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
                   ` (10 preceding siblings ...)
  2025-08-29  8:02 ` [PATCH libgpiod v3 00/10] bindings: rust: prepare v1.0.0 release Erik Schilling
@ 2025-09-01  8:35 ` Bartosz Golaszewski
  11 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2025-09-01  8:35 UTC (permalink / raw)
  To: Viresh Kumar, Linus Walleij, Erik Wierich, Bartosz Golaszewski
  Cc: Bartosz Golaszewski, linux-gpio

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>


On Thu, 28 Aug 2025 19:43:02 +0200, 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.
> 
> 
> [...]

Applied, thanks!

[01/10] bindings: rust: make Buffer::read_edge_events() lifetimes more explicit
        https://git.kernel.org/brgl/libgpiod/c/fafd5e6180176247da3e1b57beea2ec558e7352c
[02/10] bindings: rust: add missing unsafe block ahead of rust version bump
        https://git.kernel.org/brgl/libgpiod/c/07b65bb3072ff4c4060d7ecde4902f5f1bfc1453
[03/10] bindings: rust: bump the minimum required rustc version
        https://git.kernel.org/brgl/libgpiod/c/ec4486fde14b9a504ad6cad9444b6328e0df841b
[04/10] bindings: rust: update bindgen dependency
        https://git.kernel.org/brgl/libgpiod/c/e40018f9ccebf0ca12626fc65ae88c2bcd1883d9
[05/10] bindings: rust: update errno dependency
        https://git.kernel.org/brgl/libgpiod/c/1430eb1e9163c76944ed68acb3e51160ead34b16
[06/10] bindings: rust: update cc dependency
        https://git.kernel.org/brgl/libgpiod/c/00c224897d1a5cf664a410736872d89750e5230c
[07/10] bindings: rust: update system-deps dependency
        https://git.kernel.org/brgl/libgpiod/c/4b9924ff3152c79188e803829c39660afa1ade5d
[08/10] bindings: rust: update thiserror dependency
        https://git.kernel.org/brgl/libgpiod/c/751a37fa3784c1feb4656bb89ae4996de7b9ff75
[09/10] bindings: rust: update intmap dependency
        https://git.kernel.org/brgl/libgpiod/c/efc39de44ad92c37b43f363e9cb78bb9dba44492
[10/10] bindings: rust: update crate versions to v1.0.0
        https://git.kernel.org/brgl/libgpiod/c/d0006cc3d57b0e8fe090a1596934340c34e69ab4

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-09-01  8:35 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-28 17:43 [PATCH libgpiod v3 00/10] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
2025-08-28 17:43 ` [PATCH libgpiod v3 01/10] bindings: rust: make Buffer::read_edge_events() lifetimes more explicit Bartosz Golaszewski
2025-08-28 17:43 ` [PATCH libgpiod v3 02/10] bindings: rust: add missing unsafe block ahead of rust version bump Bartosz Golaszewski
2025-08-28 17:43 ` [PATCH libgpiod v3 03/10] bindings: rust: bump the minimum required rustc version Bartosz Golaszewski
2025-08-28 17:43 ` [PATCH libgpiod v3 04/10] bindings: rust: update bindgen dependency Bartosz Golaszewski
2025-08-28 17:43 ` [PATCH libgpiod v3 05/10] bindings: rust: update errno dependency Bartosz Golaszewski
2025-08-28 17:43 ` [PATCH libgpiod v3 06/10] bindings: rust: update cc dependency Bartosz Golaszewski
2025-08-28 17:43 ` [PATCH libgpiod v3 07/10] bindings: rust: update system-deps dependency Bartosz Golaszewski
2025-08-28 17:43 ` [PATCH libgpiod v3 08/10] bindings: rust: update thiserror dependency Bartosz Golaszewski
2025-08-28 17:43 ` [PATCH libgpiod v3 09/10] bindings: rust: update intmap dependency Bartosz Golaszewski
2025-08-28 17:43 ` [PATCH libgpiod v3 10/10] bindings: rust: update crate versions to v1.0.0 Bartosz Golaszewski
2025-08-29  8:02 ` [PATCH libgpiod v3 00/10] bindings: rust: prepare v1.0.0 release Erik Schilling
2025-09-01  8:35 ` Bartosz Golaszewski

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).