Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build): rename rust target wasm32-wasi to wasm32-wasip1 #13708

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading