Unverified Commit 78ac4e2e authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Skip globally installing turbo CLI (#76532)

This aims to avoid the below error with globally installing `turbo` with
`npm` by using `pnpm dlx` the same as we are for the DataDog CLI.

```sh
Run npm i -g turbo@2.3.3 && node ./scripts/pull-turbo-cache.js x86_64-unknown-linux-musl
npm error code ENOTEMPTY
npm error syscall rename
npm error path /root/.local/share/fnm/node-versions/v[18](https://github.com/vercel/next.js/actions/runs/13537303233/job/37831195809#step:15:19).20.4/installation/lib/node_modules/turbo
```

x-ref: [slack
thread](https://vercel.slack.com/archives/C04KC8A53T7/p1740004625721209)
parent d222ece6
...@@ -146,8 +146,8 @@ jobs: ...@@ -146,8 +146,8 @@ jobs:
# --env-mode loose is a breaking change required with turbo 2.x since Strict mode is now the default # --env-mode loose is a breaking change required with turbo 2.x since Strict mode is now the default
# TODO: we should add the relevant envs later to to switch to strict mode # TODO: we should add the relevant envs later to to switch to strict mode
build: | build: |
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && corepack enable npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" && corepack enable
turbo run build-native-release -vvv --env-mode loose --remote-cache-timeout 90 --summarize -- --target x86_64-apple-darwin pnpm dlx turbo@${TURBO_VERSION} run build-native-release -vvv --env-mode loose --remote-cache-timeout 90 --summarize -- --target x86_64-apple-darwin
strip -x packages/next-swc/native/next-swc.*.node strip -x packages/next-swc/native/next-swc.*.node
- host: - host:
...@@ -159,8 +159,8 @@ jobs: ...@@ -159,8 +159,8 @@ jobs:
# --env-mode loose is a breaking change required with turbo 2.x since Strict mode is now the default # --env-mode loose is a breaking change required with turbo 2.x since Strict mode is now the default
# TODO: we should add the relevant envs later to to switch to strict mode # TODO: we should add the relevant envs later to to switch to strict mode
build: | build: |
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && corepack enable npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" && corepack enable
turbo run build-native-release -vvv --env-mode loose --remote-cache-timeout 90 --summarize -- --target aarch64-apple-darwin pnpm dlx turbo@${TURBO_VERSION} run build-native-release -vvv --env-mode loose --remote-cache-timeout 90 --summarize -- --target aarch64-apple-darwin
strip -x packages/next-swc/native/next-swc.*.node strip -x packages/next-swc/native/next-swc.*.node
- host: - host:
...@@ -172,8 +172,8 @@ jobs: ...@@ -172,8 +172,8 @@ jobs:
# TODO: we should add the relevant envs later to to switch to strict mode # TODO: we should add the relevant envs later to to switch to strict mode
build: | build: |
corepack enable corepack enable
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}"
turbo run build-native-release -vvv --env-mode loose --remote-cache-timeout 90 --summarize -- --target x86_64-pc-windows-msvc pnpm dlx turbo@${TURBO_VERSION} run build-native-release -vvv --env-mode loose --remote-cache-timeout 90 --summarize -- --target x86_64-pc-windows-msvc
target: 'x86_64-pc-windows-msvc' target: 'x86_64-pc-windows-msvc'
- host: - host:
...@@ -186,8 +186,8 @@ jobs: ...@@ -186,8 +186,8 @@ jobs:
# TODO: we should add the relevant envs later to to switch to strict mode # TODO: we should add the relevant envs later to to switch to strict mode
build: | build: |
corepack enable corepack enable
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}"
turbo run build-native-no-plugin-release -vvv --env-mode loose --remote-cache-timeout 90 --summarize -- --target aarch64-pc-windows-msvc pnpm dlx turbo@${TURBO_VERSION} run build-native-no-plugin-release -vvv --env-mode loose --remote-cache-timeout 90 --summarize -- --target aarch64-pc-windows-msvc
- host: - host:
- 'self-hosted' - 'self-hosted'
...@@ -434,7 +434,7 @@ jobs: ...@@ -434,7 +434,7 @@ jobs:
- name: Build - name: Build
# --env-mode loose is a breaking change required with turbo 2.x since Strict mode is now the default # --env-mode loose is a breaking change required with turbo 2.x since Strict mode is now the default
# TODO: we should add the relevant envs later to to switch to strict mode # TODO: we should add the relevant envs later to to switch to strict mode
run: turbo run build-wasm -vvv --env-mode loose --remote-cache-timeout 90 --summarize -- --target ${{ matrix.target }} run: pnpm dlx turbo@${TURBO_VERSION} run build-wasm -vvv --env-mode loose --remote-cache-timeout 90 --summarize -- --target ${{ matrix.target }}
- name: Add target to folder name - name: Add target to folder name
run: '[[ -d "crates/wasm/pkg" ]] && mv crates/wasm/pkg crates/wasm/pkg-${{ matrix.target }} || ls crates/wasm' run: '[[ -d "crates/wasm/pkg" ]] && mv crates/wasm/pkg crates/wasm/pkg-${{ matrix.target }} || ls crates/wasm'
......
...@@ -167,7 +167,7 @@ jobs: ...@@ -167,7 +167,7 @@ jobs:
- run: rustc --version - run: rustc --version
if: ${{ inputs.skipNativeBuild != 'yes' || inputs.needsNextest == 'yes' || inputs.needsRust == 'yes' }} if: ${{ inputs.skipNativeBuild != 'yes' || inputs.needsNextest == 'yes' || inputs.needsRust == 'yes' }}
- run: corepack prepare --activate yarn@1.22.19 && (killall turbo || echo 'no turbo') && npm i -g "turbo@${TURBO_VERSION}" "@napi-rs/cli@${NAPI_CLI_VERSION}" - run: corepack prepare --activate yarn@1.22.19 && npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}"
- name: Cache on ${{ github.ref_name }} - name: Cache on ${{ github.ref_name }}
uses: ijjk/rust-cache@turbo-cache-v1.0.8 uses: ijjk/rust-cache@turbo-cache-v1.0.8
...@@ -193,7 +193,7 @@ jobs: ...@@ -193,7 +193,7 @@ jobs:
- run: node scripts/normalize-version-bump.js - run: node scripts/normalize-version-bump.js
name: normalize versions name: normalize versions
- run: turbo run build-native-release -v --env-mode loose --remote-cache-timeout 90 --summarize -- --target ${{ inputs.buildNativeTarget }} - run: pnpm dlx turbo@${TURBO_VERSION} run build-native-release -v --env-mode loose --remote-cache-timeout 90 --summarize -- --target ${{ inputs.buildNativeTarget }}
if: ${{ inputs.skipNativeBuild != 'yes' }} if: ${{ inputs.skipNativeBuild != 'yes' }}
- name: Upload next-swc artifact - name: Upload next-swc artifact
...@@ -224,7 +224,7 @@ jobs: ...@@ -224,7 +224,7 @@ jobs:
- run: pnpm playwright install chromium - run: pnpm playwright install chromium
if: ${{ inputs.skipInstallBuild != 'yes' }} if: ${{ inputs.skipInstallBuild != 'yes' }}
- run: turbo run get-test-timings -- --build ${{ github.sha }} - run: pnpm dlx turbo@${TURBO_VERSION} run get-test-timings -- --build ${{ github.sha }}
- run: ${{ inputs.afterBuild }} - run: ${{ inputs.afterBuild }}
# defaults.run.shell sets a stronger options (`-leo pipefail`) # defaults.run.shell sets a stronger options (`-leo pipefail`)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment