Skip to content

Commit 8ae2df0

Browse files
jridgewellsokra
authored andcommitted
Integrate next-* crates from Turbopack (vercel#47019)
Update workspace cargo deps Update cargo deps to point to local workspace Ignore too-many-arguments warnings Fix clippy errors Update pnpm workspaces exclude integration tests from unit tests CI rust-analyzer settings add rust flags and env vars
1 parent b98469c commit 8ae2df0

File tree

17 files changed

+1936
-2307
lines changed

17 files changed

+1936
-2307
lines changed

.alexignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
CODE_OF_CONDUCT.md
22
examples/
3+
**/*/LICENSE.md

.github/workflows/build_test_deploy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ jobs:
11271127
toolchain: ${{ env.RUST_TOOLCHAIN }}
11281128
profile: minimal
11291129

1130-
- run: cd packages/next-swc && cargo test
1130+
- run: cd packages/next-swc && cargo test --workspace --exclude next-dev-tests
11311131
if: ${{ steps.swc-change.outputs.SWC_CHANGE == 'yup' }}
11321132

11331133
test-wasm:

.vscode/settings.json

+11
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,16 @@
5757
"explorer.fileNesting.patterns": {
5858
"*.ts": "$(capture).test.ts, $(capture).test.tsx",
5959
"*.tsx": "$(capture).test.ts, $(capture).test.tsx"
60+
},
61+
62+
// Allow to find the cargo project for rust-analyzer.
63+
"rust-analyzer.linkedProjects": ["packages/next-swc/Cargo.toml"],
64+
// Compile rust-analyzer in a separate directory to avoid conflicts with the main project.
65+
"rust-analyzer.checkOnSave.extraEnv": {
66+
"CARGO_TARGET_DIR": "target/rust-analyzer"
67+
},
68+
"rust-analyzer.server.extraEnv": {
69+
"CARGO_TARGET_DIR": "target/rust-analyzer",
70+
"RUST_BACKTRACE": "0"
6071
}
6172
}

packages/next-swc/.cargo/config.toml

+18-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
1+
[env]
2+
CARGO_WORKSPACE_DIR = { value = "", relative = true }
13

24
[build]
35

46
rustdocflags = []
57

8+
[target.x86_64-pc-windows-msvc]
9+
linker = "rust-lld"
10+
611
[target.aarch64-unknown-linux-gnu]
712
linker = "aarch64-linux-gnu-gcc"
813

914
[target.aarch64-unknown-linux-musl]
1015
linker = "aarch64-linux-musl-gcc"
1116
rustflags = [
12-
"-C",
13-
"target-feature=-crt-static",
14-
"-C",
15-
"link-arg=-lgcc",
17+
"--cfg",
18+
"tokio_unstable",
19+
"-Csymbol-mangling-version=v0",
20+
"-Ctarget-feature=-crt-static",
21+
"-Clink-arg=-lgcc",
1622
]
1723

1824
[target.armv7-unknown-linux-gnueabihf]
1925
linker = "arm-linux-gnueabihf-gcc"
26+
27+
[target.'cfg(all())']
28+
rustflags = [
29+
"--cfg",
30+
"tokio_unstable",
31+
"-Csymbol-mangling-version=v0",
32+
"-Aclippy::too_many_arguments"
33+
]

0 commit comments

Comments
 (0)