You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bcad439
Browse filesBrowse the repository at this point in the historyBrowse files
This page sets how platform code is written, where platform tests go, and how CI runs only the crates a change affects. The plugin contract and SDK rules live in [`shared/plugins/README.md`](shared/plugins/README.md).
72
+
This page sets how platform code is written, where platform tests go, how CI runs only the crates a change affects, and how the pinned Rust release is upgraded. The plugin contract and SDK rules live in [`shared/plugins/README.md`](shared/plugins/README.md).
63
73
64
74
## Platform differences are data
65
75
@@ -94,7 +104,7 @@ test-features = ["server"] # features the tests need, enabled on every host
94
104
[`.github/workflows/rust-core.yml`](.github/workflows/rust-core.yml) has four jobs:
95
105
96
106
-**Select crates** tests the CI scripts, runs the placement check above, and lets [`affected-crates.mjs`](scripts/rust-core/affected-crates.mjs) choose crates from the files the pull request changes: the crate each file belongs to, plus every crate that depends on it directly or indirectly, through any kind of dependency, dev-dependencies included. Other files are handled as follows:
97
-
- These select every crate: files under `rust/` outside any crate (the workspace manifest, `Cargo.lock`, `fixtures/`, `contracts/`, `logging/`), `shared/plugins/contract/`, `scripts/rust-core/`, `scripts/logging/` and the workflow itself.
107
+
- These select every crate: files under `rust/` outside any crate (the workspace manifest, `Cargo.lock`, `fixtures/`, `contracts/`, `logging/`), `shared/plugins/contract/`, `scripts/rust-core/`, `scripts/logging/`, `rust-toolchain.toml` and the workflow itself.
- Documentation, the SDKs and other files select no crate.
100
110
-**Linux** runs, for the selected crates: the formatting check (every crate; it is quick), the log event catalog check, the comment rules (the textual checks cover every crate, Rustdoc builds the selected ones), clippy with every feature, clippy for `x86_64-pc-windows-msvc` with default features, and the tests with their `test-features`.
@@ -103,6 +113,16 @@ test-features = ["server"] # features the tests need, enabled on every host
103
113
104
114
A manual run (workflow_dispatch) checks every crate. CI caches downloaded dependencies only, not build output.
105
115
116
+
## Toolchain
117
+
118
+
[`rust-toolchain.toml`](rust-toolchain.toml) at the repository root pins the Rust release. Local builds and CI use the same release, so lints added by a new clippy show up only when the pin is upgraded, never in an unrelated pull request.
119
+
120
+
- When `cargo` runs in this repository, rustup installs and uses that release; there is no need to change the default toolchain. Rust installed without rustup, for example by Homebrew, ignores the file; use rustup instead.
121
+
- Extra targets are added to the pinned release: run `rustup target add x86_64-pc-windows-msvc` in the repository before the Windows clippy below.
122
+
- An upgrade changes, in one pull request, the `channel` in `rust-toolchain.toml` and every `dtolnay/rust-toolchain@<version>` in `.github/workflows` except `@1.87`, and fixes what the new release reports. Both places must spell the version the same way, for example `1.100.0` in each: rustup treats `1.100` and `1.100.0` as two toolchains, and a mismatch makes CI install a second one without clippy, rustfmt or the Windows target.
123
+
- Lithe-IDEA builds Core with the `rust-toolchain.toml` at its own repository root. Once a Core upgrade is merged, Lithe-IDEA moves to the same release.
124
+
- The Rust plugin SDK (`shared/plugins/sdk/rust`) keeps its minimum `rust-version = "1.87"` whatever the pin is; CI tests it with `cargo +1.87`.
@@ -409,7 +409,7 @@ When a change touches the contract, a capability version, or the plugin function
409
409
|`node --test shared/plugins/sdk/node/test/*.test.mjs`| Node.js SDK unit tests |
410
410
|`npm run --prefix shared/plugins/sdk/node test:types`| Node.js SDK TypeScript consumer check; first run `npm ci --prefix shared/plugins/sdk/node --ignore-scripts` to install the development dependencies |
411
411
|`mvn -B -ntp -f shared/plugins/sdk/java/pom.xml verify`| Java SDK unit tests; add `-Djvm=<java>` to choose the Java that runs them (CI uses Java 8) |
412
-
|`cargo test --locked --manifest-path shared/plugins/sdk/rust/Cargo.toml`| Rust SDK unit tests (CI uses Rust 1.87, plus stable for `cargo fmt` and `cargo clippy`) |
412
+
|`cargo test --locked --manifest-path shared/plugins/sdk/rust/Cargo.toml`| Rust SDK unit tests (CI uses Rust 1.87, plus the release `rust-toolchain.toml` pins for `cargo fmt` and `cargo clippy`) |
413
413
|`node shared/plugins/scripts/sdk-e2e.mjs`| End-to-end tests: builds the sample backends of the three SDKs, then runs the four tests `plugin_sdk_node`, `plugin_sdk_java`, `plugin_sdk_rust`, and `plugin_sdk_build` of `cargo test -p lithe-core --features plugin-sdk-e2e` against the **Core in the current working tree**; it always includes the native build workflow and shortcut import scenarios |
414
414
415
415
The end-to-end tests need Rust, Node.js 20.3+, Java (set `LITHE_PLUGIN_SDK_JAVA_RUNTIME`, or have `java` on `PATH`), and Maven. The scenario files are in [`sdk/e2e/`](sdk/e2e): Node.js and Java run the same build backend scenarios, Rust runs the plugin backend scenario (`plugin_sdk/backend.rs`), and the test answers credential requests in place of the host. `LITHE_PLUGIN_SDK_JAVA_SAMPLE`, `LITHE_PLUGIN_SDK_JAVA_NATIVE_SAMPLE`, and `LITHE_PLUGIN_SDK_RUST_SAMPLE` can point at already built samples to skip building them.
0 commit comments