From 0a5fc370aff5bdaf7f1313849e04aedbddc061f7 Mon Sep 17 00:00:00 2001 From: Alexander Schuetz Date: Thu, 6 Nov 2025 16:36:19 +0100 Subject: [PATCH 1/4] add freebsd ci --- .github/workflows/libloading.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/libloading.yml b/.github/workflows/libloading.yml index 8ed2b7dac..f23748042 100644 --- a/.github/workflows/libloading.yml +++ b/.github/workflows/libloading.yml @@ -48,6 +48,29 @@ jobs: - name: Compile without the standard library run: cargo clean && cargo +nightly build -Zbuild-std=core,alloc --no-default-features + freebsd-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: test freebsd + uses: cross-platform-actions/action@v0.29.0 + with: + memory: 512M + operating_system: freebsd + version: '14.3' + run: | + uname -a + echo "SETUP RUST" + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + . "$HOME/.cargo/env" + echo "RUNNING TESTS" + cargo test --verbose --release + cargo test -- --nocapture + cargo test --release -- --nocapture + cargo test --no-default-features -- --nocapture + cargo test --release --no-default-features -- --nocapture + + windows-test: runs-on: windows-latest strategy: From 05b7e537af1d9a4e9593c077d1e43ba0243c39f7 Mon Sep 17 00:00:00 2001 From: Alexander Schuetz Date: Thu, 6 Nov 2025 16:39:27 +0100 Subject: [PATCH 2/4] fix library_filename.rs test to work on non linux/mac targets --- tests/library_filename.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/library_filename.rs b/tests/library_filename.rs index 7029e0a72..4c7f21d70 100644 --- a/tests/library_filename.rs +++ b/tests/library_filename.rs @@ -6,11 +6,13 @@ mod test { #[cfg(any(target_os = "windows", target_os = "cygwin"))] const EXPECTED: &str = "audioengine.dll"; - #[cfg(target_os = "linux")] + #[cfg(any(target_os = "linux", target_os = "netbsd", target_os = "openbsd", target_os = "freebsd"))] const EXPECTED: &str = "libaudioengine.so"; #[cfg(target_os = "macos")] const EXPECTED: &str = "libaudioengine.dylib"; + + #[test] fn test_library_filename() { let name = "audioengine"; From e6e26ce839bd45a157b961fef14ef378ca8363d2 Mon Sep 17 00:00:00 2001 From: Alexander Schuetz Date: Thu, 6 Nov 2025 16:42:41 +0100 Subject: [PATCH 3/4] add netbsd ci --- .github/workflows/libloading.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/libloading.yml b/.github/workflows/libloading.yml index f23748042..22790d4fa 100644 --- a/.github/workflows/libloading.yml +++ b/.github/workflows/libloading.yml @@ -69,7 +69,28 @@ jobs: cargo test --release -- --nocapture cargo test --no-default-features -- --nocapture cargo test --release --no-default-features -- --nocapture - + + netbsd-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: test netbsd + uses: cross-platform-actions/action@v0.29.0 + with: + memory: 1024M + operating_system: netbsd + version: '10.1' + run: | + uname -a + echo "SETUP RUST" + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + . "$HOME/.cargo/env" + echo "RUNNING TESTS" + cargo test --verbose --release + cargo test -- --nocapture + cargo test --release -- --nocapture + cargo test --no-default-features -- --nocapture + cargo test --release --no-default-features -- --nocapture windows-test: runs-on: windows-latest From 8fca5046e10dbfeb32ed006e8d1c418e8f7a2376 Mon Sep 17 00:00:00 2001 From: Alexander Schuetz Date: Thu, 6 Nov 2025 17:18:38 +0100 Subject: [PATCH 4/4] disable segfaulting tests on netbsd, reduce test threads on netbsd to 1. --- .github/workflows/libloading.yml | 11 ++++++----- tests/functions.rs | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/libloading.yml b/.github/workflows/libloading.yml index 22790d4fa..74126fd71 100644 --- a/.github/workflows/libloading.yml +++ b/.github/workflows/libloading.yml @@ -70,6 +70,7 @@ jobs: cargo test --no-default-features -- --nocapture cargo test --release --no-default-features -- --nocapture +# FIXME removing --test-threads=1 causes segfault. This also occurs on real hardware with netbsd. netbsd-test: runs-on: ubuntu-latest steps: @@ -86,11 +87,11 @@ jobs: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y . "$HOME/.cargo/env" echo "RUNNING TESTS" - cargo test --verbose --release - cargo test -- --nocapture - cargo test --release -- --nocapture - cargo test --no-default-features -- --nocapture - cargo test --release --no-default-features -- --nocapture + cargo test --verbose --release -- --test-threads=1 + cargo test -- --nocapture --test-threads=1 + cargo test --release -- --nocapture --test-threads=1 + cargo test --no-default-features -- --nocapture --test-threads=1 + cargo test --release --no-default-features -- --nocapture --test-threads=1 windows-test: runs-on: windows-latest diff --git a/tests/functions.rs b/tests/functions.rs index 6f4fc2755..ea80a63de 100644 --- a/tests/functions.rs +++ b/tests/functions.rs @@ -349,6 +349,7 @@ fn test_static_ptr() { // Cygwin returns errors on `close`. #[cfg(not(target_os = "cygwin"))] #[cfg(feature = "std")] +#[cfg(not(target_os = "netbsd"))] //TODO FIXME, SEGFAULTS fn manual_close_many_times() { if is_wine() { // The wine runtime to run windows programs under linux