diff --git a/.github/actions/build-upstream/action.yml b/.github/actions/build-upstream/action.yml index 81a6c65a6c..5f64304ad0 100644 --- a/.github/actions/build-upstream/action.yml +++ b/.github/actions/build-upstream/action.yml @@ -184,7 +184,10 @@ runs: - name: Build trampoline shim binary (Windows only) if: steps.native.outputs.build == 'true' && contains(inputs.target, 'windows') shell: bash - run: node packages/tools/src/build-trampoline.ts --release --target "${INPUTS_TARGET}" + # The standalone trampoline keeps its own size-optimized Cargo profile. + run: | + env -u CARGO_PROFILE_RELEASE_LTO -u CARGO_PROFILE_RELEASE_CODEGEN_UNITS \ + node packages/tools/src/build-trampoline.ts --release --target "${INPUTS_TARGET}" env: INPUTS_TARGET: ${{ inputs.target }} diff --git a/.github/actions/build-windows-cli/action.yml b/.github/actions/build-windows-cli/action.yml index 5689767dbf..dc97f1dd12 100644 --- a/.github/actions/build-windows-cli/action.yml +++ b/.github/actions/build-windows-cli/action.yml @@ -91,7 +91,10 @@ runs: - name: Build trampoline shim binary if: steps.binaries-cache.outputs.cache-hit != 'true' shell: bash - run: node packages/tools/src/build-trampoline.ts --xwin --release --target x86_64-pc-windows-msvc + # The standalone trampoline keeps its own size-optimized Cargo profile. + run: | + env -u CARGO_PROFILE_RELEASE_LTO -u CARGO_PROFILE_RELEASE_CODEGEN_UNITS \ + node packages/tools/src/build-trampoline.ts --xwin --release --target x86_64-pc-windows-msvc env: XWIN_ACCEPT_LICENSE: '1' diff --git a/.github/actions/compute-native-cache-input-hash/action.yml b/.github/actions/compute-native-cache-input-hash/action.yml index e0e0ba9a62..530b413bed 100644 --- a/.github/actions/compute-native-cache-input-hash/action.yml +++ b/.github/actions/compute-native-cache-input-hash/action.yml @@ -13,7 +13,9 @@ runs: id: compute shell: bash run: | - echo "hash=$NATIVE_CACHE_INPUT_HASH" >> "$GITHUB_OUTPUT" + # Test builds and published builds must never share native binaries. + profile="${CARGO_PROFILE_RELEASE_LTO:-manifest}-${CARGO_PROFILE_RELEASE_CODEGEN_UNITS:-manifest}" + echo "hash=${NATIVE_CACHE_INPUT_HASH}-${profile}" >> "$GITHUB_OUTPUT" env: # crates/vp_cli_snapshots is excluded: the snapshot suite (runner, # vpt, fixtures, recorded .md baselines) never feeds the native diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d46a9fe600..4172b466fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,6 +65,10 @@ jobs: permissions: contents: read packages: read + # Test native code without whole-program optimization. + env: + CARGO_PROFILE_RELEASE_LTO: 'off' + CARGO_PROFILE_RELEASE_CODEGEN_UNITS: '16' steps: - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 - uses: ./.github/actions/clone @@ -373,6 +377,10 @@ jobs: if: needs.detect-changes.outputs.code-changed == 'true' name: Build Windows CLI binaries runs-on: namespace-profile-linux-x64-default + # Test native code without whole-program optimization. + env: + CARGO_PROFILE_RELEASE_LTO: 'off' + CARGO_PROFILE_RELEASE_CODEGEN_UNITS: '16' steps: - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 - uses: ./.github/actions/clone @@ -946,6 +954,10 @@ jobs: - os: namespace-profile-mac-default target: aarch64-apple-darwin runs-on: ${{ matrix.os }} + # Test native code without whole-program optimization. + env: + CARGO_PROFILE_RELEASE_LTO: 'off' + CARGO_PROFILE_RELEASE_CODEGEN_UNITS: '16' steps: - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 - uses: ./.github/actions/clone @@ -1301,6 +1313,10 @@ jobs: needs: - download-previous-rolldown-binaries runs-on: namespace-profile-linux-x64-default + # Test native code without whole-program optimization. + env: + CARGO_PROFILE_RELEASE_LTO: 'off' + CARGO_PROFILE_RELEASE_CODEGEN_UNITS: '16' steps: - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 - uses: ./.github/actions/clone diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 2c1465fed1..acf8584a10 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -80,6 +80,10 @@ jobs: permissions: contents: read packages: read + # Test native code without whole-program optimization. + env: + CARGO_PROFILE_RELEASE_LTO: 'off' + CARGO_PROFILE_RELEASE_CODEGEN_UNITS: '16' steps: - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 - uses: ./.github/actions/clone diff --git a/.github/workflows/reusable-ecosystem-ci.yml b/.github/workflows/reusable-ecosystem-ci.yml index 097aa76cc6..15b527cdbe 100644 --- a/.github/workflows/reusable-ecosystem-ci.yml +++ b/.github/workflows/reusable-ecosystem-ci.yml @@ -29,6 +29,10 @@ jobs: permissions: contents: read packages: read + # Test native code without whole-program optimization. + env: + CARGO_PROFILE_RELEASE_LTO: 'off' + CARGO_PROFILE_RELEASE_CODEGEN_UNITS: '16' steps: - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 - uses: ./.github/actions/clone diff --git a/.github/workflows/test-vp-create.yml b/.github/workflows/test-vp-create.yml index 1e4dc124cf..3dc776367d 100644 --- a/.github/workflows/test-vp-create.yml +++ b/.github/workflows/test-vp-create.yml @@ -65,6 +65,10 @@ jobs: build: name: Build vite-plus packages runs-on: namespace-profile-linux-x64-default + # Match the CLI build profile to reuse its native and Cargo caches. + env: + CARGO_PROFILE_RELEASE_LTO: 'off' + CARGO_PROFILE_RELEASE_CODEGEN_UNITS: '16' permissions: contents: read packages: read