Unverified Commit 54ea0d95 authored by Donny/강동윤's avatar Donny/강동윤 Committed by GitHub

feat: Allow trace-level logging for non-published release builds (#49564)

### What?

Disable `tracing/release_max_level_info` for non-published release
builds. I modified CI script to strip out logging for published
binaries.

### Why?

x-ref: https://vercel.slack.com/archives/C03EWR7LGEN/p1683621374204959

It's required to print logging for turbopack.

### How?

Closes WEB-1032

---------
Co-authored-by: 's avatarTobias Koppers <tobias.koppers@googlemail.com>
parent f55359ff
...@@ -1338,12 +1338,12 @@ jobs: ...@@ -1338,12 +1338,12 @@ jobs:
target: 'x86_64-apple-darwin' target: 'x86_64-apple-darwin'
build: | build: |
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi
turbo run build-native -- --release --target x86_64-apple-darwin turbo run build-native-release -- --target x86_64-apple-darwin --release
strip -x packages/next-swc/native/next-swc.*.node strip -x packages/next-swc/native/next-swc.*.node
- host: windows-latest - host: windows-latest
build: | build: |
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}" npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}"
turbo run build-native -- --release --target x86_64-pc-windows-msvc turbo run build-native-release -- --target x86_64-pc-windows-msvc
target: 'x86_64-pc-windows-msvc' target: 'x86_64-pc-windows-msvc'
- host: windows-latest - host: windows-latest
build: | build: |
...@@ -1360,7 +1360,7 @@ jobs: ...@@ -1360,7 +1360,7 @@ jobs:
rustup target add x86_64-unknown-linux-gnu && rustup target add x86_64-unknown-linux-gnu &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi && npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi &&
unset CC_x86_64_unknown_linux_gnu && unset CC && unset CC_x86_64_unknown_linux_gnu && unset CC &&
turbo run build-native -- --release --target x86_64-unknown-linux-gnu && turbo run build-native-release -- --target x86_64-unknown-linux-gnu &&
strip packages/next-swc/native/next-swc.*.node strip packages/next-swc/native/next-swc.*.node
- host: ubuntu-latest - host: ubuntu-latest
target: 'x86_64-unknown-linux-musl' target: 'x86_64-unknown-linux-musl'
...@@ -1372,7 +1372,7 @@ jobs: ...@@ -1372,7 +1372,7 @@ jobs:
rustup default "${RUST_TOOLCHAIN}" && rustup default "${RUST_TOOLCHAIN}" &&
rustup target add x86_64-unknown-linux-musl && rustup target add x86_64-unknown-linux-musl &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi && npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi &&
turbo run build-native -- --release --target x86_64-unknown-linux-musl && turbo run build-native-release -- --target x86_64-unknown-linux-musl &&
strip packages/next-swc/native/next-swc.*.node strip packages/next-swc/native/next-swc.*.node
- host: macos-latest - host: macos-latest
target: 'aarch64-apple-darwin' target: 'aarch64-apple-darwin'
...@@ -1383,7 +1383,7 @@ jobs: ...@@ -1383,7 +1383,7 @@ jobs:
SYSROOT=$(xcrun --sdk macosx --show-sdk-path); SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT"; export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi
turbo run build-native -- --release --target aarch64-apple-darwin turbo run build-native-release -- --target aarch64-apple-darwin
strip -x packages/next-swc/native/next-swc.*.node strip -x packages/next-swc/native/next-swc.*.node
- host: ubuntu-latest - host: ubuntu-latest
target: 'aarch64-unknown-linux-gnu' target: 'aarch64-unknown-linux-gnu'
...@@ -1396,7 +1396,7 @@ jobs: ...@@ -1396,7 +1396,7 @@ jobs:
rustup target add aarch64-unknown-linux-gnu && rustup target add aarch64-unknown-linux-gnu &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi && npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi &&
export CC_aarch64_unknown_linux_gnu=/usr/aarch64-unknown-linux-gnu/bin/aarch64-unknown-linux-gnu-gcc && export CC_aarch64_unknown_linux_gnu=/usr/aarch64-unknown-linux-gnu/bin/aarch64-unknown-linux-gnu-gcc &&
turbo run build-native -- --release --target aarch64-unknown-linux-gnu && turbo run build-native-release -- --target aarch64-unknown-linux-gnu &&
llvm-strip -x packages/next-swc/native/next-swc.*.node llvm-strip -x packages/next-swc/native/next-swc.*.node
- host: ubuntu-latest - host: ubuntu-latest
target: 'aarch64-unknown-linux-musl' target: 'aarch64-unknown-linux-musl'
...@@ -1409,13 +1409,13 @@ jobs: ...@@ -1409,13 +1409,13 @@ jobs:
rustup toolchain install "${RUST_TOOLCHAIN}" && rustup toolchain install "${RUST_TOOLCHAIN}" &&
rustup default "${RUST_TOOLCHAIN}" && rustup default "${RUST_TOOLCHAIN}" &&
rustup target add aarch64-unknown-linux-musl && rustup target add aarch64-unknown-linux-musl &&
turbo run build-native -- --release --target aarch64-unknown-linux-musl && turbo run build-native-release -- --target aarch64-unknown-linux-musl &&
llvm-strip -x packages/next-swc/native/next-swc.*.node llvm-strip -x packages/next-swc/native/next-swc.*.node
- host: windows-latest - host: windows-latest
target: 'aarch64-pc-windows-msvc' target: 'aarch64-pc-windows-msvc'
build: | build: |
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}" npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}"
turbo run build-native-no-plugin-woa -- --release --target aarch64-pc-windows-msvc --cargo-flags=--no-default-features turbo run build-native-no-plugin-woa-release -- --target aarch64-pc-windows-msvc
if: ${{ needs.build.outputs.isRelease == 'true' || (needs.build.outputs.turboToken != 'empty') }} if: ${{ needs.build.outputs.isRelease == 'true' || (needs.build.outputs.turboToken != 'empty') }}
needs: build needs: build
name: stable - ${{ matrix.settings.target }} - node@16 name: stable - ${{ matrix.settings.target }} - node@16
......
...@@ -20,7 +20,7 @@ regex = "1.5" ...@@ -20,7 +20,7 @@ regex = "1.5"
serde = "1" serde = "1"
serde_json = "1" serde_json = "1"
sha1 = "0.10.1" sha1 = "0.10.1"
tracing = { version = "0.1.37", features = ["release_max_level_info"] } tracing = { version = "0.1.37" }
turbo-binding = { workspace = true, features = [ turbo-binding = { workspace = true, features = [
"__swc_core", "__swc_core",
......
...@@ -54,7 +54,7 @@ turbo-tasks = { workspace = true } ...@@ -54,7 +54,7 @@ turbo-tasks = { workspace = true }
once_cell = { workspace = true } once_cell = { workspace = true }
serde = "1" serde = "1"
serde_json = "1" serde_json = "1"
tracing = { version = "0.1.37", features = ["release_max_level_info"] } tracing = { version = "0.1.37" }
tracing-futures = "0.2.5" tracing-futures = "0.2.5"
tracing-subscriber = "0.3.9" tracing-subscriber = "0.3.9"
tracing-chrome = "0.5.0" tracing-chrome = "0.5.0"
......
...@@ -5,9 +5,10 @@ ...@@ -5,9 +5,10 @@
"scripts": { "scripts": {
"clean": "node ../../scripts/rm.mjs native", "clean": "node ../../scripts/rm.mjs native",
"build-native": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --features plugin,rustls-tls --js false native", "build-native": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --features plugin,rustls-tls --js false native",
"build-native-woa": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --cargo-flags=--no-default-features --features plugin,native-tls --js false native", "build-native-release": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --release --features plugin,rustls-tls,tracing/release_max_level_info --js false native",
"build-native-no-plugin": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --js false native", "build-native-no-plugin": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --js false native",
"build-native-no-plugin-woa": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --cargo-flags=--no-default-features --features native-tls --js false native", "build-native-no-plugin-woa": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --cargo-flags=--no-default-features --features native-tls --js false native",
"build-native-no-plugin-woa-release": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --release --cargo-flags=--no-default-features --features native-tls,tracing/release_max_level_info --js false native",
"build-wasm": "wasm-pack build crates/wasm --scope=next", "build-wasm": "wasm-pack build crates/wasm --scope=next",
"cache-build-native": "echo $(ls native)" "cache-build-native": "echo $(ls native)"
}, },
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
"dependsOn": ["^build-native"], "dependsOn": ["^build-native"],
"outputs": ["native/*.node"] "outputs": ["native/*.node"]
}, },
"build-native-release": {
"dependsOn": ["^build-native-release"],
"outputs": ["native/*.node"]
},
"build-native-no-plugin": { "build-native-no-plugin": {
"dependsOn": ["^build-native-no-plugin"], "dependsOn": ["^build-native-no-plugin"],
"outputs": ["native/*.node"] "outputs": ["native/*.node"]
...@@ -13,6 +17,10 @@ ...@@ -13,6 +17,10 @@
"dependsOn": ["^build-native-no-plugin-woa"], "dependsOn": ["^build-native-no-plugin-woa"],
"outputs": ["native/*.node"] "outputs": ["native/*.node"]
}, },
"build-native-no-plugin-woa-release": {
"dependsOn": ["^build-native-no-plugin-woa-release"],
"outputs": ["native/*.node"]
},
"build-wasm": { "build-wasm": {
"dependsOn": ["^build-wasm"], "dependsOn": ["^build-wasm"],
"outputs": ["crates/wasm/pkg/*"] "outputs": ["crates/wasm/pkg/*"]
......
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