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: explicitly set rust toolchain channel #5177

Merged
merged 9 commits into from
Oct 7, 2023
35 changes: 23 additions & 12 deletions .github/workflows/build-and-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,57 +59,66 @@ jobs:
target: x86_64-pc-windows-msvc
name: wasm
is-wasm-build: true
build: npm run build:wasm
build: |-
set -e &&
rustup target add wasm32-unknown-unknown &&
npm run build:wasm
path: |
wasm/
.empty
- host: windows-latest
target: x86_64-pc-windows-msvc
name: wasm-node
is-wasm-build: true
build: npm run build:wasm:node
build: |-
set -e &&
rustup target add wasm32-unknown-unknown &&
npm run build:wasm:node
path: |
wasm-node/
.empty
- host: macos-latest
target: x86_64-apple-darwin
build: |
npm run build:napi -- --release
set -e &&
npm run build:napi -- --release &&
strip -x *.node
- host: windows-latest
build: npm run build:napi -- --release
target: x86_64-pc-windows-msvc
- host: windows-latest
build: |
set -e &&
rustup target add i686-pc-windows-msvc &&
npm run build:napi -- --release --target i686-pc-windows-msvc
target: i686-pc-windows-msvc
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
build: |-
set -e &&
rustup default nightly &&
rustup target add x86_64-unknown-linux-gnu &&
npm run build:napi -- --release --target x86_64-unknown-linux-gnu &&
strip *.node
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: |-
set -e &&
rustup default nightly &&
npm run build:napi -- --release && strip *.node
- host: macos-latest
target: aarch64-apple-darwin
build: |
npm run build:napi -- --release --target aarch64-apple-darwin
set -e &&
rustup target add aarch64-apple-darwin &&
npm run build:napi -- --release --target aarch64-apple-darwin &&
strip -x *.node
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
build: |-
set -e &&
export JEMALLOC_SYS_WITH_LG_PAGE=16 &&
rustup default nightly &&
rustup target add aarch64-unknown-linux-gnu &&
npm run build:napi -- --release --target aarch64-unknown-linux-gnu &&
aarch64-unknown-linux-gnu-strip *.node
Expand All @@ -120,25 +129,27 @@ jobs:
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf -y
build: |
npm run build:napi -- --release --target armv7-unknown-linux-gnueabihf
set -e &&
npm run build:napi -- --release --target armv7-unknown-linux-gnueabihf &&
arm-linux-gnueabihf-strip *.node
- host: ubuntu-latest
target: aarch64-linux-android
build: |
npm run build:napi -- --release --target aarch64-linux-android
set -e &&
npm run build:napi -- --release --target aarch64-linux-android &&
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node
- host: ubuntu-latest
target: armv7-linux-androideabi
build: |
npm run build:napi -- --release --target armv7-linux-androideabi
set -e &&
npm run build:napi -- --release --target armv7-linux-androideabi &&
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node
- host: ubuntu-latest
target: aarch64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: >-
set -e &&
export JEMALLOC_SYS_WITH_LG_PAGE=16 &&
rustup default nightly &&
rustup target add aarch64-unknown-linux-musl &&
RUSTFLAGS='-C target-feature=-crt-static -C linker=aarch64-linux-musl-gcc' npm run build:napi -- --release --target aarch64-unknown-linux-musl &&
/aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node
Expand All @@ -160,7 +171,7 @@ jobs:
uses: dtolnay/rust-toolchain@stable
if: ${{ !matrix.settings.docker }}
with:
toolchain: nightly
toolchain: nightly-2023-10-05
targets: ${{ matrix.settings.target }}
- name: Cache cargo
uses: actions/cache@v3
Expand Down
5 changes: 5 additions & 0 deletions rust/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[toolchain]
profile = "default"
# Use nightly for better access to the latest Rust features.
# This date is aligned to stable release dates.
channel = "nightly-2023-10-05"