diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a4ec94..a16df90 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,9 +40,9 @@ jobs: matrix: include: - os: ubuntu - cargoargs: --features build-llvm + cargoargs: --features build-llvm jemalloc - os: macos - cargoargs: --features build-cranelift + cargoargs: --features build-cranelift jemalloc - os: windows cargoargs: --features build-cranelift @@ -83,14 +83,14 @@ jobs: run: echo "COMPILED_RUNNERS=compiled_runners" >> $GITHUB_ENV shell: bash - - if: matrix.os == 'macos' && matrix.cargoargs == '--features build-llvm' + - if: matrix.os == 'macos' && contains(matrix.cargoargs, 'build-llvm') run: | brew install llvm@12 echo "LLVM_SYS_120_PREFIX=$(brew --prefix llvm)" >> $GITHUB_ENV echo 'LDFLAGS="-L/usr/local/opt/llvm@12/lib"' >> $GITHUB_ENV echo 'CPPFLAGS="-I/usr/local/opt/llvm@12/include"' >> $GITHUB_ENV - - if: matrix.os == 'ubuntu' && matrix.cargoargs == '--features build-llvm' + - if: matrix.os == 'ubuntu' && contains(matrix.cargoargs, 'build-llvm') run: | wget --no-check-certificate -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - sudo add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-12 main' -y diff --git a/Cargo.toml b/Cargo.toml index ce09daf..ca21d99 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,12 +52,13 @@ termcolor = "1.4" textwrap = { version = "0.16", default-features = false } sentry = "0.32.2" -jemallocator = "0.5.4" +jemallocator = { version = "0.5.4", optional = true } [features] -default = ["build-cranelift"] +default = ["build-cranelift", "jemallocator"] build-cranelift = ["wasmer-compiler-cranelift"] build-llvm = ["wasmer-compiler-llvm", "inkwell", "llvm-sys-120"] +jemalloc = ["jemallocator"] [build-dependencies] wasmer = { version = "2.0", default-features = false, features = ["universal"] } diff --git a/src/main.rs b/src/main.rs index 085ecbc..0401fb7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,6 +26,7 @@ mod api; mod display; mod server; +#[cfg(feature = "jemalloc")] #[global_allocator] static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;