From f895026eee1f674d7ddc47b4f22871ce2da78b5d Mon Sep 17 00:00:00 2001 From: Lilith River Date: Tue, 21 Jan 2025 16:01:57 -0700 Subject: [PATCH] ci: sed imageflow_abi/Cargo.toml since target doesn't work --- .github/workflows/ci.yml | 9 +++++++++ imageflow_abi/Cargo.toml | 14 ++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96548bdd3..736c15ae8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -235,6 +235,15 @@ jobs: echo "DEBUG=False" >> $GITHUB_ENV echo "TARGET_CPU=${{ matrix.target-cpu }}" >> $GITHUB_ENV + - if: contains(matrix.target, 'musl') + name: "Edit imageflow_abi/Cargo.toml to build staticlib instead of cdylib and use strip and lto" + run: | + echo "Editing imageflow_abi/Cargo.toml to replace the string "["cdylib"]" with "["staticlib"]"" + sed -i 's/\["cdylib"\]/\["staticlib"\]/g' imageflow_abi/Cargo.toml + echo "Editing to remove all instances of '# enable on musl: ' + sed -i '/# enable on musl:/d' imageflow_abi/Cargo.toml + echo "Finished editing imageflow_abi/Cargo.toml: " + cat imageflow_abi/Cargo.toml # ---------------------------------------------------------------------------- # Test steps (like in both test_ci and release_ci). # For cross and WOA, special steps are used, otherwise normal cargo test. diff --git a/imageflow_abi/Cargo.toml b/imageflow_abi/Cargo.toml index ed36131b9..3a862fc78 100644 --- a/imageflow_abi/Cargo.toml +++ b/imageflow_abi/Cargo.toml @@ -10,19 +10,13 @@ edition = "2021" name = "imageflow" doc = true # Default crate type for non-musl targets -crate-type = ["cdylib"] +crate-type = ["staticlib"] doctest = false -# Specify the exact musl target triple -[target.'x86_64-unknown-linux-musl'] -crate-type = ["staticlib"] -strip = true -lto = true +[profile.release] +# enable on musl: strip = true +# enable on musl: lto = true -[target.'aarch64-unknown-linux-musl'] -crate-type = ["staticlib"] -strip = true -lto = true [dependencies]