Skip to content

Commit

Permalink
chore(build): rename rust target wasm32-wasi to wasm32-wasip1 (#13708)
Browse files Browse the repository at this point in the history
  • Loading branch information
flrgh authored Jan 10, 2025
1 parent 3e1faac commit 1903d97
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
24 changes: 17 additions & 7 deletions .github/actions/build-wasm-test-filters/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,17 @@ runs:
echo "WASM_FILTER_PATH=$WASM_FILTER_PATH" >> $GITHUB_ENV
echo "WASM_FIXTURE_PATH=$WASM_FILTER_PATH/build" >> $GITHUB_ENV
echo "WASM_FILTER_CARGO_LOCK=$WASM_FILTER_PATH/Cargo.lock" >> $GITHUB_ENV
echo "WASM_FILTER_CACHE_PREFIX=wasm-test-filters::v3::${{ runner.os }}" >> $GITHUB_ENV
echo "WASM_FILTER_TARGET=wasm32-wasip1" >> "$GITHUB_ENV"
- name: Setup cache key
shell: bash
env:
FILE_HASH: "${{ hashFiles(env.WASM_FILTER_CARGO_LOCK, format('{0}/**/*.rs', env.WASM_FILTER_PATH)) }}"
CACHE_VERSION: "4"
run: |
CACHE_PREFIX="wasm-test-filters::v${CACHE_VERSION}::${{ runner.os }}::${WASM_FILTER_TARGET}"
echo "CACHE_PREFIX=${CACHE_PREFIX}" >> $GITHUB_ENV
echo "CACHE_KEY=${CACHE_PREFIX}::${FILE_HASH}" >> $GITHUB_ENV
- name: Restore Cache
uses: actions/cache/restore@v4
Expand All @@ -26,8 +36,8 @@ runs:
~/.cargo/registry/cache/
~/.cargo/git/db/
${{ env.WASM_FILTER_PATH }}/target
key: ${{ env.WASM_FILTER_CACHE_PREFIX }}::${{ hashFiles(env.WASM_FILTER_CARGO_LOCK, format('{0}/**/*.rs', env.WASM_FILTER_PATH)) }}
restore-keys: ${{ env.WASM_FILTER_CACHE_PREFIX }}
key: ${{ env.CACHE_KEY }}
restore-keys: ${{ env.CACHE_PREFIX }}

- name: Install Rust Toolchain
if: steps.restore-cache.outputs.cache-hit != 'true'
Expand All @@ -37,7 +47,7 @@ runs:
toolchain: stable
override: true
components: cargo
target: wasm32-wasi
target: ${{ env.WASM_FILTER_TARGET }}

- name: cargo build
if: steps.restore-cache.outputs.cache-hit != 'true'
Expand All @@ -50,7 +60,7 @@ runs:
--manifest-path "${{ env.WASM_FILTER_PATH }}/Cargo.toml"
--workspace
--lib
--target wasm32-wasi
--target "${{ env.WASM_FILTER_TARGET }}"
--release
- name: Save cache
Expand All @@ -64,14 +74,14 @@ runs:
~/.cargo/registry/cache/
~/.cargo/git/db/
${{ env.WASM_FILTER_PATH }}/target
key: ${{ env.WASM_FILTER_CACHE_PREFIX }}::${{ hashFiles(env.WASM_FILTER_CARGO_LOCK, format('{0}/**/*.rs', env.WASM_FILTER_PATH)) }}
key: ${{ env.CACHE_KEY }}

- name: Create a symlink to the target directory
shell: bash
run: |
ln -sfv \
--no-target-directory \
"${{ env.WASM_FILTER_PATH }}"/target/wasm32-wasi/release \
"${{ env.WASM_FILTER_PATH }}"/target/"${{ env.WASM_FILTER_TARGET }}"/release \
"${{ env.WASM_FIXTURE_PATH }}"
- name: debug
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-wasm-test-filters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

set -euo pipefail

readonly BUILD_TARGET=wasm32-wasi
readonly BUILD_TARGET=wasm32-wasip1
readonly FIXTURE_PATH=${PWD}/spec/fixtures/proxy_wasm_filters

readonly INSTALL_ROOT=${PWD}/bazel-bin/build/${BUILD_NAME:-kong-dev}
Expand Down

1 comment on commit 1903d97

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong:1903d97469dd32875ad3ac2b96da1090c2897ed5
Artifacts available https://github.com/Kong/kong/actions/runs/12704905201

Please sign in to comment.