Skip to content

Commit

Permalink
Try to fix musl build
Browse files Browse the repository at this point in the history
  • Loading branch information
milesgranger committed Sep 21, 2024
1 parent 0023e6f commit 1de60c4
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 65 deletions.
124 changes: 62 additions & 62 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,65 +33,65 @@ jobs:
- name: Test
run: cross test --target ${{ matrix.target }} --release

test-wasm32-emscripten:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
build: [static, shared]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
target: wasm32-unknown-emscripten

- name: Install build deps
run: sudo apt install nasm gcc-multilib

- name: Install Emscripten
uses: mymindstorm/setup-emsdk@v14

- name: Build
run: cargo build --target wasm32-unknown-emscripten --no-default-features --features ${{ matrix.build }}

test-native:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-13 # x86_64
- macos-14 # arm
- windows-latest
- ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Install nasm
if: runner.os != 'macOS'
uses: ilammy/setup-nasm@v1

- name: Set MSVC developer prompt
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1.6.0

- name: Install build deps (OSX)
if: runner.os == 'macOS'
run: brew install automake autoconf coreutils libtool nasm

- name: Test (shared)
run: cargo test --no-default-features --features shared --lib --release -vv

- name: Test (static)
run: |
cargo clean # ensure we're starting fresh, no funny business
cargo test --no-default-features --features static --release -vv
# test-wasm32-emscripten:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# build: [static, shared]
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: recursive

# - name: Install Rust toolchain
# uses: dtolnay/rust-toolchain@stable
# with:
# target: wasm32-unknown-emscripten

# - name: Install build deps
# run: sudo apt install nasm gcc-multilib

# - name: Install Emscripten
# uses: mymindstorm/setup-emsdk@v14

# - name: Build
# run: cargo build --target wasm32-unknown-emscripten --no-default-features --features ${{ matrix.build }}

# test-native:
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os:
# - macos-13 # x86_64
# - macos-14 # arm
# - windows-latest
# - ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: recursive

# - name: Install Rust toolchain
# uses: dtolnay/rust-toolchain@stable

# - name: Install nasm
# if: runner.os != 'macOS'
# uses: ilammy/setup-nasm@v1

# - name: Set MSVC developer prompt
# if: runner.os == 'Windows'
# uses: ilammy/msvc-dev-cmd@v1.6.0

# - name: Install build deps (OSX)
# if: runner.os == 'macOS'
# run: brew install automake autoconf coreutils libtool nasm

# - name: Test (shared)
# run: cargo test --no-default-features --features shared --lib --release -vv

# - name: Test (static)
# run: |
# cargo clean # ensure we're starting fresh, no funny business
# cargo test --no-default-features --features static --release -vv
7 changes: 4 additions & 3 deletions isal-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ fn main() {
let mut configure_args = vec![
format!("--prefix={}", install_path.display()),
format!("--host={}", target),
format!("--build={}", target),
format!("--enable-static={}", if is_static { "yes" } else { "no" }),
format!("--enable-shared={}", if is_shared { "yes" } else { "no" }),
];
Expand Down Expand Up @@ -96,9 +97,9 @@ fn main() {
panic!("Building isa-l failed");
}

if let Ok(true) = std::env::var("CARGO_CFG_TARGET_ENV").map(|v| v == "musl") {
println!("cargo:rustc-link-lib=gcc");
}
// if let Ok(true) = std::env::var("CARGO_CFG_TARGET_ENV").map(|v| v == "musl") {
// println!("cargo:rustc-link-lib=gcc");
// }

if cfg!(target_os = "windows") {
println!("cargo:rustc-link-search=native={}", install_path.display());
Expand Down

0 comments on commit 1de60c4

Please sign in to comment.