Skip to content

Commit

Permalink
chore: fix turborepo-repository MUSL release (#8028)
Browse files Browse the repository at this point in the history
### Description

Changes:
- Upgrade `curl` version to avoid
alpinelinux/docker-alpine#383
- Do `PATH` alterations in build step as for some reason the alpine
container doesn't respect alterations from previous steps.
- Remove `rustup toolchain install` commands as this would require
parsing TOML to extract the Rust version we want. Instead we rely on the
behavior of `rustup show` which will install the toolchain override if
it isn't installed yet.

### Testing Instructions

Dry run: https://github.com/vercel/turbo/actions/runs/8808289531


Closes TURBO-2869
  • Loading branch information
chris-olszewski committed Apr 24, 2024
1 parent ef3b09b commit e63b1a8
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/turborepo-library-release.yml
Expand Up @@ -45,24 +45,30 @@ jobs:
target: "x86_64-unknown-linux-musl"
container: ghcr.io/napi-rs/napi-rs/nodejs-rust:stable-2023-09-17-alpine
install: |
apk update && apk upgrade
apk add libc6-compat curl
echo /root/.cargo/bin >> ${GITHUB_PATH}
echo /usr/local/cargo/bin/rustup >> ${GITHUB_PATH}
setup: |
export PATH=/usr/local/cargo/bin/rustup:/root/.cargo/bin:${PATH}
rustup show active-toolchain
dirname $(rustup which cargo) >> ${GITHUB_PATH}
pnpm install
- host: ubuntu-latest
target: "aarch64-unknown-linux-musl"
container: ghcr.io/napi-rs/napi-rs/nodejs-rust:stable-2023-09-17-alpine
install: |
apk update && apk upgrade
apk add libc6-compat curl
echo /root/.cargo/bin >> ${GITHUB_PATH}
echo /usr/local/cargo/bin/rustup >> ${GITHUB_PATH}
echo /aarch64-linux-musl-cross/bin >> ${GITHUB_PATH}
export PATH=/aarch64-linux-musl-cross/bin:/usr/local/cargo/bin/rustup:/root/.cargo/bin:${PATH}
setup: |
export PATH=/aarch64-linux-musl-cross/bin:/usr/local/cargo/bin/rustup:/root/.cargo/bin:${PATH}
rustup default $(cat ./rust-toolchain)-aarch64-unknown-linux-musl
rustup show active-toolchain
rustup target add aarch64-unknown-linux-musl
rustup toolchain install $(cat ./rust-toolchain)
dirname $(rustup which cargo) >> ${GITHUB_PATH}
pnpm install
rust_env: CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc RUSTFLAGS="-Ctarget-feature=-crt-static"

Expand Down Expand Up @@ -103,7 +109,10 @@ jobs:
if: ${{ matrix.settings.setup }}

- name: Build native library
# For some reason PATH modifications from Setup toolchain aren't populated
# when using the nodejs-rust alpine container.
run: |
export PATH=/usr/local/cargo/bin/rustup:/root/.cargo/bin:${PATH}
cd packages/turbo-repository
${{ matrix.settings.rust_env }} pnpm build:release --target=${{ matrix.settings.target }}
Expand Down

0 comments on commit e63b1a8

Please sign in to comment.