|
|
|
Prebuilt Node.js Sidecar for Landโ๐๏ธ
VS Code ships one
Node.jsbinary and detects the platform at runtime, with fallback chains that fail in edge cases - Alpine Linux, custom glibc versions, ARM configurations. SideCarโ๐ packages the exactNode.jsbinary for each target triple at compile time, soCocoonโ๐ฆ always gets the binary that matches the host. No runtime detection, no fallback chains, no surprises.
"The right binary, for the right platform, at the right time."
Rust API Documentationโ๐
SideCarโ๐ is the prebuilt Node.js sidecar repository for
the Landโ๐๏ธ Code Editor. It packages platform-specific
Node.js binaries organized by target triple so that
Cocoonโ๐ฆ - Land's Node.js extension host - receives the exact
runtime binary that matches the target platform. SideCar replaces runtime
detection and fallback chains with a single deterministic lookup at build time.
VS Code ships one Node.js binary and detects the platform at runtime - a
strategy that breaks on Alpine Linux, custom glibc versions, and ARM
configurations. SideCar eliminates this class of failure entirely by bundling
the correct binary per target triple at compile time.
SideCar is engineered to:
- Provide Portable Runtimes - Ship vendored
Node.jsbinaries that eliminate user dependency requirements and system-Node.jscoupling. - Enable Deterministic Builds - Organize binaries by target triple for build-time binary selection with no runtime detection.
- Support Multiple Platforms - Comprehensive matrix for
macOS,Linux, andWindowsonx86_64andaarch64architectures. - Automate Download Management - Automated fetching, caching, and
Git LFSmanagement of runtime binaries via theDownloadRust tool.
Deterministic Binary Selection - Binaries are organized by target triple
(aarch64-apple-darwin/, x86_64-unknown-linux-gnu/, etc.).
Mountain'sโโฐ๏ธ build.rs selects the correct binary at compile time -
Cocoonโ๐ฆ receives a path, never a guess.
Concurrent Downloads - The Download Rust binary uses Tokio for parallel
fetching of multiple runtime binaries from nodejs.org, maximizing throughput
across the full platform matrix.
Intelligent Caching - Cache.json tracks downloaded versions per target
triple. Subsequent runs skip already-fetched binaries, avoiding redundant
downloads and enabling incremental updates.
Version Resolution - Automatic resolution of major versions (e.g., 22) to
the latest patch release from nodejs.org distribution feeds. No manual version
pinning required.
Git LFS Integration - Automatic .gitattributes management for large
binary tracking. The Download tool updates Git LFS pointers, keeping the
repository lean while binaries remain accessible.
Platform Matrix - Coverage for x86_64 and aarch64 across macOS
(apple-darwin) and Linux (unknown-linux-gnu), plus x86_64 on Windows
(pc-windows-msvc).
| Principle | Description | Key Components |
|---|---|---|
| Deterministic Delivery | Package the exact Node.js binary per target triple at compile time. No runtime detection, no fallback chains, no surprises. |
build.rs, target-triple directories, Cache.json |
| Build-Time Integration | Mountain'sโโฐ๏ธ build system selects the correct binary from SideCar during the Tauri installer build. Cocoonโ๐ฆ receives a path, never a runtime decision. |
build.rs binary selection logic, Source/Download.rs |
| Automated Sourcing | Fetch, verify, and cache official Node.js distributions with parallel Tokio downloads and intelligent version resolution. |
Source/Download.rs, Cache.json, .gitattributes |
| Platform Completeness | Cover every target triple Landโ๐๏ธ ships on - no edge case left to a runtime fallback. | Target-triple directory layout, versioned subdirectories |
graph LR
classDef sidecar fill:#d0d8ff,stroke:#4a6fa5,stroke-width:2px,color:#001050;
classDef external fill:#ebebeb,stroke:#888,stroke-width:1px,stroke-dasharray:5 5,color:#333;
classDef storage fill:#cce8ff,stroke:#2980b9,stroke-width:1px,color:#003050;
classDef mountain fill:#f0d0ff,stroke:#9b59b6,stroke-width:2px,color:#2c0050;
classDef cocoon fill:#d0f0d0,stroke:#27ae60,stroke-width:1px,color:#0a3a0a;
subgraph SOURCES["External Sources"]
NodeJSOrg["nodejs.orgโofficial distributions"]:::external
end
subgraph SIDECAR["SideCarโ๐ - Prebuilt Node.js Sidecar"]
direction TB
subgraph TOOL["Source/ - Download Tool (Rust binary)"]
DownloadBin["Download.rsโโฌโfetch ยท verify ยท organiseโTokio parallel downloads"]:::sidecar
CacheJSON["Cache.jsonโ๐พโversion trackingโskip redundant downloads"]:::sidecar
GitLFS[".gitattributesโ๐ฆโGit LFS pointersโfor large binaries"]:::sidecar
DownloadBin --> CacheJSON
DownloadBin --> GitLFS
end
subgraph LAYOUT["Target-Triple Layout"]
Darwin_ARM["aarch64-apple-darwin/โ๐โApple Silicon"]:::storage
Darwin_x86["x86_64-apple-darwin/โ๐ฅโmacOS Intel"]:::storage
Win_x86["x86_64-pc-windows-msvc/โ๐ชโWindows x64"]:::storage
Linux_ARM["aarch64-unknown-linux-gnu/โ๐งโLinux ARM64"]:::storage
Linux_x86["x86_64-unknown-linux-gnu/โ๐งโLinux x64"]:::storage
end
BuildRS["build.rsโ๐งโbinary selection at build timeโstages correct triple into installer"]:::sidecar
DownloadBin --> LAYOUT
BuildRS --> LAYOUT
end
subgraph CONSUMERS["Consumers at Runtime"]
Mountain["Mountainโโฐ๏ธโbuild.rs bundles chosen binaryโinto Tauri installer"]:::mountain
Cocoon["Cocoonโ๐ฆโreceives correct Node.js binaryโno runtime detection needed"]:::cocoon
end
NodeJSOrg --> DownloadBin
LAYOUT --> BuildRS
BuildRS --> Mountain
Mountain -- spawns with Spawn.rs --> Cocoon
Data flow paths:
| Path | Mechanism | Description |
|---|---|---|
nodejs.org โ Download |
HTTP fetch via reqwest |
Official Node.js distribution archives fetched in parallel |
Download โ Target directories |
Filesystem extraction | Archives extracted and organized by target triple |
Download โ Cache.json |
serde_json serialization |
Version metadata written to avoid redundant downloads |
Download โ .gitattributes |
File write | Git LFS tracking rules updated for large binaries |
Target directories โ build.rs |
Filesystem read | Build script selects correct binary for the target triple |
build.rs โ Mountain |
Cargo build integration | Selected binary staged into the Tauri installer bundle |
Mountain โ Cocoon |
Process spawn via Spawn.rs |
Correct Node.js binary launched at runtime |
| Component | Path | Description |
|---|---|---|
| Download Tool | Source/Download.rs |
Main binary: fetches, verifies, and organizes platform binaries from nodejs.org |
| Library | Source/Library.rs |
Module declarations and shared utilities |
| Binary Entry | Source/main.rs |
Binary entry point for the download tool |
| Build Script | build.rs |
Binary selection and staging for the Tauri installer; reads Cargo.toml version |
| DNS Override | Resource/dns-override.js |
Shared Node.js resource for DNS resolution customization |
| Cache | Cache.json |
Download cache metadata tracking fetched versions per target triple |
| Git Attributes | .gitattributes |
Git LFS pointer rules for large binary tracking |
Element/SideCar/
โโโ Source/
โ โโโ Download.rs # Main download binary: fetch, verify, organize
โ โโโ Library.rs # Module declarations and shared utilities
โ โโโ main.rs # Binary entry point
โโโ build.rs # Build script: binary selection and staging
โโโ Cache.json # Download cache metadata (version tracking)
โโโ .gitattributes # Git LFS pointer rules for large binaries
โโโ Resource/
โ โโโ dns-override.js # DNS resolution customization resource
โโโ aarch64-apple-darwin/ # macOS Apple Silicon binaries
โโโ x86_64-apple-darwin/ # macOS Intel binaries
โโโ x86_64-pc-windows-msvc/ # Windows x64 binaries
โโโ aarch64-unknown-linux-gnu/ # Linux ARM64 (glibc) binaries
โโโ x86_64-unknown-linux-gnu/ # Linux x64 (glibc) binaries
โโโ Temporary/ # Temporary workspace for downloads
โโโ Documentation/
โ โโโ GitHub/ # GitHub-specific documentation
โ โ โโโ Architecture.md # Detailed architecture document
โ โ โโโ DeepDive.md # Technical deep-dive
โ โโโ Rust/ # Cargo doc output
โโโ Cargo.toml
SideCar vendored binaries are the compile-time source of truth for
Cocoon'sโ๐ฆ Node.js runtime. During the application build,
Mountain'sโโฐ๏ธ build.rs orchestrator selects the correct binary
from SideCar based on the target triple. Cocoonโ๐ฆ receives a
deterministic path - no runtime detection, no fallback chains, no
platform-specific edge cases.
| Consumer | Language | How SideCar Delivers | Integration Point |
|---|---|---|---|
| Cocoonโ๐ฆ | TypeScript, JavaScript |
Platform-matched Node.js binary at a known path |
Mountain'sโโฐ๏ธ build.rs bundles the binary; Cocoonโ๐ฆ spawns it |
| Mountainโโฐ๏ธ | Rust / Tauri |
Selected binary staged into the Tauri installer | build.rs reads target-triple directory at compile time |
The Download Rust binary populates the SideCar directory structure once during
project setup by fetching official distributions from nodejs.org and
organizing them by target triple convention. Subsequent runs only fetch new or
updated versions.
- Rust 1.75 or later
Git LFSinstalled and configured (for binary tracking)
cd Element/SideCar
cargo build --release# Fetch and organize all platform binaries
./Target/release/DownloadThe SideCar directory is populated once during project setup:
- Build Download Tool: Compile the
Downloadbinary fromSource/Download.rs - Run Download: Execute to fetch and organize all runtime binaries
- Build Mountainโโฐ๏ธ: The build system selects appropriate binaries from SideCar at compile time
[!NOTE] The target-triple directories (
aarch64-apple-darwin/,x86_64-unknown-linux-gnu/, etc.) are populated by theDownloadRust binary and contain large, third-party binaries. These directories should not be committed directly to version control - useGit LFSvia the auto-managed.gitattributesfile. TheDownloadtool should be run once to vendor the dependencies as part of the initial project setup.
SideCar enforces binary integrity at multiple layers:
| Layer | Mechanism |
|---|---|
| Source of Truth | Binaries are fetched exclusively from nodejs.org official distribution feeds - no third-party mirrors |
| Checksum Verification | Download Rust binary validates SHA-256 checksums against nodejs.org published hashes before extraction |
| Build-Time Selection | Mountain'sโโฐ๏ธ build.rs selects the exact binary for the target triple at compile time - runtime substitution is not possible |
| Git LFS Integrity | Large binaries tracked through Git LFS with auto-managed .gitattributes pointer rules |
SideCar is designed to integrate with:
| Target | Integration |
|---|---|
| Cocoonโ๐ฆ | Provides the exact Node.js binary at a deterministic path - no runtime detection |
| Mountainโโฐ๏ธ | Binary selected at compile time via build.rs; staged into Tauri installer |
| nodejs.org | Official distribution source; version resolution via download index |
| Git LFS | Large binary tracking via auto-managed .gitattributes |
- Rust API Documentationโ๐
- Architecture Overview - Land system architecture
- Why Rust - Why
Rustfor the download tooling - Mountainโโฐ๏ธ - Native desktop shell - GitHub
- Cocoonโ๐ฆ -
Node.jsextension host - GitHub
This project is released into the public domain under the Creative Commons CC0
Universal license. You are free to use, modify, distribute, and build upon
this work for any purpose, without any restrictions. For the full legal text,
see the LICENSE
file.
Stay updated with our progress! See
CHANGELOG.md
for a history of changes.
Landโ๐๏ธ is proud to be an open-source endeavor. Our journey is significantly supported by the organizations and projects that believe in the future of open-source software.
This project is funded through NGI0 Commons Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.
| Land | PlayForm | NLnet | NGI0 Commons Fund |
|---|---|---|---|
Project Maintainers: Source Open (Source/Open@editor.land) | GitHub Repository | Report an Issue | Security Policy