Skip to content

Conversation

@mulkieran
Copy link
Member

No description provided.

Signed-off-by: mulhern <amulhern@redhat.com>
@mulkieran mulkieran self-assigned this Apr 16, 2025
@mulkieran mulkieran moved this to In Review in 2025April Apr 16, 2025
@mulkieran mulkieran marked this pull request as ready for review April 16, 2025 17:42
@mulkieran
Copy link
Member Author

mulkieran commented Apr 16, 2025

This is all the changes since previous version, about a year ago:

diff --git a/libcryptsetup-rs-sys/Cargo.toml b/libcryptsetup-rs-sys/Cargo.toml
index 5daf06e7..2b56da1f 100644
--- a/libcryptsetup-rs-sys/Cargo.toml
+++ b/libcryptsetup-rs-sys/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "libcryptsetup-rs-sys"
-version = "0.4.0"
+version = "0.4.1"
 authors = ["John Baublitz <jbaublitz@redhat.com>"]
 edition = "2021"
 rust-version = "1.74.0"  # LOWEST SUPPORTED RUST TOOLCHAIN
@@ -33,3 +33,6 @@ nonstandard_style = { level = "deny", priority = 4 }
 all = { level = "deny" }
 cargo = { level = "deny", priority = 1 }
 multiple-crate-versions = { level = "allow", priority = 2 }
+
+[features]
+static = []
diff --git a/libcryptsetup-rs-sys/build.rs b/libcryptsetup-rs-sys/build.rs
index 41e8830a..e638c891 100644
--- a/libcryptsetup-rs-sys/build.rs
+++ b/libcryptsetup-rs-sys/build.rs
@@ -6,10 +6,10 @@ use semver::Version;
 use std::path::PathBuf;
 
 fn probe() -> Library {
-    match Config::new()
-        .atleast_version("2.2.0")
-        .probe("libcryptsetup")
-    {
+    let mut config = Config::new();
+    #[cfg(feature = "static")]
+    config.statik(true);
+    match config.atleast_version("2.2.0").probe("libcryptsetup") {
         Ok(l) => l,
         Err(e) => panic!("Bindings require at least cryptsetup-2.2.0: {e}"),
     }
@@ -23,11 +23,12 @@ fn build_safe_free() {
 
 fn generate_bindings(library: &Library, safe_free_is_needed: bool) {
     let builder = bindgen::Builder::default()
-        .clang_args(library.include_paths.iter().map(|path| {
-            let r = format!("-I{}", path.to_string_lossy());
-            eprintln!("{}", r);
-            r
-        }))
+        .clang_args(
+            library
+                .include_paths
+                .iter()
+                .map(|path| format!("-I{}", path.display())),
+        )
         .header("header.h")

@mulkieran mulkieran requested a review from jbaublitz April 16, 2025 17:53
@mulkieran mulkieran merged commit 15f5b64 into stratis-storage:master Apr 16, 2025
39 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in 2025April Apr 16, 2025
@mulkieran mulkieran deleted the libcryptsetup-rs-sys-version-0.4.1 branch April 16, 2025 20:26
@mulkieran mulkieran moved this from Done to Done(3) in 2025April Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done(3)

Development

Successfully merging this pull request may close these issues.

2 participants