Skip to main content

SHEET 06 OF 41

/DOC/:SLUG

PART:
03 DOCUMENTATION
CIRCULATION:
PUBLIC
SOURCE:
pages/Doc/[...Slug].astro
AS OF:
2026-12-02

Platform triple matrix, the vendoring pipeline, the real Cache.json schema, the per-triple Node distribution layout, DNS override resource, and version resolution without checksum verification.

/Deep Dive

SideCar - Deep Dive

Platform triple matrix, the vendoring pipeline, the real Cache.json schema, the per-triple Node distribution layout, DNS override resource, and version resolution without checksum verification.

PUBLISHED DEEP DIVE Source/Content/doc/deep-dive-sidecar.md UNAVAILABLE UNAVAILABLE ARCHITECTURE 10

STATUS UNAVAILABLE NEXT OPEN THE ELEMENT'S MANUAL - IT DESCRIBES THE THING THE CAPTURE WOULD HAVE SHOWN.

# PLATE_01 / SIDECAR

FIGURE: The capture this record's evidence would show: rail track in low light.

This element has no evidence manifest in the build, so there is no capture to describe. The record above still prints its working - form, boundary, dependencies, manual and trace - and none of those fields is a picture.

SUBJECT:
RAIL TRACK IN LOW LIGHT
MANIFEST:
UNAVAILABLE
STATE:
UNAVAILABLE
PLATE:
UNAVAILABLE

SOURCE: SOURCE/CONTENT/ELEMENT/WORKING.TS

SideCar provides the technical foundation for the binary distribution layer within the Land project. SideCar manages pre-compiled, platform-specific runtime binaries (primarily Node.js) so that the Land editor can bundle vendored runtimes without requiring users to install them separately.


Architecture

SideCar is one crate with two binaries and one module. SideCar (Source/main.rs) initialises telemetry and runs the vendoring pipeline; Download (Source/Download.rs) is the same pipeline exposed as a standalone binary; Source/Library.rs re-exports the module. There is no spawn helper in this crate - Mountain resolves the vendored binary itself.

Mermaid diagram

Key Modules

Path Description
Source/Download.rs The whole pipeline: platform matrix, sidecar list, version index fetch, parallel download, extraction, Cache.json, .gitattributes
Source/Library.rs Library root - pub mod Download; and nothing else
Source/main.rs SideCar entry point: telemetry init, then Download::Fn()
build.rs Cargo build script: rerun-if-changed for Cargo.toml and Resource/dns-override.js, and a version env var
Resource/dns-override.js The preload script that points a spawned Node runtime at Mist
Cache.json Records which full version was last resolved for each {triple}/{name}/{major}
.gitattributes Maintained by the pipeline so large binaries are tracked with Git LFS

Data Flow

Mermaid diagram

The vendoring pipeline

Download::Fn() runs in three phases.

1. Task generation. GetPlatformMatrix() returns the platform list, and GetSidecarsToFetch() returns the sidecar list. Both are compiled into Source/Download.rs - there is no environment variable that changes them:

Download identifier Tauri target triple Archive
win-x64 x86_64-pc-windows-msvc .zip
linux-x64 x86_64-unknown-linux-gnu .tar.gz
linux-arm64 aarch64-unknown-linux-gnu .tar.gz
darwin-x64 x86_64-apple-darwin .tar.gz
darwin-arm64 aarch64-apple-darwin .tar.gz

The sidecar table declares one entry, NODE, with nine major versions: 24, 23, 22, 21, 20, 19, 18, 17, 16. Five platforms times nine majors is forty-five download tasks, not six.

2. Version resolution. FetchNodeVersions() reads the published version index once, and ResolveLatestPatchVersion(major, versions) picks the highest v{major}.* entry. A task whose major has no published version logs Could not resolve a specific version for Node.js v{major}. Skipping. and is dropped rather than failing the run.

3. Download and place. Each task streams the archive to a temporary file, extracts it under {triple}/{SidecarName}/{major}/, and records the resolved full version in Cache.json. The HTTP client sets an explicit request timeout and connect timeout, because reqwest defaults both to None and a peer that stops answering would otherwise hang the pipeline.

Build-Time Selection

The vendored tree is consumed at build time, not copied by this crate’s build.rs. The per-triple directory holds a complete Node distribution, so the consumer picks {triple}/NODE/{major}/bin/node (or node.exe) from the tree it needs.

Runtime spawn

At runtime Mountain’s ProcessManagement/CocoonManagement.rs spawns Cocoon with the vendored Node.js binary and passes:

Because the binary was selected at build time, no runtime detection or version negotiation is needed. The crate itself has no spawn helper - the resolver lives in Mountain, and Maintain supplies the target-triple helper that both sides read.


Integration Points

Connecting Element Direction Mechanism Description
Mountain Consumer Vendored tree Mountain selects the Node.js binary for its target triple from the vendored tree
Tauri Consumer Sidecar resource bundling Tauri bundles the selected binary into the platform installer
Cocoon Runtime dependency Spawned process Mountain spawns Cocoon using the vendored Node.js binary from the SideCar store
Mist Runtime dependency Resource/dns-override.js The preload script points the spawned runtime’s resolver at the local DNS server
Air Potential consumer Same convention Additional daemon binaries may be vendored using the same target-triple structure

Configuration

Parameter Convention / Value Description
Directory structure {target-triple}/{NAME}/{major}/ Full runtime distribution, not a single binary
Target triples x86_64-pc-windows-msvc, aarch64-apple-darwin, x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, x86_64-apple-darwin The five GetPlatformMatrix() entries
Node.js majors 16 through 24 The nine entries in GetSidecarsToFetch()
Cache file Cache.json JSON map of { "[triple]/[name]/[major]": "[resolved-version]" }
Git LFS .gitattributes auto-updated Binary paths tracked via LFS
Log level RUST_LOG error, warn, info, debug or trace; defaults to info

The SideCar directory is not committed to version control in its populated form. Developers run the Download tool once during initial project setup, and CI environments run it as part of the release pipeline.


Platform triple detection

There is no runtime triple detection in the pipeline: GetPlatformMatrix() is a fixed table, and it downloads every platform on every run. The mapping from Rust target triple to Node.js download identifier is the one in the table above.

At build time the consumer’s own tooling reads CARGO_BUILD_TARGET to decide which subdirectory to use; Maintain exposes that as GetTauriTargetTriple.rs.

Binary resolution cascade

1. GetPlatformMatrix()  -> five triples
2. GetSidecarsToFetch() -> NODE x {16..24}
3. FetchNodeVersions()  -> the published index, once per run
4. ResolveLatestPatchVersion(major, versions)
       RESOLVED: continue
       NOT FOUND: log and skip this task

5. HTTP GET https://nodejs.org/dist/v{full}/node-v{full}-{identifier}.{ext}
       Stream to a temporary file

6. Extract the archive under {triple}/NODE/{major}/
       .tar.gz: flate2 + tar
       .zip:    the zip crate

7. Write Cache.json: "{triple}/NODE/{major}" -> "v{full}"
8. Append any new binary path to .gitattributes for Git LFS

Downloads for all platforms run concurrently using Tokio’s async I/O.

Download integrity verification

There is none today. Source/Download.rs states it 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”. SideCar/Cargo.toml declares no hashing crate, and no code path fetches SHASUMS256.txt.

That is a real limitation, not a documentation gap: an archive is trusted on the strength of TLS to nodejs.org alone. Any statement elsewhere that this pipeline verifies SHA-256 describes a capability the crate does not have.

Cache schema

DownloadCache is a single flat map:

{
	"Entries": {
		"aarch64-apple-darwin/NODE/24": "v24.18.0",
		"x86_64-unknown-linux-gnu/NODE/16": "v16.20.2"
	}
}
Field Type Description
Key String {target-triple}/{sidecar-name}/{major-version}
Value String The full version last downloaded successfully, e.g. v24.18.0

Load() treats a missing or unparsable file as an empty cache and logs it, so a corrupt Cache.json costs a re-download rather than a failure. There is no sha256, path, downloaded_at or size field.

Cache directory structure

SideCar/
    aarch64-apple-darwin/
        NODE/
            20/
                bin/node
                include/
                lib/
                share/
                LICENSE
            24/
                ...
    x86_64-pc-windows-msvc/
        NODE/
            24/
                node.exe
                ...
    Cache.json
    .gitattributes     <- maintained by the download tool for Git LFS

Each major directory holds a full Node distribution, because the archive is extracted whole rather than cherry-picked for the binary.

Handling version mismatches

A “mismatch” is just a cache miss: the key includes the major version, so asking for 24 when the cache holds 22 produces a new key and a fresh download. Old majors are not deleted; they accumulate until the tree is cleared by hand.

Note

Because the sidecar table lists nine majors, a full run vendors nine Node distributions per platform. That is deliberate - the editor can be pointed at an older major without re-running the pipeline - but it makes the populated tree large, which is why it is not committed.

Git LFS management

The pipeline reads the existing .gitattributes at the root of the SideCar directory and appends LFS tracking rules for any new binary paths it creates:

SideCar/aarch64-apple-darwin/**/* filter=lfs diff=lfs merge=lfs -text

One rule is added per target triple directory. Existing rules are not duplicated, so running the tool repeatedly is idempotent with respect to .gitattributes.

Module reference

File Purpose
Source/Download.rs Platform matrix, sidecar list, version index, parallel download, extraction, Cache.json, .gitattributes
Source/Library.rs pub mod Download;
Source/main.rs Entry point for the SideCar binary
build.rs Cargo build script: rerun-if-changed entries and a version env var; copies nothing
Resource/dns-override.js Preload script pointing a spawned Node runtime at the local DNS server
Cache.json JSON manifest mapping {triple}/{name}/{major} to the resolved full version

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

  1. 01 Source/Download.rs THE DOWNLOAD
  2. 02 SideCar/Cache.json THE CHECKSUM CACHE
  3. 03 GetTauriTargetTriple.rs THE TARGET TRIPLE

SOURCE: /DOC/DEEP-DIVE-SIDECAR

Deep Dive, 15 PAGES, page 10 of 15

THE LAYER'S INDEX

NEXT: /BLOG 04 BLOG

NOTES FROM THE BUILD, NEWEST FIRST

〈06〉 /DOC/:SLUG 41 SHEETS AS OF: 2026-12-02