diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9a3dfc56f50..b24a907edca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -102,6 +102,11 @@ jobs: with: toolchain: 1.64 target: ${{ matrix.target }} + - name: Install Rust nightly (to build capi-headless) + uses: dtolnay/rust-toolchain@stable + with: + toolchain: nightly + target: ${{ matrix.metadata.target }} - uses: Swatinem/rust-cache@v1 if: matrix.use_sccache != true - name: Install LLVM (macOS Apple Silicon) @@ -273,6 +278,11 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: target: x86_64-pc-windows-gnu + - name: Install Rust nightly (to build capi-headless) + uses: dtolnay/rust-toolchain@stable + with: + toolchain: nightly + target: x86_64-pc-windows-gnu - name: Install Windows-GNU target shell: bash run: | @@ -301,9 +311,19 @@ jobs: - name: Build Wasmer C-API without LLVM shell: bash run: | - cargo build --release --target x86_64-pc-windows-gnu --manifest-path lib/c-api/Cargo.toml --no-default-features --features wat,compiler,wasi,middlewares,webc_runner --features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load + make build-capi + env: + RUSTFLAGS: -Cpanic=abort + CARGO_TARGET: x86_64-pc-windows-gnu + ENABLE_LLVM: 0 + - name: Build Wasmer C-API headless without LLVM + shell: bash + run: | + make build-capi-headless env: RUSTFLAGS: -Cpanic=abort + CARGO_TARGET: x86_64-pc-windows-gnu + ENABLE_LLVM: 0 - name: Dist run: | make distribution-gnu diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b8e25e5f455..87a339e197e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -263,6 +263,11 @@ jobs: with: toolchain: 1.64 target: ${{ matrix.metadata.target }} + - name: Install Rust nightly (to build capi-headless) + uses: dtolnay/rust-toolchain@stable + with: + toolchain: nightly + target: ${{ matrix.metadata.target }} - name: Install Windows-GNU linker if: ${{ matrix.metadata.build == 'windows-gnu' }} shell: bash diff --git a/Makefile b/Makefile index 0038e4fd6db..5a2f6b8ed2d 100644 --- a/Makefile +++ b/Makefile @@ -617,6 +617,8 @@ ifeq ($(IS_DARWIN), 1) endif endif +package-capi-headless: build-capi-headless package-capi + package-capi: mkdir -p "package/include" mkdir -p "package/lib" @@ -695,39 +697,13 @@ package-capi: cp target/$(HOST_TARGET)/release/libwasmer.a package/lib/libwasmer.a ;\ fi -package-capi-headless: build-capi-headless - mkdir -p "package/include" - mkdir -p "package/lib" - cp lib/c-api/wasmer.h* package/include - cp lib/c-api/wasmer_wasm.h* package/include - cp lib/c-api/wasm.h* package/include - cp lib/c-api/README.md package/include/README.md - - if [ -f $(TARGET_DIR)/wasmer.dll ]; then \ - cp $(TARGET_DIR)/wasmer.dll package/lib/wasmer-headless.dll ;\ - fi - if [ -f $(TARGET_DIR)/wasmer.lib ]; then \ - cp $(TARGET_DIR)/wasmer.lib package/lib/wasmer-headless.lib ;\ - fi - - if [ -f $(TARGET_DIR)/libwasmer.dylib ]; then \ - cp $(TARGET_DIR)/libwasmer.dylib package/lib/libwasmer-headless.dylib ;\ - fi - - if [ -f $(TARGET_DIR)/libwasmer.so ]; then \ - cp $(TARGET_DIR)/libwasmer.so package/lib/libwasmer-headless.so ;\ - fi - if [ -f $(TARGET_DIR)/libwasmer.a ]; then \ - cp $(TARGET_DIR)/libwasmer.a package/lib/libwasmer-headless.a ;\ - fi - package-docs: build-docs build-docs-capi mkdir -p "package/docs/crates" cp -R target/doc/ package/docs/crates echo '' > package/docs/index.html echo '' > package/docs/crates/index.html -package: package-wasmer package-minimal-headless-wasmer package-capi package-capi-headless +package: package-wasmer package-minimal-headless-wasmer package-capi tar-capi: ls -R package