From 89d26ee333342369e99054801a122d41b76a91dc Mon Sep 17 00:00:00 2001 From: hardfist Date: Thu, 13 Feb 2025 20:57:48 +0800 Subject: [PATCH 01/10] chore: use more semantic profile --- .github/workflows/ci.yml | 4 +- .github/workflows/preview-commit.yml | 2 +- .github/workflows/release-canary.yml | 7 ++-- .github/workflows/release.yml | 2 +- .github/workflows/reusable-build.yml | 55 +++------------------------- Cargo.toml | 45 +++++++++++++++-------- crates/node_binding/package.json | 20 ++-------- crates/node_binding/scripts/build.js | 23 +++++------- package.json | 3 +- 9 files changed, 58 insertions(+), 103 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index becdbabf1876..84a9537b1cf4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,7 +97,7 @@ jobs: uses: ./.github/workflows/reusable-build.yml with: target: x86_64-pc-windows-msvc - profile: "debug" + profile: "ci" runner: ${{ needs.get-runner-labels.outputs.WINDOWS_RUNNER_LABELS }} skipable: ${{ needs.check-changed.outputs.changed != 'true' }} @@ -124,7 +124,7 @@ jobs: uses: ./.github/workflows/reusable-build.yml with: target: x86_64-apple-darwin - profile: "debug" + profile: "ci" runner: ${{ needs.get-runner-labels.outputs.MACOS_RUNNER_LABELS }} skipable: ${{ needs.check-changed.outputs.changed != 'true' }} diff --git a/.github/workflows/preview-commit.yml b/.github/workflows/preview-commit.yml index 27cfe6a94f7b..1052c09339af 100644 --- a/.github/workflows/preview-commit.yml +++ b/.github/workflows/preview-commit.yml @@ -60,7 +60,7 @@ jobs: with: target: ${{ matrix.array.target }} runner: ${{ matrix.array.runner }} - profile: "release-prod" + profile: "production" test: false publish: diff --git a/.github/workflows/release-canary.yml b/.github/workflows/release-canary.yml index 3b98caea10c8..4ad47cbe864b 100644 --- a/.github/workflows/release-canary.yml +++ b/.github/workflows/release-canary.yml @@ -12,9 +12,10 @@ on: type: choice default: release options: - - release - - release-debug - description: "release-debug means release with debug info for profile" + - production + - profiling + - ci + description: "profiling means release with debug info for profile" permissions: # To publish packages with provenance diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 024ace4741e8..87d2b0d0f7cb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,7 +66,7 @@ jobs: with: target: ${{ matrix.array.target }} runner: ${{ matrix.array.runner }} - profile: "release-prod" + profile: "production" release: name: Release diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index 4447d9d9d993..a8e95d3409a5 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -1,34 +1,5 @@ name: Reusable Release -# Example job: -#jobs -# build: -# strategy: -# matrix: -# array: -# - target: x86_64-unknown-linux-gnu -# runner: ubuntu-latest -# - target: aarch64-unknown-linux-gnu -# runner: ubuntu-latest -# - target: x86_64-unknown-linux-musl -# runner: ubuntu-latest -# - target: aarch64-unknown-linux-musl -# runner: ubuntu-latest -# - target: i686-pc-windows-msvc -# runner: windows-latest -# - target: x86_64-pc-windows-msvc -# runner: windows-latest -# - target: aarch64-pc-windows-msvc -# runner: windows-latest -# - target: x86_64-apple-darwin -# runner: macos-latest -# - target: aarch64-apple-darwin -# runner: macos-latest -# uses: ./.github/workflows/reusable-build.yml -# with: -# target: ${{ matrix.array.target }} -# runner: ${{ matrix.array.runner }} - on: workflow_call: inputs: @@ -43,7 +14,7 @@ on: required: true type: string profile: # Rust profile, "debug" or "release" - default: "release" + default: "production" required: false type: string test: # Run tests? @@ -85,10 +56,6 @@ jobs: with: target: ${{ inputs.target }} - - name: Setup tmate session - uses: mxschmitt/action-tmate@e5c7151931ca95bad1c6f4190c730ecf8c7dde48 # v3 - if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled && !inputs.skipable }} - - name: Pnpm Cache if: ${{ !inputs.skipable }} uses: ./.github/actions/pnpm-cache @@ -102,16 +69,6 @@ jobs: save-cache: ${{ github.ref_name == 'main' }} # This should be safe because we have nightly building the cache every day shared-key: build-${{ inputs.target }}-${{ inputs.profile }} - # Compile dependencies with optimization to make tests run faster - - name: Add optimization to debug profile - if: ${{ inputs.profile == 'debug' && !inputs.skipable }} - shell: bash - run: | - echo '[profile.release.package."*"]' >> Cargo.toml - echo 'opt-level = 3' >> Cargo.toml - echo 'codegen-units = 64' >> Cargo.toml - echo 'incremental = false' >> Cargo.toml - - name: Trim paths if: ${{ !inputs.skipable }} shell: bash @@ -122,7 +79,7 @@ jobs: - name: Check local cache id: check_cache - if: ${{ inputs.profile == 'debug' && !startsWith(runner.name, 'GitHub Actions') && !inputs.skipable }} + if: ${{ inputs.profile == 'ci' && !startsWith(runner.name, 'GitHub Actions') && !inputs.skipable }} shell: bash run: | set -e @@ -227,7 +184,7 @@ jobs: with: name: bindings-${{ inputs.target }} path: crates/node_binding/*.node - try-local-cache: ${{ inputs.profile == 'debug' }} + try-local-cache: ${{ inputs.profile == 'ci' }} mv-when-local: true e2e: @@ -253,7 +210,7 @@ jobs: with: name: bindings-${{ inputs.target }} path: crates/node_binding/ - try-local-cache: ${{ inputs.profile == 'debug' }} + try-local-cache: ${{ inputs.profile == 'ci' }} link-when-local: true - name: Setup Pnpm @@ -315,7 +272,7 @@ jobs: with: name: bindings-${{ inputs.target }} path: crates/node_binding/ - try-local-cache: ${{ inputs.profile == 'debug' }} + try-local-cache: ${{ inputs.profile == 'ci' }} link-when-local: true - name: Show restored binding @@ -414,7 +371,7 @@ jobs: with: name: bindings-${{ inputs.target }} path: crates/node_binding/ - try-local-cache: ${{ inputs.profile == 'debug' }} + try-local-cache: ${{ inputs.profile == 'ci' }} link-when-local: true - name: Show restored binding diff --git a/Cargo.toml b/Cargo.toml index 1791d82445ca..0cdde7fcd860 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -195,30 +195,43 @@ rspack_util = { version = "0.2.0", path = "crates/rsp [workspace.metadata.release] rate-limit = { existing-packages = 70, new-packages = 70 } + +# Follow servo's style https://github.com/servo/servo/blob/c95bd9d052d7eae378d31c5be0f92669cadb2c85/Cargo.toml#L175 + +# This is for local development [profile.dev] -codegen-units = 16 -debug = 2 # debug build will cause runtime panic if codegen-unints is default -incremental = true -panic = "abort" +debug = 2 # debug build will cause runtime panic if codegen-unints is default +incremental = true +panic = "abort" +# This is used for inheritance by other release related profile [profile.release] +opt-level = 3 + +# This is for CI build +[profile.ci] +codegen-units = 16 +inherits = "release" + +# This is for production build +[profile.production] codegen-units = 1 debug = false -# Performs “thin” LTO. This is similar to “fat”, but takes substantially less time to run while still achieving performance gains similar to “fat”. -lto = "thin" -opt-level = 3 -panic = "abort" -strip = true +inherits = "release" -[profile.release-prod] -inherits = "release" # Performs “fat” LTO which attempts to perform optimizations across all crates within the dependency graph. -lto = "fat" +lto = "fat" +opt-level = "s" +panic = "abort" +strip = true -[profile.release-debug] -debug = true -inherits = "release" -strip = false +# This is for production for profiling production build +[profile.profiling] +codegen-units = 1 +debug = true +inherits = "release" +lto = "thin" +strip = false # the following lints rules are from https://github.com/biomejs/biome/blob/4bd3d6f09642952ee14445ed56af81a73796cea1/Cargo.toml#L7C1-L75C1 [workspace.lints.rust] diff --git a/crates/node_binding/package.json b/crates/node_binding/package.json index 3e44db2d7dcd..6d9d4e39c4f5 100644 --- a/crates/node_binding/package.json +++ b/crates/node_binding/package.json @@ -15,23 +15,9 @@ ], "scripts": { "build:debug": "node scripts/build.js", - "watch:debug": "node scripts/build.js --watch", - "build:debug:x64": "cross-env RUST_TARGET=x86_64-apple-darwin node scripts/build.js", - "build:debug:linux": "cross-env RUST_TARGET=x86_64-unknown-linux-gnu node scripts/build.js", - "build:release": "node scripts/build.js --release", - "watch:release": "node scripts/build.js --release --watch", - "build:release:arm64": "cross-env RUST_TARGET=aarch64-apple-darwin node scripts/build.js --release", - "build:release:x64": "cross-env RUST_TARGET=x86_64-apple-darwin node scripts/build.js --release", - "build:release:linux": "cross-env RUST_TARGET=x86_64-unknown-linux-gnu node scripts/build.js --release", - "build:release:musl": "cross-env RUST_TARGET=aarch64-unknown-linux-musl node scripts/build.js --release", - "build:release:win": "cross-env RUST_TARGET=x86_64-pc-windows-msvc node scripts/build.js --release", - "build:release-prod": "node scripts/build.js --release-prod", - "watch:release-prod": "node scripts/build.js --release-prod --watch", - "build:release-prod:arm64": "cross-env RUST_TARGET=aarch64-apple-darwin node scripts/build.js --release-prod", - "build:release-prod:x64": "cross-env RUST_TARGET=x86_64-apple-darwin node scripts/build.js --release-prod", - "build:release-prod:linux": "cross-env RUST_TARGET=x86_64-unknown-linux-gnu node scripts/build.js --release-prod", - "build:release-prod:win": "cross-env RUST_TARGET=x86_64-pc-windows-msvc node scripts/build.js --release-prod", - "build:release-debug": "node scripts/build.js --release-debug", + "build:ci": "node scripts/build.js --profile ci", + "build:production": "node scripts/build.js --profile production", + "build:profiling": "node scripts/build.js --profile profiling", "move-binding": "node scripts/move-binding", "test": "tsc -p tsconfig.type-test.json" }, diff --git a/crates/node_binding/scripts/build.js b/crates/node_binding/scripts/build.js index 618f82e2bd9a..a7468262de21 100644 --- a/crates/node_binding/scripts/build.js +++ b/crates/node_binding/scripts/build.js @@ -1,15 +1,18 @@ const path = require("path"); const { readFileSync, writeFileSync } = require("fs") +const { values } = require('util').parseArgs({ + args: process.argv.slice(2), + options: { + profile: { + type: 'string' + } + } +}) const { spawn } = require("child_process"); const CARGO_SAFELY_EXIT_CODE = 0; -// Faster release for CI & canary with `thin` LTO -let release = process.argv.includes("--release"); -// Slower release for production with `fat` LTO -let releaseProd = process.argv.includes("--release-prod"); -let releaseDebug = process.argv.includes("--release-debug"); let watch = process.argv.includes("--watch"); build().then((value) => { @@ -35,14 +38,8 @@ async function build() { "--pipe", `"node ./scripts/dts-header.js"` ]; - if (release) { - args.push("--release"); - } - if (releaseProd) { - args.push('--profile release-prod'); - } - if (releaseDebug) { - args.push('--profile release-debug'); + if (values.profile) { + args.push("--profile", values.profile) } if (watch) { args.push("--watch"); diff --git a/package.json b/package.json index 046f53bdc6f3..76a950f4954e 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,8 @@ "doc-coverage": "pnpm --filter \"@rspack/core\" doc-coverage", "api-extractor:local": "pnpm --filter \"@rspack/*\" api-extractor --local", "api-extractor:ci": "pnpm --filter \"@rspack/*\" api-extractor:ci", - "bench:ci": "cargo codspeed run && pnpm --filter bench run bench" + "bench:ci:rust": "cargo codspeed run", + "bench:ci:js": "pnpm --filter bench run bench" }, "homepage": "https://rspack.dev", "bugs": "https://github.com/web-infra-dev/rspack/issues", From 8b5204d83dc379893a5b1926da91fd275f4e6b7b Mon Sep 17 00:00:00 2001 From: hardfist Date: Thu, 13 Feb 2025 22:20:32 +0800 Subject: [PATCH 02/10] chore: fix script --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 76a950f4954e..81f3ad5f2785 100644 --- a/package.json +++ b/package.json @@ -29,9 +29,9 @@ "lint-ci:js": "biome check --diagnostic-level=warn --no-errors-on-unmatched --max-diagnostics=none", "lint:rs": "node ./scripts/check_rust_dependency.cjs", "build:binding:debug": "pnpm --filter @rspack/binding run build:debug", - "build:binding:release": "pnpm --filter @rspack/binding run build:release", - "build:binding:release-debug": "pnpm --filter @rspack/binding run build:release-debug", - "build:binding:release-prod": "pnpm --filter @rspack/binding run build:release-prod", + "build:binding:ci": "pnpm --filter @rspack/binding run build:ci", + "build:binding:production": "pnpm --filter @rspack/binding run build:production", + "build:binding:profiling": "pnpm --filter @rspack/binding run build:profiling", "prepare": "is-ci || husky", "test:diff": "pnpm --filter \"@rspack/*\" test:diff", "test:hot": "pnpm --filter \"@rspack/*\" test:hot", From e881842285f4eeb254af9a343c1c561d6768f05b Mon Sep 17 00:00:00 2001 From: hardfist Date: Thu, 13 Feb 2025 22:47:50 +0800 Subject: [PATCH 03/10] chore: use ci by default --- .github/workflows/reusable-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index a8e95d3409a5..9e2cbbc3079c 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -13,8 +13,8 @@ on: runner: # Runner labels required: true type: string - profile: # Rust profile, "debug" or "release" - default: "production" + profile: # Rust profile, "ci" or "production" or "profiling" + default: "ci" required: false type: string test: # Run tests? From a698d6a36702fb946dccbffa31e300742feed969 Mon Sep 17 00:00:00 2001 From: hardfist Date: Thu, 13 Feb 2025 23:06:53 +0800 Subject: [PATCH 04/10] chore: fix --- Cargo.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 0cdde7fcd860..1ed29cdf57d9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -210,8 +210,10 @@ opt-level = 3 # This is for CI build [profile.ci] -codegen-units = 16 +codegen-units = 64 inherits = "release" +lto = "thin" +opt-level = 2 # This is for production build [profile.production] From a92e2ae10a6b2dd728eff2e76d345e44ffe9311a Mon Sep 17 00:00:00 2001 From: hardfist Date: Thu, 13 Feb 2025 23:44:34 +0800 Subject: [PATCH 05/10] chore: use debug for windows --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84a9537b1cf4..6c89d233b551 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,7 +97,7 @@ jobs: uses: ./.github/workflows/reusable-build.yml with: target: x86_64-pc-windows-msvc - profile: "ci" + profile: "debug" runner: ${{ needs.get-runner-labels.outputs.WINDOWS_RUNNER_LABELS }} skipable: ${{ needs.check-changed.outputs.changed != 'true' }} From 4eec2ec5e6c64340784d33766cebb6df19a6a07c Mon Sep 17 00:00:00 2001 From: hardfist Date: Fri, 14 Feb 2025 10:43:39 +0800 Subject: [PATCH 06/10] chore: fix dep --- .github/workflows/reusable-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index 9e2cbbc3079c..938785487509 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -393,7 +393,7 @@ jobs: - name: Install cargo-codspeed binary uses: taiki-e/install-action@995f97569c4a8ae84dcd7e1a0107f65ca6ebf139 # v2 with: - tool: cargo-codspeed + tool: cargo-codspeed@2.7.2 - name: Build Benchmark env: From 3ce72047252c807ae05b914b56935fc29c2de990 Mon Sep 17 00:00:00 2001 From: hardfist Date: Fri, 14 Feb 2025 11:05:33 +0800 Subject: [PATCH 07/10] chore: adjust params --- Cargo.toml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1ed29cdf57d9..64d375d9064c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -206,21 +206,23 @@ panic = "abort" # This is used for inheritance by other release related profile [profile.release] +debug = false opt-level = 3 # This is for CI build [profile.ci] codegen-units = 64 inherits = "release" -lto = "thin" -opt-level = 2 +## reduce little optimization to reduce build time +lto = "thin" +## reduce little optimization to reduce build time +opt-level = 2 # This is for production build [profile.production] codegen-units = 1 debug = false inherits = "release" - # Performs “fat” LTO which attempts to perform optimizations across all crates within the dependency graph. lto = "fat" opt-level = "s" @@ -229,11 +231,10 @@ strip = true # This is for production for profiling production build [profile.profiling] -codegen-units = 1 -debug = true -inherits = "release" -lto = "thin" -strip = false +debug = true +inherits = "release" +lto = "thin" +strip = false # the following lints rules are from https://github.com/biomejs/biome/blob/4bd3d6f09642952ee14445ed56af81a73796cea1/Cargo.toml#L7C1-L75C1 [workspace.lints.rust] From 7de0b7052dde71f1c00533b37c9d213f41a4b775 Mon Sep 17 00:00:00 2001 From: hardfist Date: Fri, 14 Feb 2025 11:33:51 +0800 Subject: [PATCH 08/10] chore: adjust production -> release --- .github/workflows/preview-commit.yml | 2 +- .github/workflows/release-canary.yml | 4 ++-- .github/workflows/release.yml | 2 +- Cargo.toml | 25 ++++++++++--------------- crates/node_binding/package.json | 2 +- package.json | 2 +- 6 files changed, 16 insertions(+), 21 deletions(-) diff --git a/.github/workflows/preview-commit.yml b/.github/workflows/preview-commit.yml index 1052c09339af..53e9bc14d123 100644 --- a/.github/workflows/preview-commit.yml +++ b/.github/workflows/preview-commit.yml @@ -60,7 +60,7 @@ jobs: with: target: ${{ matrix.array.target }} runner: ${{ matrix.array.runner }} - profile: "production" + profile: "release" test: false publish: diff --git a/.github/workflows/release-canary.yml b/.github/workflows/release-canary.yml index 4ad47cbe864b..05eb15c63cb4 100644 --- a/.github/workflows/release-canary.yml +++ b/.github/workflows/release-canary.yml @@ -12,10 +12,10 @@ on: type: choice default: release options: - - production + - release - profiling - ci - description: "profiling means release with debug info for profile" + description: "profiling means release with debug info for profiling, ci means release with debug info and faster build time" permissions: # To publish packages with provenance diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 87d2b0d0f7cb..da3a8d267dd2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,7 +66,7 @@ jobs: with: target: ${{ matrix.array.target }} runner: ${{ matrix.array.runner }} - profile: "production" + profile: "release" release: name: Release diff --git a/Cargo.toml b/Cargo.toml index 64d375d9064c..6a36fae982ff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -204,22 +204,8 @@ debug = 2 # debug build will cause runtime panic if codegen-unints i incremental = true panic = "abort" -# This is used for inheritance by other release related profile +# This is for release build for users [profile.release] -debug = false -opt-level = 3 - -# This is for CI build -[profile.ci] -codegen-units = 64 -inherits = "release" -## reduce little optimization to reduce build time -lto = "thin" -## reduce little optimization to reduce build time -opt-level = 2 - -# This is for production build -[profile.production] codegen-units = 1 debug = false inherits = "release" @@ -229,6 +215,15 @@ opt-level = "s" panic = "abort" strip = true +# This is for CI build based on release but with faster build time +[profile.ci] +codegen-units = 64 +inherits = "release" +## reduce little optimization to reduce build time +lto = "thin" +## reduce little optimization to reduce build time +opt-level = 2 + # This is for production for profiling production build [profile.profiling] debug = true diff --git a/crates/node_binding/package.json b/crates/node_binding/package.json index 6d9d4e39c4f5..567b3296f918 100644 --- a/crates/node_binding/package.json +++ b/crates/node_binding/package.json @@ -14,7 +14,7 @@ "binding.d.ts" ], "scripts": { - "build:debug": "node scripts/build.js", + "build:dev": "node scripts/build.js", "build:ci": "node scripts/build.js --profile ci", "build:production": "node scripts/build.js --profile production", "build:profiling": "node scripts/build.js --profile profiling", diff --git a/package.json b/package.json index 81f3ad5f2785..a9cce8e3250e 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "clean": "pnpm --filter @rspack/cli run clean", "check-dependency-version": "pnpx check-dependency-version-consistency@5 . --ignore-dep @napi-rs/cli --ignore-dep chalk --ignore-package webpack-test --ignore-package webpack-examples --ignore-package plugin-test", "build:js": "pnpm --filter \"@rspack/core\" build:force && pnpm --filter \"@rspack/*\" --filter \"create-rspack\" --filter \"!@rspack/core\" build", - "build:cli:debug": "npm run build:binding:debug && npm run build:js", + "build:cli:dev": "npm run build:binding:dev && npm run build:js", "build:cli:release": "npm run build:binding:release && npm run build:js", "build:cli:release:all": "pnpm --filter @rspack/binding build:release:all && npm run build:js", "build:cli:release:arm64": "pnpm --filter @rspack/binding build:release:arm64 && npm run build:js", From 0d768b5acb5e7663b477397a2c8103eccf8da0aa Mon Sep 17 00:00:00 2001 From: hardfist Date: Fri, 14 Feb 2025 11:54:32 +0800 Subject: [PATCH 09/10] chore: rename debug -> dev --- Cargo.toml | 1 - crates/node_binding/package.json | 2 +- package.json | 4 ++-- website/docs/en/contribute/development/debugging.mdx | 2 +- website/docs/zh/contribute/development/debugging.mdx | 2 +- x.mjs | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6a36fae982ff..26ad18c54c5f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -208,7 +208,6 @@ panic = "abort" [profile.release] codegen-units = 1 debug = false -inherits = "release" # Performs “fat” LTO which attempts to perform optimizations across all crates within the dependency graph. lto = "fat" opt-level = "s" diff --git a/crates/node_binding/package.json b/crates/node_binding/package.json index 567b3296f918..3157f5bbf3ab 100644 --- a/crates/node_binding/package.json +++ b/crates/node_binding/package.json @@ -17,7 +17,7 @@ "build:dev": "node scripts/build.js", "build:ci": "node scripts/build.js --profile ci", "build:production": "node scripts/build.js --profile production", - "build:profiling": "node scripts/build.js --profile profiling", + "build:release": "node scripts/build.js --profile release", "move-binding": "node scripts/move-binding", "test": "tsc -p tsconfig.type-test.json" }, diff --git a/package.json b/package.json index a9cce8e3250e..0587b3f56bab 100644 --- a/package.json +++ b/package.json @@ -28,9 +28,9 @@ "lint:js": "pnpm run lint-ci:js --write", "lint-ci:js": "biome check --diagnostic-level=warn --no-errors-on-unmatched --max-diagnostics=none", "lint:rs": "node ./scripts/check_rust_dependency.cjs", - "build:binding:debug": "pnpm --filter @rspack/binding run build:debug", + "build:binding:dev": "pnpm --filter @rspack/binding run build:dev", "build:binding:ci": "pnpm --filter @rspack/binding run build:ci", - "build:binding:production": "pnpm --filter @rspack/binding run build:production", + "build:binding:release": "pnpm --filter @rspack/binding run build:release", "build:binding:profiling": "pnpm --filter @rspack/binding run build:profiling", "prepare": "is-ci || husky", "test:diff": "pnpm --filter \"@rspack/*\" test:diff", diff --git a/website/docs/en/contribute/development/debugging.mdx b/website/docs/en/contribute/development/debugging.mdx index 4316f61e4eb6..f60d21348756 100644 --- a/website/docs/en/contribute/development/debugging.mdx +++ b/website/docs/en/contribute/development/debugging.mdx @@ -104,7 +104,7 @@ To illustrate this process, I'll use an example. Let's start by introduce the en Firstly, you need to build rspack in debug mode. To do this, execute the following commands in the project's root directory: ```bash -npm run build:binding:debug +npm run build:binding:dev npm run build:js ``` diff --git a/website/docs/zh/contribute/development/debugging.mdx b/website/docs/zh/contribute/development/debugging.mdx index d31b8b5363ff..3c196fa5ab4b 100644 --- a/website/docs/zh/contribute/development/debugging.mdx +++ b/website/docs/zh/contribute/development/debugging.mdx @@ -104,7 +104,7 @@ Target 0: (node) stopped. 首先,你需要在调试模式下构建 rspack。为此,请在项目的根目录中执行以下命令: ```bash -npm run build:binding:debug +npm run build:binding:dev npm run build:js ``` diff --git a/x.mjs b/x.mjs index 6f3da8ad2720..81ff97c665fa 100755 --- a/x.mjs +++ b/x.mjs @@ -107,7 +107,7 @@ buildCommand .command("binding") .description("build rust binding") .action(async () => { - await $`pnpm --filter @rspack/binding build:debug`; + await $`pnpm --filter @rspack/binding build:dev`; }); // x build js From f9b12d9ba95655d8361b9b31671fd65b0b4a3f6c Mon Sep 17 00:00:00 2001 From: hardfist Date: Fri, 14 Feb 2025 12:07:57 +0800 Subject: [PATCH 10/10] chore: fix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c89d233b551..71263352a9b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,7 +97,7 @@ jobs: uses: ./.github/workflows/reusable-build.yml with: target: x86_64-pc-windows-msvc - profile: "debug" + profile: "dev" runner: ${{ needs.get-runner-labels.outputs.WINDOWS_RUNNER_LABELS }} skipable: ${{ needs.check-changed.outputs.changed != 'true' }}