Skip to content

Commit

Permalink
Merge branch 'canary' into fix/incoming-request
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi authored Feb 3, 2025
2 parents 94ad3b3 + 309092f commit eda5790
Show file tree
Hide file tree
Showing 88 changed files with 1,035 additions and 509 deletions.
12 changes: 12 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ rustflags = [

[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
# Config need to be mirrowed to .github/workflows/build_and_deploy.yml
rustflags = [
"--cfg",
"tokio_unstable",
Expand All @@ -63,5 +64,16 @@ rustflags = [
"-Clink-arg=-lgcc",
]

[target.x86_64-unknown-linux-musl]
# Config need to be mirrowed to .github/workflows/build_and_deploy.yml
rustflags = [
"--cfg",
"tokio_unstable",
"-Zshare-generics=y",
"-Zthreads=8",
"-Csymbol-mangling-version=v0",
"-Ctarget-feature=-crt-static",
]

[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"
1 change: 1 addition & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# RUN su node -c "npm install -g <your-package-list-here>"

# Enable pnpm
RUN npm i -g corepack@latest
RUN corepack enable pnpm
1 change: 1 addition & 0 deletions .github/actions/next-stats-action/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN apt install unzip wget curl nano htop screen build-essential pkg-config libs
RUN ln $(which python3) /usr/bin/python

RUN curl -sfLS https://install-node.vercel.app/v18.18.2 | bash -s -- -f
RUN npm i -g corepack@0.31
RUN corepack enable

WORKDIR /next-stats
Expand Down
27 changes: 22 additions & 5 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ jobs:
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
- run: corepack enable
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
- name: Determine deploy target
# 'force-preview' performs a full preview build but only if acknowledged i.e. workflow_dispatch
# 'automated-preview' for pushes on branches other than 'canary' for integration testing.
Expand Down Expand Up @@ -70,7 +73,10 @@ jobs:
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
- run: corepack enable
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -225,6 +231,7 @@ jobs:
rustup show &&
rustup target add x86_64-unknown-linux-musl &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" &&
export RUSTFLAGS='--cfg tokio_unstable -Zshare-generics=y -Zthreads=8 -Csymbol-mangling-version=v0 -Ctarget-feature=-crt-static' &&
cd packages/next-swc && npm run build-native-release -- --target x86_64-unknown-linux-musl &&
strip native/next-swc.*.node
Expand Down Expand Up @@ -266,6 +273,7 @@ jobs:
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" &&
rustup show &&
rustup target add aarch64-unknown-linux-musl &&
export RUSTFLAGS='--cfg tokio_unstable -Zshare-generics=y -Zthreads=8 -Zunstable-options -Csymbol-mangling-version=v0 -Clinker-flavor=gnu-lld-cc -Clink-self-contained=+linker' &&
cd packages/next-swc && npm run build-native-release -- --target aarch64-unknown-linux-musl &&
llvm-strip -x native/next-swc.*.node
Expand Down Expand Up @@ -458,7 +466,10 @@ jobs:
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
- run: corepack enable
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
Expand Down Expand Up @@ -518,7 +529,10 @@ jobs:
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
- run: corepack enable
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
Expand Down Expand Up @@ -576,7 +590,10 @@ jobs:
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
- run: corepack enable
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
- uses: ./.github/actions/setup-rust
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 18
- run: corepack enable
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
- name: 'Run link checker'
run: node ./.github/actions/validate-docs-links/dist/index.js
env:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/code_freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ jobs:
with:
node-version: 18
check-latest: true
- run: corepack enable
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
- run: git clone https://github.com/vercel/next.js.git --depth=1 .

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/issue_wrong_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: corepack enable
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
- name: 'Close issues using the wrong issue template'
run: node ./.github/actions/next-repo-actions/dist/wrong-issue-template/index.js
env:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/popular.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: corepack enable
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
- name: 'Issues: Send notification to Slack'
run: node ./.github/actions/next-repo-actions/dist/issues/index.mjs
continue-on-error: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ jobs:
name: test-reports-build-integration-${{ matrix.group }}
if-no-files-found: 'error'
path: |
test/turbopack-test-junit-report
test/rspack-test-junit-report
# Collect integration test results from execute_tests,
# Store it as github artifact for next step to consume.
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/rspack-update-tests-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ jobs:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true

- run: corepack enable
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
- name: Install dependencies
shell: bash
Expand Down Expand Up @@ -59,7 +62,10 @@ jobs:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true

- run: corepack enable
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
- name: Install dependencies
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/setup-nextjs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
run: |
wget https://github.com/sharkdp/hyperfine/releases/download/v1.16.1/hyperfine_1.16.1_amd64.deb
sudo dpkg -i hyperfine_1.16.1_amd64.deb
npm i -g corepack@0.31
corepack enable
pnpm install --loglevel error
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test_e2e_deploy_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ jobs:
check-latest: true

- name: Setup pnpm
run: corepack enable
run: |
npm i -g corepack@0.31
corepack enable
- name: Checkout
uses: actions/checkout@v4
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ jobs:
with:
node-version: 18
check-latest: true
- run: corepack enable
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
- run: pnpm install
- run: pnpm build
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/triage_with_ai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: corepack enable
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
- name: 'Send report to Slack (AI-powered)'
run: node ./.github/actions/next-repo-actions/dist/triage-issues-with-ai/index.js
env:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/trigger_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ jobs:
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off

- run: corepack enable && pnpm --version
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
pnpm --version
- id: get-store-path
run: echo STORE_PATH=$(pnpm store path) >> $GITHUB_OUTPUT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ jobs:
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: test-results
name: test-results-turbopack-development
path: |
nextjs-test-results.json
failed-test-path-list.json
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/turbopack-update-tests-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ jobs:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true

- run: corepack enable
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
- name: Install dependencies
shell: bash
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/turbopack-upload-tests-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- run: corepack enable
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
- name: Install dependencies
shell: bash
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/update_fonts_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ jobs:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true

- run: corepack enable
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
- name: Install dependencies
shell: bash
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/update_react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ jobs:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true

- run: corepack enable
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
- name: Install dependencies
shell: bash
Expand Down
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions crates/napi/src/next_api/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ pub struct NapiTurboEngineOptions {
pub persistent_caching: Option<bool>,
/// An upper bound of memory that turbopack will attempt to stay under.
pub memory_limit: Option<f64>,
/// Track dependencies between tasks. If false, any change during build will error.
pub dependency_tracking: Option<bool>,
}

impl From<NapiWatchOptions> for WatchOptions {
Expand Down Expand Up @@ -377,10 +379,12 @@ pub async fn project_new(
.map(|m| m as usize)
.unwrap_or(usize::MAX);
let persistent_caching = turbo_engine_options.persistent_caching.unwrap_or_default();
let dependency_tracking = turbo_engine_options.dependency_tracking.unwrap_or(true);
let turbo_tasks = create_turbo_tasks(
PathBuf::from(&options.dist_dir),
persistent_caching,
memory_limit,
dependency_tracking,
)?;
if !persistent_caching {
use std::io::Write;
Expand Down
2 changes: 2 additions & 0 deletions crates/napi/src/next_api/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ pub fn create_turbo_tasks(
output_path: PathBuf,
persistent_caching: bool,
_memory_limit: usize,
dependency_tracking: bool,
) -> Result<NextTurboTasks> {
Ok(if persistent_caching {
let dirty_suffix = if crate::build::GIT_CLEAN
Expand Down Expand Up @@ -158,6 +159,7 @@ pub fn create_turbo_tasks(
} else {
turbo_tasks_backend::StorageMode::ReadWrite
}),
dependency_tracking,
..Default::default()
},
default_backing_storage(&output_path.join("cache/turbopack"), &version_info)?,
Expand Down
Loading

0 comments on commit eda5790

Please sign in to comment.