SideCar is a Rust library and two binaries that manage pre-compiled native dependency binaries for Land. It handles download, caching and placement of Node.js runtime binaries across multiple target platforms, integrating with Mountain at build time and with the spawned runtime at launch.
The element’s own module documentation is explicit about one limit: checksum verification of downloads is not performed today. Everything below describes what the code does, not what a vendoring pipeline usually does.
Architecture
| Attribute | Value |
|---|---|
| Language | Rust (edition 2024) |
| Crate type | Library + two binaries (SideCar, Download) |
| Dependencies | tokio, reqwest, serde, zip, tar, flate2, Mist, Common |
| Consumed by | Mountain (build-time binary selection) |
| Storage | SideCar/Cache.json + per-platform cached binaries |
Module Map
| Path | Purpose |
|---|---|
Source/Download.rs |
Version resolution, parallel download, archive extraction, Cache.json upkeep |
Source/Library.rs |
Library root - re-exports the Download module |
Source/main.rs |
SideCar entry point: initialises telemetry, then runs Download::Fn() |
Source/Download.rs also declares a second binary, Download, for standalone
vendoring runs. The library is deliberately thin: there is one module, and both
binaries drive it.
Binary Resolution
The resolution process maps a major Node version to the latest published patch for a target triple:
flowchart TD
A["Build.sh reads NodeVersion and NodePlatform from .env.Land"] --> B["Download::Fn()"]
B --> C{"Cache.json has triple/NODE/major?"}
C -->|"CACHED"| D["Reuse the recorded full version"]
C -->|"NOT CACHED"| E["FetchNodeVersions() - nodejs.org version index"]
E --> F["ResolveLatestPatchVersion(major, versions)"]
F --> G["Construct download URL<br/>https://nodejs.org/dist/v{version}/node-v{version}-{platform}.tar.gz"]
G --> H["Download and extract (no checksum verification)"]
H --> I["Place binary under the element's per-platform tree"]
I --> J["Record triple/NODE/major -> v{full version} in Cache.json"]
J --> K["Return resolved binary path to Mountain"]
Version Resolution Priority
- The
majorcomponent ofNodeVersion- the build asks for24, not24.18.0 FetchNodeVersions()reads the published index from nodejs.org once per runResolveLatestPatchVersion()picks the highestv{major}.*it findsCache.jsonrecords the resolved full version, keyed by triple and major
Because the cache key is the major version and the value is the full version, a cached entry is a record of what was last resolved - it does not pin the version for future runs unless the cache is consulted first.
Download System
The Download module handles archive retrieval and extraction:
| Operation | Description |
|---|---|
| URL construction | Builds the platform-specific URL from version and platform string |
| HTTP download | Streaming download with timeout and retry |
| Archive extraction | .tar.gz decompression with platform prefix stripping |
| Binary placement | Single binary extracted into the element’s per-platform tree |
| Cache update | Writes the resolved full version into Cache.json |
There is no integrity step. SideCar/Cargo.toml has no hashing crate, and
Source/Download.rs says so twice: the pipeline cleans up temporary files on
completion “(no checksum verification …)” and notes that “checksum
verification is not performed today, so checksum mismatches cannot arise”.
Download Flow
1. FetchNodeVersions() -> GET the nodejs.org version index
2. ResolveLatestPatchVersion(major, versions) -> the full version to fetch
3. HTTP GET https://nodejs.org/dist/v{version}/node-v{version}-{platform}.tar.gz
4. Stream to a temporary download file with progress tracking
5. Extract the node binary from the archive
6. Place it in the element's per-platform tree
7. Update Cache.json
Supported Platforms
| Target Triple | Platform String | Archive Pattern |
|---|---|---|
aarch64-apple-darwin |
darwin-arm64 |
node-v{version}-darwin-arm64.tar.gz |
x86_64-apple-darwin |
darwin-x64 |
node-v{version}-darwin-x64.tar.gz |
aarch64-unknown-linux-gnu |
linux-arm64 |
node-v{version}-linux-arm64.tar.gz |
x86_64-unknown-linux-gnu |
linux-x64 |
node-v{version}-linux-x64.tar.gz |
Caching Strategy
SideCar maintains a JSON manifest at SideCar/Cache.json.
The schema is a flat map, not a record per download:
{
"Entries": {
"aarch64-apple-darwin/NODE/24": "v24.18.0",
"aarch64-unknown-linux-gnu/NODE/24": "v24.18.0",
"x86_64-apple-darwin/NODE/22": "v22.23.1"
}
}
| Cache field | Type | Description |
|---|---|---|
| Key | String | {target-triple}/{sidecar-name}/{major-version} |
| Value | String | The full version string last downloaded successfully, e.g. v24.18.0 |
There is no sha256, path, downloaded_at or size field, because nothing
computes or needs them today. An entry is invalidated when the major version
asked for changes, when the recorded full version is superseded on nodejs.org,
or when the file is cleared by hand.
Related Documentation
- SideCar - Deep Dive - module internals, the cache schema in full, and the platform matrix
- Mountain - Main backend (binary consumer)
- Mist / Mist architecture - DNS isolation for spawned processes
- BuildPipeline - Build pipeline integration
- RustInfrastructure - Rust backend components
Project Maintainers: Source Open (Source/[email protected]) | GitHub Repository | Report an Issue
The record this page documents, as the site files it: the six facts the claim is checked against, and the three files the manual names to check it.
WORKING, 06
- FORM:
- PREBUILT BINARY
- WRITTEN IN:
- NODE.JS
- BOUNDARY:
- PROCESS SPAWN
- DEPENDS ON:
- COCOON
- MANUAL:
- /DOC/DEEP-DIVE-SIDECAR
- EVIDENCE:
- UNAVAILABLE NO MANIFEST IN THE BUILD
# TRACE / SIDECAR 03 STEPS
- 01
Source/Download.rsTHE DOWNLOAD - 02
SideCar/Cache.jsonTHE CHECKSUM CACHE - 03
GetTauriTargetTriple.rsTHE TARGET TRIPLE
SOURCE: /DOC/DEEP-DIVE-SIDECAR