Skip to content

Commit

Permalink
build(next-swc): fix turbopack with tls backend
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Dec 19, 2022
1 parent ae5502e commit 0a26710
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_test_deploy.yml
Expand Up @@ -1128,7 +1128,7 @@ jobs:
target: 'aarch64-pc-windows-msvc'
build: |
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') }}
needs: build
name: stable - ${{ matrix.settings.target }} - node@16
Expand Down
8 changes: 2 additions & 6 deletions packages/next-swc/crates/core/Cargo.toml
Expand Up @@ -17,13 +17,9 @@ pathdiff = "0.2.0"
regex = "1.5"
serde = "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"] }

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_next_core",
"__swc_transform_styled_jsx",
Expand All @@ -33,7 +29,7 @@ next-binding = { git = "https://github.com/vercel/turbo.git", rev = "cc024fa59f1
] }

[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_testing",
] }
Expand Down
7 changes: 5 additions & 2 deletions packages/next-swc/crates/napi/Cargo.toml
Expand Up @@ -8,7 +8,7 @@ publish = false
crate-type = ["cdylib", "rlib"]

[features]
default = []
default = ["rustls-tls"]
# 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.
# this is due to some of transitive dependencies have features cannot be enabled at the same time
Expand All @@ -17,6 +17,9 @@ plugin = ["next-binding/__swc_core_binding_napi_plugin", "next-swc/plugin"]
sentry_native_tls = ["_sentry_native_tls"]
sentry_rustls = ["_sentry_rustls"]

native-tls = ["next-binding/__turbo_native_tls"]
rustls-tls = ["next-binding/__turbo_rustls_tls"]

[dependencies]
anyhow = "1.0.66"
backtrace = "0.3"
Expand All @@ -36,7 +39,7 @@ tracing = { version = "0.1.37", features = ["release_max_level_info"] }
tracing-futures = "0.2.5"
tracing-subscriber = "0.3.9"
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",
"__turbo_next_dev_server",
"__turbo_node_file_trace",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/crates/wasm/Cargo.toml
Expand Up @@ -31,7 +31,7 @@ wasm-bindgen-futures = "0.4.8"
getrandom = { version = "0.2.5", optional = true, default-features = false }
js-sys = "0.3.59"
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",
"__feature_mdx_rs",
] }
Expand Down
4 changes: 3 additions & 1 deletion packages/next-swc/package.json
Expand Up @@ -3,8 +3,10 @@
"version": "13.0.8-canary.0",
"private": true,
"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-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",
"cache-build-native": "echo $(ls native)"
},
Expand Down
4 changes: 4 additions & 0 deletions turbo.json
Expand Up @@ -9,6 +9,10 @@
"dependsOn": ["^build-native-no-plugin"],
"outputs": ["native/*.node"]
},
"build-native-no-plugin-woa": {
"dependsOn": ["^build-native-no-plugin-woa"],
"outputs": ["native/*.node"]
},
"build-wasm": {
"dependsOn": ["^build-wasm"],
"outputs": ["crates/wasm/pkg/*"]
Expand Down

0 comments on commit 0a26710

Please sign in to comment.