Skip to content

Commit d4fd6cb

Browse files
authored
chore: avoid multiple rustup installation (#1571)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated build configuration to account for Rust/Cargo toolchain changes, ensuring WASM-related builds automatically re-run when the toolchain updates. * Standardized repository configuration to the latest schema for improved compatibility. * Added an internal script to surface the Rust/Cargo version for build orchestration. No user-facing behavior changes; these updates improve build reliability and consistency across environments. <!-- end of auto-generated comment: release notes by coderabbit.ai --> This is used to avoid downloading Rust toolchain in parallel, which could cause error. See: https://github.com/lynx-family/lynx-stack/actions/runs/17091970609/job/48467545202?pr=1569 > [!NOTE] > We would run `turbo build` first on CI. And if no cache hit for `cargo build` tasks, we would setup Rust toolchain and re-run build again. > > But this is a little different with the Windows runner. Since there are `cargo` and `rustup` on the Windows runner, we would start downloading Rust toolchain in parallel in the first `turbo build`. ## Checklist <!--- Check and mark with an "x" --> - [ ] Tests updated (or not required). - [ ] Documentation updated (or not required). - [ ] Changeset added, and when a BREAKING CHANGE occurs, it needs to be clearly marked (or not required).
1 parent cf46821 commit d4fd6cb

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"license": "Apache-2.0",
88
"type": "module",
99
"scripts": {
10+
"_internal:cargo:version": "cargo --version",
1011
"build": "tsc --build",
1112
"prepare": "husky && ts-patch install",
1213
"test": "vitest"

packages/react/transform/turbo.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"outputs": ["index.d.ts", "index.cjs", "*.node"]
88
},
99
"build:wasm": {
10+
"dependsOn": [
11+
"//#_internal:cargo:version"
12+
],
1013
"inputs": ["src/**/*.rs", "src/wasm.js", "build.rs", "Cargo.toml", "scripts/build_wasm.sh"],
1114
"outputs": ["dist/wasm.cjs"]
1215
},

packages/web-platform/web-style-transformer/turbo.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"tasks": {
55
"build": {
66
"dependsOn": [
7+
"//#_internal:cargo:version",
78
"build:wasm-bindgen"
89
],
910
"inputs": [

turbo.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://turbo.build/schema.json",
2+
"$schema": "https://turborepo.com/schema.json",
33
"globalPassThroughEnv": [
44
"CI",
55
"COREPACK_INTEGRITY_KEYS",
@@ -25,6 +25,15 @@
2525
"dependsOn": [],
2626
"cache": false
2727
},
28+
"//#_internal:cargo:version": {
29+
"env": ["GITHUB_SHA"],
30+
"dependsOn": [],
31+
"inputs": [
32+
"rust-toolchain",
33+
"rust-toolchain.toml"
34+
],
35+
"outputs": []
36+
},
2837
"//#build": {
2938
"cache": false,
3039
"dependsOn": [],

0 commit comments

Comments
 (0)