Skip to content

Commit

Permalink
Merge pull request #5243 from wasmerio/5198-cli-support-wasm_c_api-ba…
Browse files Browse the repository at this point in the history
…ckends-together-with-native-ones

Support multiple heterogeneous backends at the same time
  • Loading branch information
xdoardo authored Dec 3, 2024
2 parents 5790d22 + b7958a6 commit df1b18f
Show file tree
Hide file tree
Showing 295 changed files with 21,958 additions and 9,058 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ jobs:
- uses: Swatinem/rust-cache@v2
if: matrix.use_sccache != true
- name: Install LLVM (macOS Apple Silicon)
if: matrix.os == 'macos-12' && !matrix.llvm_url
if: matrix.os == 'macos-13' && !matrix.llvm_url
run: |
brew install llvm
- name: Install LLVM
Expand Down Expand Up @@ -406,7 +406,7 @@ jobs:
if: matrix.use_llvm != true && !endsWith(matrix.build, 'v8') && !endsWith(matrix.build, 'wamr') && !endsWith(matrix.build, 'wasmi')
shell: bash
run: |
make build-wasmer
ENABLE_LLVM=0 make build-wasmer
#- name: Build Wasmer binary on Wasm32-WASI without LLVM
# if: matrix.build_wasm
# shell: bash
Expand Down Expand Up @@ -517,7 +517,7 @@ jobs:

darwin_aarch64_jsc:
name: macOS aarch64 (JSC)
runs-on: macos-12
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
Expand Down Expand Up @@ -550,7 +550,7 @@ jobs:

darwin_x86_64_jsc:
name: macOS x86_64 (JSC)
runs-on: macos-12
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/cloudcompiler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ jobs:
with:
toolchain: ${{ env.MSRV }}
target: ${{ matrix.target }}
- name: Install wasm32-wasi target
- name: Install wasm32-wasip1 target
shell: bash
run: |
rustup target add wasm32-wasi
rustup target add wasm32-wasip1
- name: Setup Wasmer
uses: wasmerio/setup-wasmer@v1
- name: Build cloudcompiler.wasm
shell: bash
run: |
make build-wasmer-wasm &&
mkdir target/wasm32-wasi/release/cloudcompiler
cp target/wasm32-wasi/release/wasmer-compiler.wasm target/wasm32-wasi/release/cloudcompiler/cloudcompiler.wasm &&
cat << EOF > target/wasm32-wasi/release/cloudcompiler/wasmer.toml
mkdir target/wasm32-wasip1/release/cloudcompiler
cp target/wasm32-wasip1/release/wasmer-compiler.wasm target/wasm32-wasip1/release/cloudcompiler/cloudcompiler.wasm &&
cat << EOF > target/wasm32-wasip1/release/cloudcompiler/wasmer.toml
[package]
name = "${{ secrets.WAPM_DEV_USERNAME }}/cloudcompiler"
version = "0.1.0"
Expand All @@ -61,18 +61,18 @@ jobs:
echo $(git tag | tail -n1) > ./version.txt
v=$(git describe --tags --abbrev=0) && \
echo "version = ${v}" &&
sed -i "s/version = \".*\"/version = \"${v}\"/g" target/wasm32-wasi/release/cloudcompiler/wasmer.toml \
sed -i "s/version = \".*\"/version = \"${v}\"/g" target/wasm32-wasip1/release/cloudcompiler/wasmer.toml \
- name: Build cloudcompiler.wasm
shell: bash
run: |
git tag &&
cat target/wasm32-wasi/release/cloudcompiler/wasmer.toml &&
cat target/wasm32-wasip1/release/cloudcompiler/wasmer.toml &&
echo "ls" &&
ls target/wasm32-wasi/release/cloudcompiler
ls target/wasm32-wasip1/release/cloudcompiler
- name: Publish to WAPM
uses: wasmerio/wapm-publish@v1
with:
registry: https://registry.wapm.dev
directory: target/wasm32-wasi/release/cloudcompiler
directory: target/wasm32-wasip1/release/cloudcompiler
username: ${{ secrets.WAPM_DEV_USERNAME }}
password: ${{ secrets.WAPM_DEV_PASSWORD }}
90 changes: 31 additions & 59 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs:
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
targets: "wasm32-wasi"
targets: "wasm32-wasip1"
- name: Install wasm-pack
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
Expand Down Expand Up @@ -207,8 +207,8 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: rustup target add wasm32-wasi
run: rustup target add wasm32-wasi
- name: rustup target add wasm32-wasip1
run: rustup target add wasm32-wasip1
- name: make build-wasmer-wasm
run: make build-wasmer-wasm

Expand Down Expand Up @@ -263,10 +263,10 @@ jobs:
build: macos-arm,
os: macos-14,
},
{
build: windows-x64,
os: windows-2022,
}
#{
# build: windows-x64,
# os: windows-2022,
#}
]
container: ${{ matrix.metadata.container }}
steps:
Expand All @@ -283,17 +283,19 @@ jobs:
- name: Install Nextest
uses: taiki-e/install-action@nextest

- name: Install `ninja`, clang` and `mold` on Ubuntu
- name: Install `ninja`, clang`, `binutils` and `mold` on Ubuntu
if: startsWith(matrix.metadata.build, 'linux-')
shell: bash
run: |
sudo apt-get update -y && sudo apt-get install ninja-build clang mold -y
sudo apt-get update -y && sudo apt-get install ninja-build clang mold binutils -y
- name: Install `ninja` on macOS
- name: Install `ninja` and (brew's) `llvm` on macOS
if: startsWith(matrix.metadata.build, 'macos-')
shell: bash
run: |
brew install ninja
brew install ninja llvm@18
echo "/opt/homebrew/opt/llvm@18/bin" >> $GITHUB_PATH
ls -laR /opt/homebrew/opt/llvm@18/bin/
- name: Install `ninja` on Windows
if: startsWith(matrix.metadata.build, 'windows-')
Expand All @@ -308,7 +310,7 @@ jobs:

- name: Test WAMR API
if: ${{ matrix.build-what.key == 'wamr' }}
run: ${{ matrix.build-what.build-cmd }}
run: echo $GITHUB_PATH && ${{ matrix.build-what.build-cmd }}

- name: Test wasmi API
if: ${{ matrix.build-what.key == 'wasmi' }}
Expand Down Expand Up @@ -500,7 +502,7 @@ jobs:
},
{
build: macos-x64,
os: macos-12,
os: macos-13,
target: x86_64-apple-darwin,
exe: '',
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz'
Expand Down Expand Up @@ -560,7 +562,7 @@ jobs:
# using gnu-tar is a workaround for https://github.com/actions/cache/issues/403
brew install gnu-tar
echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
if: matrix.metadata.os == 'macos-12'
if: matrix.metadata.os == 'macos-13'
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
Expand Down Expand Up @@ -608,7 +610,7 @@ jobs:
mkdir -p package/winsdk
cp -r /tmp/winsdk/* package/winsdk
- name: Install LLVM (macOS Apple Silicon)
if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url
if: matrix.metadata.os == 'macos-13' && !matrix.metadata.llvm_url
run: |
brew install llvm
- name: Install LLVM
Expand Down Expand Up @@ -754,7 +756,7 @@ jobs:
},
{
build: macos-x64,
os: macos-12,
os: macos-13,
target: x86_64-apple-darwin,
exe: '',
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz'
Expand Down Expand Up @@ -815,7 +817,7 @@ jobs:
# using gnu-tar is a workaround for https://github.com/actions/cache/issues/403
brew install gnu-tar
echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
if: matrix.metadata.os == 'macos-12'
if: matrix.metadata.os == 'macos-13'
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
Expand All @@ -824,9 +826,10 @@ jobs:
- name: Install Nextest
uses: taiki-e/install-action@nextest
- name: Install LLVM (macOS Apple Silicon)
if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url
if: matrix.metadata.os == 'macos-13' && !matrix.metadata.llvm_url
run: |
brew install llvm
echo "/opt/homebrew/opt/llvm/bin" >> GITHUB_PATH
- name: Install LLVM
shell: bash
if: matrix.metadata.llvm_url
Expand Down Expand Up @@ -891,11 +894,11 @@ jobs:
target: x86_64-unknown-linux-gnu
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz'
- build: macos-x64
os: macos-12
os: macos-13
target: x86_64-apple-darwin
# we only build the integration-test CLI, we don't run tests
- build: macos-arm
os: macos-12
os: macos-14
target: aarch64-apple-darwin,
- build: linux-musl
target: x86_64-unknown-linux-musl
Expand Down Expand Up @@ -1096,47 +1099,16 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: wasmer-cli-linux-x64
- name: Cargo Registry Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/advisory-db
~/.cargo/git
~/.cargo/registry
key: cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cargo target cache
uses: actions/cache@v3
with:
path: |
target/
key: cargo-release-${{ hashFiles('**/Cargo.lock') }}
- uses: wasmerio/setup-wasmer@v2
- uses: denoland/setup-deno@v1
- run: |
# install rust toolchain
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. "$HOME/.cargo/env"
# add wasmer cli to PATH
tar -xzf build-wasmer.tar.gz
docker build -t tmp .
docker run -v $PWD:/app -w /app tmp bash -c " \
cp ./bin/wasmer /root/.wasmer/bin/wasmer &&\
export MYSQL_HOST='${{ vars.INTEGRATION_TEST_MYSQL_HOST }}' &&\
export MYSQL_DBNAME='${{ vars.INTEGRATION_TEST_MYSQL_DBNAME }}' &&\
export MYSQL_USERNAME='${{ secrets.INTEGRATION_TEST_MYSQL_USERNAME }}' &&\
export MYSQL_PASSWORD='${{ secrets.INTEGRATION_TEST_MYSQL_PASSWORD }}' &&\
export MYSQL_PORT='${{ vars.INTEGRATION_TEST_MYSQL_PORT }}' &&\
export MYSQL_CERT='${{ secrets.INTEGRATION_TEST_MYSQL_CERT }}' &&\
export PG_HOST='${{ vars.INTEGRATION_TEST_PG_HOST }}' &&\
export PG_DBNAME='${{ vars.INTEGRATION_TEST_PG_DBNAME }}' &&\
export PG_USERNAME='${{ secrets.INTEGRATION_TEST_PG_USERNAME }}' &&\
export PG_PASSWORD='${{ secrets.INTEGRATION_TEST_PG_PASSWORD }}' &&\
export PG_PORT='${{ vars.INTEGRATION_TEST_PG_PORT }}' &&\
wasmer config set registry.url https://registry.wasmer.io/graphql &&\
wasmer login '${{ secrets.WAPM_PROD_TOKEN }}' &&\
wasmer config set registry.url https://registry.wasmer.wtf/graphql &&\
wasmer login '${{ secrets.WAPM_DEV_TOKEN }}' &&\
cargo test --no-fail-fast"
cp ./bin/wasmer ~/.wasmer/bin/wasmer
- name: test
env:
WASMER_REGISTRY: https://registry.wasmer.wtf/graphql
WASMER_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }}
run: deno test --allow-all --parallel
- name: notify failure in slack
if: failure()
run: |
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Looking for changes that affect our C API? See the [C API Changelog](lib/c-api/C

## **Unreleased**

## 5.0.2 - 22/11/2024

This release mostly consists of bug fixes and clean ups.
## 5.1.0 - 22/11/2024

## Added
Expand All @@ -31,6 +34,7 @@ Looking for changes that affect our C API? See the [C API Changelog](lib/c-api/C

## Fixed

- [#5268](https://github.com/wasmerio/wasmer/pull/5268) Fix musl builds
- [#5231](https://github.com/wasmerio/wasmer/pull/5231) Fix LLVM detection
- [#5235](https://github.com/wasmerio/wasmer/pull/5235) c-api/README.md: Fix double include in usage section
- [#5238](https://github.com/wasmerio/wasmer/pull/5238) Revert "Fix handling of the root dir in `path_create_directory` and `get_inode_at_path_inner`"
Expand Down
Loading

0 comments on commit df1b18f

Please sign in to comment.