Unverified Commit 3dd9af78 authored by OJ Kwon's avatar OJ Kwon Committed by GitHub

build(cargo): fix turbopack + next-swc build (#43983)

Fixes WEB-301. 

This PR fixes build failure with latest turbopack, also update necessary
dependencies.

---

Edit by @kdy1:
 - Closes https://github.com/vercel/next.js/issues/43052
parent ea7d8568
...@@ -1128,7 +1128,7 @@ jobs: ...@@ -1128,7 +1128,7 @@ jobs:
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 -- --release --target aarch64-pc-windows-msvc --cargo-flags=--no-default-features turbo run build-native-no-plugin-woa -- --release --target aarch64-pc-windows-msvc --cargo-flags=--no-default-features
if: ${{ needs.build.outputs.isRelease == 'true' || (needs.build.outputs.swcChange == 'yup' && needs.build.outputs.turboToken != 'empty') }} if: ${{ needs.build.outputs.isRelease == 'true' || (needs.build.outputs.swcChange == 'yup' && needs.build.outputs.turboToken != 'empty') }}
needs: build needs: build
name: stable - ${{ matrix.settings.target }} - node@16 name: stable - ${{ matrix.settings.target }} - node@16
......
This diff is collapsed.
...@@ -17,13 +17,9 @@ pathdiff = "0.2.0" ...@@ -17,13 +17,9 @@ pathdiff = "0.2.0"
regex = "1.5" regex = "1.5"
serde = "1" serde = "1"
serde_json = "1" serde_json = "1"
swc_emotion = "0.28.4"
styled_components = "0.52.8"
styled_jsx = "0.29.8"
modularize_imports = "0.25.8"
tracing = { version = "0.1.37", features = ["release_max_level_info"] } tracing = { version = "0.1.37", features = ["release_max_level_info"] }
next-binding = { git = "https://github.com/vercel/turbo.git", rev = "cc024fa59f1c3ad253e74eefe86e0386455455d1", features = [ next-binding = { git = "https://github.com/vercel/turbo.git", rev = "d3820c52989a2badf38ff868a176f61a7a7255fd", features = [
"__swc_core", "__swc_core",
"__swc_core_next_core", "__swc_core_next_core",
"__swc_transform_styled_jsx", "__swc_transform_styled_jsx",
...@@ -33,7 +29,7 @@ next-binding = { git = "https://github.com/vercel/turbo.git", rev = "cc024fa59f1 ...@@ -33,7 +29,7 @@ next-binding = { git = "https://github.com/vercel/turbo.git", rev = "cc024fa59f1
] } ] }
[dev-dependencies] [dev-dependencies]
next-binding = { git = "https://github.com/vercel/turbo.git", rev = "cc024fa59f1c3ad253e74eefe86e0386455455d1", features = [ next-binding = { git = "https://github.com/vercel/turbo.git", rev = "d3820c52989a2badf38ff868a176f61a7a7255fd", features = [
"__swc_core_testing_transform", "__swc_core_testing_transform",
"__swc_testing", "__swc_testing",
] } ] }
......
...@@ -8,7 +8,7 @@ publish = false ...@@ -8,7 +8,7 @@ publish = false
crate-type = ["cdylib", "rlib"] crate-type = ["cdylib", "rlib"]
[features] [features]
default = [] default = ["rustls-tls"]
# Instead of enabling all the plugin-related features by default, make it explicitly specified # Instead of enabling all the plugin-related features by default, make it explicitly specified
# when build (i.e napi --build --features plugin), same for the wasm as well. # when build (i.e napi --build --features plugin), same for the wasm as well.
# this is due to some of transitive dependencies have features cannot be enabled at the same time # this is due to some of transitive dependencies have features cannot be enabled at the same time
...@@ -17,6 +17,9 @@ plugin = ["next-binding/__swc_core_binding_napi_plugin", "next-swc/plugin"] ...@@ -17,6 +17,9 @@ plugin = ["next-binding/__swc_core_binding_napi_plugin", "next-swc/plugin"]
sentry_native_tls = ["_sentry_native_tls"] sentry_native_tls = ["_sentry_native_tls"]
sentry_rustls = ["_sentry_rustls"] sentry_rustls = ["_sentry_rustls"]
native-tls = ["next-binding/__turbo_native_tls"]
rustls-tls = ["next-binding/__turbo_rustls_tls"]
[dependencies] [dependencies]
anyhow = "1.0.66" anyhow = "1.0.66"
backtrace = "0.3" backtrace = "0.3"
...@@ -36,7 +39,7 @@ tracing = { version = "0.1.37", features = ["release_max_level_info"] } ...@@ -36,7 +39,7 @@ tracing = { version = "0.1.37", features = ["release_max_level_info"] }
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"
next-binding = { git = "https://github.com/vercel/turbo.git", rev = "cc024fa59f1c3ad253e74eefe86e0386455455d1", features = [ next-binding = { git = "https://github.com/vercel/turbo.git", rev = "d3820c52989a2badf38ff868a176f61a7a7255fd", features = [
"__swc_core_binding_napi", "__swc_core_binding_napi",
"__turbo_next_dev_server", "__turbo_next_dev_server",
"__turbo_node_file_trace", "__turbo_node_file_trace",
......
...@@ -31,7 +31,7 @@ wasm-bindgen-futures = "0.4.8" ...@@ -31,7 +31,7 @@ wasm-bindgen-futures = "0.4.8"
getrandom = { version = "0.2.5", optional = true, default-features = false } getrandom = { version = "0.2.5", optional = true, default-features = false }
js-sys = "0.3.59" js-sys = "0.3.59"
serde-wasm-bindgen = "0.4.3" serde-wasm-bindgen = "0.4.3"
next-binding = { git = "https://github.com/vercel/turbo.git", rev = "cc024fa59f1c3ad253e74eefe86e0386455455d1", features = [ next-binding = { git = "https://github.com/vercel/turbo.git", rev = "d3820c52989a2badf38ff868a176f61a7a7255fd", features = [
"__swc_core_binding_wasm", "__swc_core_binding_wasm",
"__feature_mdx_rs", "__feature_mdx_rs",
] } ] }
......
...@@ -3,8 +3,10 @@ ...@@ -3,8 +3,10 @@
"version": "13.0.8-canary.0", "version": "13.0.8-canary.0",
"private": true, "private": true,
"scripts": { "scripts": {
"build-native": "napi build --platform -p next-swc-napi --cargo-name next_swc_napi --features plugin --js false native", "build-native": "napi build --platform -p next-swc-napi --cargo-name next_swc_napi --features plugin,rustls-tls --js false native",
"build-native-woa": "napi build --platform -p next-swc-napi --cargo-name next_swc_napi --features plugin,native-tls --js false native",
"build-native-no-plugin": "napi build --platform -p next-swc-napi --cargo-name next_swc_napi --js false native", "build-native-no-plugin": "napi build --platform -p next-swc-napi --cargo-name next_swc_napi --js false native",
"build-native-no-plugin-woa": "napi build --platform -p next-swc-napi --cargo-name next_swc_napi --cargo-flags=--no-default-features --features native-tls --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)"
}, },
......
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
"dependsOn": ["^build-native-no-plugin"], "dependsOn": ["^build-native-no-plugin"],
"outputs": ["native/*.node"] "outputs": ["native/*.node"]
}, },
"build-native-no-plugin-woa": {
"dependsOn": ["^build-native-no-plugin-woa"],
"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