From 7a511e1e5b62c9e19fb86a655e44f84f34cc5fa3 Mon Sep 17 00:00:00 2001 From: jadamcrain Date: Wed, 30 Apr 2025 19:24:37 -0700 Subject: [PATCH 01/13] fix lints --- oo-bindgen/src/backend/c/cpp/implementation.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oo-bindgen/src/backend/c/cpp/implementation.rs b/oo-bindgen/src/backend/c/cpp/implementation.rs index d75a499e..0b479cbd 100644 --- a/oo-bindgen/src/backend/c/cpp/implementation.rs +++ b/oo-bindgen/src/backend/c/cpp/implementation.rs @@ -477,7 +477,7 @@ fn write_class_implementation( let cpp_name = handle.core_cpp_type(); // write constructor - for constructor in &handle.constructor { + if let Some(constructor) = &handle.constructor { f.writeln(&format!( "{}::{}({}) : self(fn::{}({}))", cpp_name, @@ -491,7 +491,7 @@ fn write_class_implementation( } // write the destructor - for destructor in &handle.destructor { + if let Some(destructor) = &handle.destructor { f.writeln(&format!("{cpp_name}::~{cpp_name}()"))?; blocked(f, |f| { f.writeln("if(self)")?; From f9221dea82ce3e31fc39e8839727fd94298ba569 Mon Sep 17 00:00:00 2001 From: jadamcrain Date: Wed, 30 Apr 2025 19:26:04 -0700 Subject: [PATCH 02/13] fix lints --- oo-bindgen/src/backend/c/ctype.rs | 2 +- oo-bindgen/src/backend/common/formatting.rs | 8 +++--- oo-bindgen/src/backend/dotnet/formatting.rs | 2 +- oo-bindgen/src/backend/dotnet/mod.rs | 6 ++--- oo-bindgen/src/backend/java/api/mod.rs | 2 +- oo-bindgen/src/backend/java/jni/mod.rs | 2 +- oo-bindgen/src/cli/builders/c.rs | 2 +- oo-bindgen/src/cli/builders/dotnet.rs | 6 ++--- oo-bindgen/src/model/doc.rs | 29 +++++++++------------ 9 files changed, 27 insertions(+), 32 deletions(-) diff --git a/oo-bindgen/src/backend/c/ctype.rs b/oo-bindgen/src/backend/c/ctype.rs index ec77b31d..d4e14015 100644 --- a/oo-bindgen/src/backend/c/ctype.rs +++ b/oo-bindgen/src/backend/c/ctype.rs @@ -18,7 +18,7 @@ where Pointer { inner } } -impl<'a, T> CType for Pointer<'a, T> +impl CType for Pointer<'_, T> where T: CType, { diff --git a/oo-bindgen/src/backend/common/formatting.rs b/oo-bindgen/src/backend/common/formatting.rs index b7ac9ad7..30cc7c2c 100644 --- a/oo-bindgen/src/backend/common/formatting.rs +++ b/oo-bindgen/src/backend/common/formatting.rs @@ -70,7 +70,7 @@ impl<'a, 'b> PrefixPrinter<'a, 'b> { } } -impl<'a, 'b> Printer for PrefixPrinter<'a, 'b> { +impl Printer for PrefixPrinter<'_, '_> { fn write(&mut self, s: &str) -> FormattingResult<()> { self.inner.write(s) } @@ -93,7 +93,7 @@ impl<'a> IndentedPrinter<'a> { } } -impl<'a> Printer for IndentedPrinter<'a> { +impl Printer for IndentedPrinter<'_> { fn write(&mut self, s: &str) -> FormattingResult<()> { self.inner.write(s) } @@ -115,7 +115,7 @@ impl<'a> CommentedPrinter<'a> { } } -impl<'a> Printer for CommentedPrinter<'a> { +impl Printer for CommentedPrinter<'_> { fn write(&mut self, s: &str) -> FormattingResult<()> { self.inner.write(s) } @@ -137,7 +137,7 @@ impl<'a> DoxygenPrinter<'a> { } } -impl<'a> Printer for DoxygenPrinter<'a> { +impl Printer for DoxygenPrinter<'_> { fn write(&mut self, s: &str) -> FormattingResult<()> { self.inner.write(s) } diff --git a/oo-bindgen/src/backend/dotnet/formatting.rs b/oo-bindgen/src/backend/dotnet/formatting.rs index 3ebf724a..b2244df7 100644 --- a/oo-bindgen/src/backend/dotnet/formatting.rs +++ b/oo-bindgen/src/backend/dotnet/formatting.rs @@ -10,7 +10,7 @@ impl<'a> DocumentationPrinter<'a> { } } -impl<'a> Printer for DocumentationPrinter<'a> { +impl Printer for DocumentationPrinter<'_> { fn write(&mut self, s: &str) -> FormattingResult<()> { self.inner.write(s) } diff --git a/oo-bindgen/src/backend/dotnet/mod.rs b/oo-bindgen/src/backend/dotnet/mod.rs index 38adb742..553b0f07 100644 --- a/oo-bindgen/src/backend/dotnet/mod.rs +++ b/oo-bindgen/src/backend/dotnet/mod.rs @@ -489,7 +489,7 @@ fn generate_interfaces(lib: &Library, config: &DotnetBindgenConfig) -> Formattin for interface in lib.interfaces() { // Open file let mut filename = config.output_dir.clone(); - filename.push(&format!("I{}", interface.name().camel_case())); + filename.push(format!("I{}", interface.name().camel_case())); filename.set_extension("cs"); let mut f = FilePrinter::new(filename)?; @@ -503,7 +503,7 @@ fn generate_iterator_helpers(lib: &Library, config: &DotnetBindgenConfig) -> For for iter in lib.iterators() { // Open file let mut filename = config.output_dir.clone(); - filename.push(&format!("{}Helpers", iter.name().camel_case())); + filename.push(format!("{}Helpers", iter.name().camel_case())); filename.set_extension("cs"); let mut f = FilePrinter::new(filename)?; @@ -520,7 +520,7 @@ fn generate_collection_helpers( for coll in lib.collections() { // Open file let mut filename = config.output_dir.clone(); - filename.push(&format!("{}Helpers", coll.name().camel_case())); + filename.push(format!("{}Helpers", coll.name().camel_case())); filename.set_extension("cs"); let mut f = FilePrinter::new(filename)?; diff --git a/oo-bindgen/src/backend/java/api/mod.rs b/oo-bindgen/src/backend/java/api/mod.rs index 59cdd629..138bb54b 100644 --- a/oo-bindgen/src/backend/java/api/mod.rs +++ b/oo-bindgen/src/backend/java/api/mod.rs @@ -40,7 +40,7 @@ impl JavaBindgenConfig { for dir in self.group_id.split('.') { result.push(dir); } - result.push(&lib.settings.name.kebab_case()); + result.push(lib.settings.name.kebab_case()); result } diff --git a/oo-bindgen/src/backend/java/jni/mod.rs b/oo-bindgen/src/backend/java/jni/mod.rs index fe697a98..288b0f2d 100644 --- a/oo-bindgen/src/backend/java/jni/mod.rs +++ b/oo-bindgen/src/backend/java/jni/mod.rs @@ -20,7 +20,7 @@ pub struct JniBindgenConfig<'a> { pub ffi_name: &'a str, } -impl<'a> JniBindgenConfig<'a> { +impl JniBindgenConfig<'_> { fn java_signature_path(&self, libname: &str) -> String { let mut result = self.group_id.replace('.', "/"); result.push('/'); diff --git a/oo-bindgen/src/cli/builders/c.rs b/oo-bindgen/src/cli/builders/c.rs index 46251939..0a372c43 100644 --- a/oo-bindgen/src/cli/builders/c.rs +++ b/oo-bindgen/src/cli/builders/c.rs @@ -79,7 +79,7 @@ impl BindingBuilder for CBindingBuilder { fn test(&mut self) { // Run unit tests let result = Command::new("ctest") - .current_dir(&self.build_dir()) + .current_dir(self.build_dir()) .args([".", "-C", "Debug"]) .status() .unwrap(); diff --git a/oo-bindgen/src/cli/builders/dotnet.rs b/oo-bindgen/src/cli/builders/dotnet.rs index 85ba4b90..dcb20a99 100644 --- a/oo-bindgen/src/cli/builders/dotnet.rs +++ b/oo-bindgen/src/cli/builders/dotnet.rs @@ -66,7 +66,7 @@ impl BindingBuilder for DotnetBindingBuilder { fn build(&mut self) { let result = Command::new("dotnet") - .current_dir(&self.output_dir()) + .current_dir(self.output_dir()) .arg("build") .arg("--configuration") .arg("Release") @@ -78,7 +78,7 @@ impl BindingBuilder for DotnetBindingBuilder { fn test(&mut self) { // Run unit tests let result = Command::new("dotnet") - .current_dir(&self.output_dir()) + .current_dir(self.output_dir()) .arg("test") .arg("--configuration") .arg("Release") @@ -90,7 +90,7 @@ impl BindingBuilder for DotnetBindingBuilder { fn package(&mut self) { // Produce a nupkg let result = Command::new("dotnet") - .current_dir(&self.output_dir()) + .current_dir(self.output_dir()) .arg("pack") .arg("--configuration") .arg("Release") diff --git a/oo-bindgen/src/model/doc.rs b/oo-bindgen/src/model/doc.rs index 3fc15d7e..a11776a5 100644 --- a/oo-bindgen/src/model/doc.rs +++ b/oo-bindgen/src/model/doc.rs @@ -656,7 +656,7 @@ mod tests { #[test] fn parse_param_reference() { - let doc: DocString = "This is a {param:foo} test.".try_into().unwrap(); + let doc: DocString = "This is a {param:foo} test.".into(); assert_eq!( [ DocStringElement::Text("This is a ".to_owned()), @@ -670,7 +670,7 @@ mod tests { #[test] fn parse_class_reference() { - let doc: DocString = "This is a {class:MyClass} test.".try_into().unwrap(); + let doc: DocString = "This is a {class:MyClass} test.".into(); assert_eq!( [ DocStringElement::Text("This is a ".to_owned()), @@ -684,7 +684,7 @@ mod tests { #[test] fn parse_class_reference_at_the_end() { - let doc: DocString = "This is a test {class:MyClass2}".try_into().unwrap(); + let doc: DocString = "This is a test {class:MyClass2}".into(); assert_eq!( [ DocStringElement::Text("This is a test ".to_owned()), @@ -698,8 +698,7 @@ mod tests { #[test] fn parse_class_method() { let doc: DocString = "This is a {class:MyClass.do_something()} method." - .try_into() - .unwrap(); + .into(); assert_eq!( [ DocStringElement::Text("This is a ".to_owned()), @@ -716,7 +715,7 @@ mod tests { #[test] fn parse_struct() { - let doc: DocString = "This is a {struct:MyStruct} struct.".try_into().unwrap(); + let doc: DocString = "This is a {struct:MyStruct} struct.".into(); assert_eq!( [ DocStringElement::Text("This is a ".to_owned()), @@ -731,8 +730,7 @@ mod tests { #[test] fn parse_struct_element() { let doc: DocString = "This is a {struct:MyStruct.foo} struct element." - .try_into() - .unwrap(); + .into(); assert_eq!( [ DocStringElement::Text("This is a ".to_owned()), @@ -749,7 +747,7 @@ mod tests { #[test] fn parse_enum() { - let doc: DocString = "This is a {enum:MyEnum} enum.".try_into().unwrap(); + let doc: DocString = "This is a {enum:MyEnum} enum.".into(); assert_eq!( [ DocStringElement::Text("This is a ".to_owned()), @@ -764,8 +762,7 @@ mod tests { #[test] fn parse_enum_element() { let doc: DocString = "This is a {enum:MyEnum.foo} enum variant." - .try_into() - .unwrap(); + .into(); assert_eq!( [ DocStringElement::Text("This is a ".to_owned()), @@ -783,8 +780,7 @@ mod tests { #[test] fn parse_interface() { let doc: DocString = "This is a {interface:Interface} interface." - .try_into() - .unwrap(); + .into(); assert_eq!( [ DocStringElement::Text("This is a ".to_owned()), @@ -799,8 +795,7 @@ mod tests { #[test] fn parse_interface_method() { let doc: DocString = "This is a {interface:Interface.foo()} interface method." - .try_into() - .unwrap(); + .into(); assert_eq!( [ DocStringElement::Text("This is a ".to_owned()), @@ -817,7 +812,7 @@ mod tests { #[test] fn parse_null() { - let doc: DocString = "This is a {null} null.".try_into().unwrap(); + let doc: DocString = "This is a {null} null.".into(); assert_eq!( [ DocStringElement::Text("This is a ".to_owned()), @@ -831,7 +826,7 @@ mod tests { #[test] fn parse_iterator() { - let doc: DocString = "This is a {iterator} iterator.".try_into().unwrap(); + let doc: DocString = "This is a {iterator} iterator.".into(); assert_eq!( [ DocStringElement::Text("This is a ".to_owned()), From d37781bcab31805c01ecda88b36ec25199528763 Mon Sep 17 00:00:00 2001 From: jadamcrain Date: Wed, 30 Apr 2025 20:07:59 -0700 Subject: [PATCH 03/13] fix more lints --- .../java/jni/conversion/convertible_to_rust.rs | 6 +++--- oo-bindgen/src/lib.rs | 2 -- oo-bindgen/src/model/builder/library.rs | 2 +- oo-bindgen/src/model/doc.rs | 16 ++++++---------- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/oo-bindgen/src/backend/java/jni/conversion/convertible_to_rust.rs b/oo-bindgen/src/backend/java/jni/conversion/convertible_to_rust.rs index 4537239e..7cdcb90c 100644 --- a/oo-bindgen/src/backend/java/jni/conversion/convertible_to_rust.rs +++ b/oo-bindgen/src/backend/java/jni/conversion/convertible_to_rust.rs @@ -5,11 +5,11 @@ use crate::model::*; /// Conversion happens in two phases: /// /// 1) `to_rust` is called to do a primary conversion from the JNI type to the Rust type. If a -/// conversion is required, it will frequently be used to shadow the variable. +/// conversion is required, it will frequently be used to shadow the variable. /// /// 2) `call_site` is called to do a secondary conversion to extract the final type passed to -/// the native function. This is generally used to get an inner type from some RAII type, e.g. -/// JavaString. +/// the native function. This is generally used to get an inner type from some RAII type, e.g. +/// JavaString. /// /// Conversions assume that there are two variables in scope: /// diff --git a/oo-bindgen/src/lib.rs b/oo-bindgen/src/lib.rs index 87e92d5d..392585ce 100644 --- a/oo-bindgen/src/lib.rs +++ b/oo-bindgen/src/lib.rs @@ -9,8 +9,6 @@ overflowing_literals, patterns_in_fns_without_body, pub_use_of_private_extern_crate, unknown_crate_types, -order_dependent_trait_objects, - improper_ctypes, late_bound_lifetime_arguments, non_camel_case_types, diff --git a/oo-bindgen/src/model/builder/library.rs b/oo-bindgen/src/model/builder/library.rs index c9f1eb9c..19e6232c 100644 --- a/oo-bindgen/src/model/builder/library.rs +++ b/oo-bindgen/src/model/builder/library.rs @@ -282,7 +282,7 @@ impl LibraryBuilder { /// Define a structure that can be used in any context. /// - /// Backends will generate bi-directional conversion routines + /// Backends will generate bidirectional conversion routines /// for this type of struct. pub fn define_universal_struct( &mut self, diff --git a/oo-bindgen/src/model/doc.rs b/oo-bindgen/src/model/doc.rs index a11776a5..9b26a77e 100644 --- a/oo-bindgen/src/model/doc.rs +++ b/oo-bindgen/src/model/doc.rs @@ -697,8 +697,7 @@ mod tests { #[test] fn parse_class_method() { - let doc: DocString = "This is a {class:MyClass.do_something()} method." - .into(); + let doc: DocString = "This is a {class:MyClass.do_something()} method.".into(); assert_eq!( [ DocStringElement::Text("This is a ".to_owned()), @@ -729,8 +728,7 @@ mod tests { #[test] fn parse_struct_element() { - let doc: DocString = "This is a {struct:MyStruct.foo} struct element." - .into(); + let doc: DocString = "This is a {struct:MyStruct.foo} struct element.".into(); assert_eq!( [ DocStringElement::Text("This is a ".to_owned()), @@ -761,8 +759,7 @@ mod tests { #[test] fn parse_enum_element() { - let doc: DocString = "This is a {enum:MyEnum.foo} enum variant." - .into(); + let doc: DocString = "This is a {enum:MyEnum.foo} enum variant.".into(); assert_eq!( [ DocStringElement::Text("This is a ".to_owned()), @@ -779,8 +776,7 @@ mod tests { #[test] fn parse_interface() { - let doc: DocString = "This is a {interface:Interface} interface." - .into(); + let doc: DocString = "This is a {interface:Interface} interface.".into(); assert_eq!( [ DocStringElement::Text("This is a ".to_owned()), @@ -794,8 +790,8 @@ mod tests { #[test] fn parse_interface_method() { - let doc: DocString = "This is a {interface:Interface.foo()} interface method." - .into(); + let doc: DocString = + "This is a {interface:Interface.foo()} interface method.".into(); assert_eq!( [ DocStringElement::Text("This is a ".to_owned()), From dfdf8f1f9c39a46bae151a46faf8fb8203c06565 Mon Sep 17 00:00:00 2001 From: jadamcrain Date: Wed, 30 Apr 2025 20:20:21 -0700 Subject: [PATCH 04/13] more lints --- oo-bindgen/src/backend/java/jni/copy/util.rs | 2 +- oo-bindgen/src/model/doc.rs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/oo-bindgen/src/backend/java/jni/copy/util.rs b/oo-bindgen/src/backend/java/jni/copy/util.rs index 41e87578..bad78654 100644 --- a/oo-bindgen/src/backend/java/jni/copy/util.rs +++ b/oo-bindgen/src/backend/java/jni/copy/util.rs @@ -9,7 +9,7 @@ impl<'a> LocalFrameGuard<'a> { } } -impl<'a> Drop for LocalFrameGuard<'a> { +impl Drop for LocalFrameGuard<'_> { fn drop(&mut self) { let _ = self.env.pop_local_frame(jni::objects::JObject::null()); } diff --git a/oo-bindgen/src/model/doc.rs b/oo-bindgen/src/model/doc.rs index 9b26a77e..f2474324 100644 --- a/oo-bindgen/src/model/doc.rs +++ b/oo-bindgen/src/model/doc.rs @@ -650,7 +650,6 @@ impl TryFrom<&str> for DocStringElement { #[cfg(test)] mod tests { - use std::convert::TryInto; use super::*; From d75b9b65cd1463e79caca5852a317f7a8639e213 Mon Sep 17 00:00:00 2001 From: jadamcrain Date: Thu, 1 May 2025 14:59:41 -0700 Subject: [PATCH 05/13] fix/silence some lints --- oo-bindgen/src/backend/java/jni/mod.rs | 10 ++++++++-- tests/foo-ffi-java/src/lib.rs | 1 + tests/foo-ffi/src/lib.rs | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/oo-bindgen/src/backend/java/jni/mod.rs b/oo-bindgen/src/backend/java/jni/mod.rs index 288b0f2d..20e6c385 100644 --- a/oo-bindgen/src/backend/java/jni/mod.rs +++ b/oo-bindgen/src/backend/java/jni/mod.rs @@ -147,6 +147,10 @@ fn generate_cache(f: &mut dyn Printer) -> FormattingResult<()> { f.newline()?; f.writeln("pub(crate) fn get_cache<'a>() -> &'a JCache {")?; + indented(f, |f| { + f.writeln("// safety: this is only called after initialization / JVM load") + })?; + indented(f, |f| f.writeln("#[allow(static_mut_refs)]"))?; indented(f, |f| f.writeln("unsafe { JCACHE.as_ref().unwrap() }"))?; f.writeln("}")?; @@ -158,7 +162,8 @@ fn generate_cache(f: &mut dyn Printer) -> FormattingResult<()> { blocked(f, |f| { f.writeln("let vm = unsafe { jni::JavaVM::from_raw(vm).unwrap() };")?; f.writeln("let jcache = JCache::init(vm);")?; - f.writeln("unsafe { JCACHE.replace(jcache) };")?; + f.writeln("// safety: this is only called during library loading")?; + f.writeln("unsafe { JCACHE = Some(jcache); };")?; f.writeln("jni::JNIVersion::V8.into()") })?; @@ -168,7 +173,8 @@ fn generate_cache(f: &mut dyn Printer) -> FormattingResult<()> { f.writeln("#[no_mangle]")?; f.writeln("pub extern \"C\" fn JNI_OnUnload(_vm: *mut jni::sys::JavaVM, _: *mut std::ffi::c_void) -> jni::sys::jint")?; blocked(f, |f| { - f.writeln("unsafe { JCACHE.take().unwrap(); }")?; + f.writeln("// safety: this is only called during library unloading / JVM shutdown")?; + f.writeln("unsafe { JCACHE = None; }")?; f.writeln("return 0;") }) } diff --git a/tests/foo-ffi-java/src/lib.rs b/tests/foo-ffi-java/src/lib.rs index 9d04bde2..0001877a 100644 --- a/tests/foo-ffi-java/src/lib.rs +++ b/tests/foo-ffi-java/src/lib.rs @@ -5,6 +5,7 @@ clippy::redundant_closure, clippy::needless_borrow, clippy::needless_return, + clippy::needless_lifetimes, clippy::not_unsafe_ptr_arg_deref, unused_variables, dead_code diff --git a/tests/foo-ffi/src/lib.rs b/tests/foo-ffi/src/lib.rs index e120bdfd..0788174e 100644 --- a/tests/foo-ffi/src/lib.rs +++ b/tests/foo-ffi/src/lib.rs @@ -37,6 +37,7 @@ mod thread_class; mod universal; #[allow(clippy::extra_unused_lifetimes)] +#[allow(clippy::needless_lifetimes)] pub mod ffi; static VERSION: &str = concat!("1.2.3", "\0"); From 62d42344274785d9096a0ef7774affe2b721d148 Mon Sep 17 00:00:00 2001 From: jadamcrain Date: Thu, 1 May 2025 15:48:33 -0700 Subject: [PATCH 06/13] update doxygen and actions upload --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95430a98..4186f75a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,8 +55,8 @@ jobs: uses: actions/checkout@v3 - name: Install Rust uses: dtolnay/rust-toolchain@stable - - name: Install doxygen 1.9.3 - run: wget -q https://www.doxygen.nl/files/doxygen-1.9.5.linux.bin.tar.gz -O- | sudo tar --strip-components=1 -C /usr -xz doxygen-1.9.5 + - name: Install doxygen 1.13.2 + run: wget -q https://www.doxygen.nl/files/doxygen-1.13.2.linux.bin.tar.gz -O- | sudo tar --strip-components=1 -C /usr -xz doxygen-1.9.5 - name: Build FFI and JNI shared libraries run: cargo build --release -p foo-ffi -p foo-ffi-java - name: C bindings @@ -74,7 +74,7 @@ jobs: cp -a tests/bindings/java/foo/target/apidocs ~/doc/java rm tests/bindings/c/generated/logo.png tests/bindings/c/generated/doxygen-awesome.css - name: Upload documentation - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: doc path: ~/doc From ac63b885d6b9b4dfe7424cb174c6f7633a478d3e Mon Sep 17 00:00:00 2001 From: jadamcrain Date: Thu, 1 May 2025 15:52:32 -0700 Subject: [PATCH 07/13] parameterize doxygen version --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4186f75a..fd80b3c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,14 +49,16 @@ jobs: run: cargo clippy -- -D warnings # Build documentation documentation: + env: + DoxygenVersion: 1.13.2 runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - name: Install Rust uses: dtolnay/rust-toolchain@stable - - name: Install doxygen 1.13.2 - run: wget -q https://www.doxygen.nl/files/doxygen-1.13.2.linux.bin.tar.gz -O- | sudo tar --strip-components=1 -C /usr -xz doxygen-1.9.5 + - name: Install doxygen ${{ DoxygenVersion }} + run: wget -q https://www.doxygen.nl/files/doxygen-${{ DoxygenVersion }}.linux.bin.tar.gz -O- | sudo tar --strip-components=1 -C /usr -xz doxygen-${{ DoxygenVersion }} - name: Build FFI and JNI shared libraries run: cargo build --release -p foo-ffi -p foo-ffi-java - name: C bindings From 69414d864fdcea7a51e9e570859d905af351ee24 Mon Sep 17 00:00:00 2001 From: jadamcrain Date: Thu, 1 May 2025 15:53:29 -0700 Subject: [PATCH 08/13] add env. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd80b3c3..5beb5528 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,8 +57,8 @@ jobs: uses: actions/checkout@v3 - name: Install Rust uses: dtolnay/rust-toolchain@stable - - name: Install doxygen ${{ DoxygenVersion }} - run: wget -q https://www.doxygen.nl/files/doxygen-${{ DoxygenVersion }}.linux.bin.tar.gz -O- | sudo tar --strip-components=1 -C /usr -xz doxygen-${{ DoxygenVersion }} + - name: Install doxygen ${{ env.DoxygenVersion }} + run: wget -q https://www.doxygen.nl/files/doxygen-${{ env.DoxygenVersion }}.linux.bin.tar.gz -O- | sudo tar --strip-components=1 -C /usr -xz doxygen-${{ env.DoxygenVersion }} - name: Build FFI and JNI shared libraries run: cargo build --release -p foo-ffi -p foo-ffi-java - name: C bindings From f117c60e3a9af402c0a9edfea1cabcb357f43b43 Mon Sep 17 00:00:00 2001 From: jadamcrain Date: Thu, 1 May 2025 16:11:37 -0700 Subject: [PATCH 09/13] update actions upload v2 -> v4 --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5beb5528..a58f9aa4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -108,9 +108,9 @@ jobs: Copy-Item -Path ./target/${{ matrix.target }}/release/foo_ffi.dll.lib -Destination ffi-modules/${{ matrix.target }} Copy-Item -Path ./target/${{ matrix.target }}/release/foo_ffi_java.dll -Destination ffi-modules/${{ matrix.target }} - name: Upload compiled FFI modules - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: - name: ffi-modules + name: ffi-modules-${{ matrix.target }} path: ffi-modules - name: C Bindings Tests if: ${{ matrix.test }} @@ -147,9 +147,9 @@ jobs: cp ./target/release/libfoo_ffi.dylib ./ffi-modules/${{ matrix.target }} cp ./target/release/libfoo_ffi_java.dylib ./ffi-modules/${{ matrix.target }} - name: Upload compiled FFI modules - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: - name: ffi-modules + name: ffi-modules-${{ matrix.target }} path: ffi-modules - name: .NET Bindings Tests run: cargo run --bin foo-bindings -- --dotnet @@ -184,9 +184,9 @@ jobs: cp ./target/${{ matrix.target }}/release/libfoo_ffi.so ./ffi-modules/${{ matrix.target }} cp ./target/${{ matrix.target }}/release/libfoo_ffi_java.so ./ffi-modules/${{ matrix.target }} - name: Upload compiled FFI modules - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: - name: ffi-modules + name: ffi-modules-${matrix-target} path: ffi-modules # Package all the generated bindings packaging: From 461e554c6abe16ebaf5e0ec9614f659060c34b9a Mon Sep 17 00:00:00 2001 From: jadamcrain Date: Thu, 1 May 2025 16:15:46 -0700 Subject: [PATCH 10/13] fix typo --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a58f9aa4..b5bc50b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -186,7 +186,7 @@ jobs: - name: Upload compiled FFI modules uses: actions/upload-artifact@v4 with: - name: ffi-modules-${matrix-target} + name: ffi-modules-${{matrix-target}} path: ffi-modules # Package all the generated bindings packaging: From ff9dee5d091a5ca5be99cb035341bbf0e95598e3 Mon Sep 17 00:00:00 2001 From: jadamcrain Date: Thu, 1 May 2025 21:17:42 -0700 Subject: [PATCH 11/13] fix typo --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5bc50b6..a5e89377 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -186,7 +186,7 @@ jobs: - name: Upload compiled FFI modules uses: actions/upload-artifact@v4 with: - name: ffi-modules-${{matrix-target}} + name: ffi-modules-${{matrix.target}} path: ffi-modules # Package all the generated bindings packaging: From f6a696b536a731a07afb0e2ba5f4063ed128c54a Mon Sep 17 00:00:00 2001 From: jadamcrain Date: Fri, 2 May 2025 07:58:01 -0700 Subject: [PATCH 12/13] first stab at new packaging step --- .github/workflows/ci.yml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5e89377..464bccf0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Rust ${{ matrix.rust }} uses: dtolnay/rust-toolchain@master with: @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Rust ${{ matrix.rust }} uses: dtolnay/rust-toolchain@master with: @@ -54,7 +54,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@stable - name: Install doxygen ${{ env.DoxygenVersion }} @@ -93,7 +93,7 @@ jobs: test: false steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: @@ -134,7 +134,7 @@ jobs: target: x86_64-apple-darwin steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: @@ -169,7 +169,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: @@ -194,28 +194,29 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@stable - name: Download compiled FFI - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: ffi-modules - path: ffi-modules + path: ffi-modules-* + merge-multiple: true - name: Package all bindings run: cargo run --bin foo-bindings -- --package ./ffi-modules --options ./packaging.json - name: Upload C/C++ bindings - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: c-bindings path: tests/bindings/c/generated/* - name: Upload .NET bindings - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: dotnet-bindings path: tests/bindings/dotnet/nupkg/* - name: Upload Java bindings - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: java-bindings path: tests/bindings/java/foo/target/*.jar From e3befff80f8564cb85d9a039b9a319cb1714fc2f Mon Sep 17 00:00:00 2001 From: jadamcrain Date: Fri, 2 May 2025 08:07:29 -0700 Subject: [PATCH 13/13] fix typo --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 464bccf0..dba69c85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -200,8 +200,8 @@ jobs: - name: Download compiled FFI uses: actions/download-artifact@v4 with: - name: ffi-modules - path: ffi-modules-* + path: ffi-modules + pattern: ffi-modules-* merge-multiple: true - name: Package all bindings run: cargo run --bin foo-bindings -- --package ./ffi-modules --options ./packaging.json