Skip to content

Commit b3d7a25

Browse files
committed
see what happens if we move the flag to the script
1 parent 35b3f35 commit b3d7a25

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

.github/workflows/turborepo-library-release.yml

-14
Original file line numberDiff line numberDiff line change
@@ -114,21 +114,7 @@ jobs:
114114
run: ${{ matrix.settings.setup }}
115115
if: ${{ matrix.settings.setup }}
116116

117-
# For x86_64-unknown-linux-gnu and aarch64-unknown-linux-gnu, we need to cross-compile with zig
118-
# Fortunately, napi comes with a `--zig` flag
119-
- name: Build native library (cross-compile with zig)
120-
if: ${{ matrix.settings.target == 'x86_64-unknown-linux-gnu' || matrix.settings.target == 'aarch64-unknown-linux-gnu' }}
121-
# For some reason PATH modifications from Setup toolchain aren't populated
122-
# when using the nodejs-rust alpine container.
123-
run: |
124-
export PATH=/usr/local/cargo/bin/rustup:/root/.cargo/bin:${PATH}
125-
cd packages/turbo-repository
126-
${{ matrix.settings.rust_env }} pnpm build:release --target=${{ matrix.settings.target }} --zig
127-
128117
- name: Build native library
129-
if: ${{ matrix.settings.target != 'x86_64-unknown-linux-gnu' && matrix.settings.target != 'aarch64-unknown-linux-gnu' }}
130-
# For some reason PATH modifications from Setup toolchain aren't populated
131-
# when using the nodejs-rust alpine container.
132118
run: |
133119
export PATH=/usr/local/cargo/bin/rustup:/root/.cargo/bin:${PATH}
134120
cd packages/turbo-repository

packages/turbo-repository/scripts/build.sh

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ for flag in $user_provided_flags; do
1414
if [[ $flag == --target=* ]]; then
1515
target=${flag#*=}
1616
rustup target add "$target"
17+
18+
# For we need to cross-compile some targets with Zig
19+
# Fortunately, napi comes with a `--zig` flag
20+
if [[ $target == x86_64-unknown-linux-gnu || $target == aarch64-unknown-linux-gnu ]]; then
21+
script_provided_flags+=" --zig"
22+
fi
1723
fi
1824
done
1925

0 commit comments

Comments
 (0)