This guide walks through building the Land code editor from source. The build is a two-step linear flow - do not pull submodules recursively; each submodule is managed independently on its own branch.
- Compile VS Code Source - build the VS Code platform code that the extension host consumes
- Build Land Application - compile the native Rust backend and bundle the TypeScript frontend into a runnable Tauri application
Prerequisites
Before building, ensure you have the following installed:
- Rust (MSRV
1.95.0; the workspace pins thenightlychannel inrust-toolchain.toml) - rustup.rs - Node.js (v24 required for building the Editor submodule) - nodejs.org
- pnpm -
npm install -g pnpm - Git (with LFS support) -
git lfs install - Protocol Buffer compiler (optional, only if modifying
.protofiles)
Use nvm to install and select the required Node version:
nvm install 24
nvm use 24
Note
Node 24 is required specifically to compile the VS Code Editor submodule
(Step 1). The pinned version is tracked in
Dependency/Microsoft/Dependency/Editor/.nvmrc,
which currently names 24.22.1.
Rust Toolchain & Targets
Install the Rust toolchain via rustup and add the necessary compilation
targets. The macOS build targets are required for Mountain (Tauri backend)
and Air (background daemon):
# Install Rust (stable) - the repository's own toolchain file overrides the
# default channel once you are inside the checkout
rustup install stable
rustup default stable
# macOS native targets (Apple Silicon)
rustup target add aarch64-apple-darwin
# macOS native targets (Intel)
rustup target add x86_64-apple-darwin
# Linux targets (cross-compilation support)
rustup target add x86_64-unknown-linux-gnu
rustup target add aarch64-unknown-linux-gnu
Important
Land/rust-toolchain.toml pins the nightly channel and the component set
(rustfmt, clippy, rust-src, rust-analyzer, miri, llvm-tools).
rustup reads that file first inside the checkout, so rustup default stable
only affects commands run outside it. Cargo.toml declares the separate
floor, rust-version = "1.95.0". Neither number should be raised without
auditing the [patch.crates-io] redirects in Cargo.toml.
Tip
If you are on Apple Silicon (M1/M2/M3/M4), aarch64-apple-darwin is the
only target needed. The x86_64-apple-darwin target is only required if
you are building on Intel hardware or producing a universal binary via
lipo.
Shell Environment
The Editor submodule’s npm install fetches large platform-specific binaries for
its test infrastructure. These binaries (Electron ~200 MB, Playwright Chromium
~300 MB) are only needed for running integration tests - not for
compilation. Without the flags below, npm install will stall indefinitely on
the download.
Add to your shell profile (~/.zshrc, ~/.bashrc, or equivalent) and reload:
# Skip large binary downloads - only needed for e2e tests, not compilation
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
source ~/.zshrc # or restart your terminal
Build Overview
The Land build is a two-step linear flow. Do NOT pull submodules recursively - each submodule is managed independently on its own branch.
- Compile VS Code Source - Build the VS Code platform code that
Cocoonconsumes. This runs inDependency/Microsoft/Dependency/Editor. - Build Land Application - Compile the native Rust backend (
Mountain) and bundle the TypeScript frontend (Wind+Sky) into a runnable Tauri application.
The submodules are compiled in this order because each subsequent layer depends on artifacts produced by the previous one:
Editor→ produces compiled VS Code platform code consumed byCocoonandOutputOutput(viaRest) → bundles the platform code as@codeeditorland/outputfor the extension hostMountain+Air→ native Rust binaries compiled viacargoWind+Sky→ TypeScript frontend assets compiled and bundled into the Tauri app
What you should see: both steps finish without errors, the binaries and the
.app bundle land under Element/Mountain/Target/, and
./Element/Mountain/Target/debug/Mountain opens the editor. The full artifact
tree is enumerated under Build Artifacts below.
Step 1: Compile VS Code Source
The VS Code source is vendored as a Git submodule at
Dependency/Microsoft/Dependency/Editor. This step is mandatory - Land
cannot build without it. Cocoon (the extension host) and Output (the
platform bundle) both consume the compiled output produced here.
Important
You must be on Node 24 for this step. The submodule’s .nvmrc pins the
exact version (24.15.0). Switch before running any commands below.
cd Dependency/Microsoft/Dependency/Editor
# Switch to the required Node version (reads .nvmrc automatically)
nvm use 24
# Required by the VS Code build system
export NODE_ENV=development
# Reset to the expected upstream commit and clean all generated files
git fetch --all
git reset --hard Parent/main
git clean -dfx
# Install dependencies and compile
npm install
npm run compile
npm run compile-extensions-build
Note
The Editor submodule uses npm, not pnpm. Do not substitute pnpm install
here - the submodule’s package-lock.json and .npmrc are npm-native.
Important
The compile-extensions-build step produces the out-<platform>
directories that Rest bundles into @codeeditorland/output. Without it,
Cocoon will fail to locate the VS Code platform code at runtime.
What you should see: npm install, npm run compile and
npm run compile-extensions-build all finish without errors, and the
out-<platform> directories exist inside the Editor submodule. If
npm install appears to hang, the skip flags under Shell Environment were not
applied.
Step 2: Build Land Application
Return to the repository root and invoke the build script with the desired profile.
cd Land # back to repository root
# For a debug build with bundled electron
export Trace=all Record=1 Disable=false
./Maintain/Debug/Build.sh --profile debug-electron-bundled
# For a production build - release profiles live on the release script
export Trace= Record= Disable=
./Maintain/Release/Build.sh --profile release-electron-bundled
Important
A profile is valid only on the script that declares it.
Maintain/Debug/Build.sh accepts the fifteen debug-* profiles;
Maintain/Release/Build.sh accepts production, web-browser and the
release-* profiles. The debug script exits with Unknown profile when given
a release name, so a mistyped profile fails loudly rather than building the
default.
What you should see: Build.sh echoes the resolved tier set, then finishes
and writes the artifacts under Element/Mountain/Target/. On macOS the debug
bundle is re-signed during the same run; a signing failure appears here, not at
launch.
Build Profiles
The Build.sh script accepts several profiles that control feature flags and
optimization levels. See
BuildMatrix.md for the full matrix
of environment variables and tier configurations.
| Profile | Workbench | Coverage | Notes |
|---|---|---|---|
debug |
Browser | 70-80% | Default debug |
debug-mountain |
Mountain | 80-90% | Recommended for daily development |
debug-electron |
Electron | 95%+ | Full feature set |
debug-electron-rest |
Electron + OXC | 95%+ | Fastest TypeScript compile |
debug-electron-minimal |
Electron | No built-in extensions | Atom J1 |
debug-mountain-only |
Mountain | No Cocoon subprocess |
Atom N3 |
debug-cocoon-headless |
Mountain + Cocoon | Wind preload disabled |
Atom N3b |
debug-kernel |
None | Pure Mountain, no built-ins, no Cocoon, no Wind |
Atom N3c |
debug-electron-compiled |
Electron | Single-binary embedded resources | Debug symbols + Compile=true |
debug-mountain-compiled |
Mountain | Single-binary embedded resources | Debug symbols + Compile=true |
debug-electron-bundled |
Electron | Vite/Astro compiled workbench | Full bundled Electron debug build |
debug-browser-bundled |
Browser | Vite/Astro compiled workbench | |
debug-sessions-bundled |
Sessions | Vite/Astro compiled workbench | |
debug-workbench-bundled |
Base workbench | Vite/Astro compiled workbench | |
debug-bundled-all |
All four | Single Rollup pass |
The release script declares the same shape at release quality -
release-electron-bundled, release-browser-bundled, release-sessions-bundled,
release-workbench-bundled, release-bundled-all - plus production, release
and web-browser. Installation
prints both tables in full.
Environment Variables
Land uses a tier-gated system of environment variables to control build and
runtime behavior. All variables are read from .env.Land* files in the
repository root. Copy .env.Land.Sample to .env.Land to customize your
local environment.
For a complete reference, see Configuration.
Common variables:
| Variable | Default | Description |
|---|---|---|
ProductVersion |
1.118.0 |
Land version and feature tier gate |
Bundle |
(unset) | Set to true to trigger Rest bundling |
NetworkMountainPort |
50051 |
gRPC port for Mountain backend |
NetworkCocoonPort |
50052 |
gRPC port for Cocoon extension host |
TierFileSystem |
Layer2 |
Filesystem implementation tier |
TierFileWatcher |
Layer4 |
File watching implementation tier |
TierRemoteProcedureCall |
gRPC |
IPC transport mechanism |
TierIPC |
Mountain |
IPC routing: Mountain / NodeDeferred / Node |
Running the Application
# From the repository root (after a debug-electron build)
cd Land
./Element/Mountain/Target/debug/Mountain
# After a debug-electron-bundled build
./Element/Mountain/Target/debug/Mountain
# The .app bundle (for Finder launch or codesign verification)
# The bundle is named by the resolved product identity, so list the directory
# rather than assuming "Mountain.app"
ls Element/Mountain/Target/debug/bundle/macos/
open Element/Mountain/Target/debug/bundle/macos/*.app
Or use the development launcher, which builds nothing and starts a hot-reloading session against an existing build:
./Maintain/Debug/Run.sh --profile debug-mountain
Build.sh has no run flag - it only builds. Run.sh accepts --no-hot-reload
and --no-watch for a session that should not reload.
For verbose runtime logging, prefix the binary invocation with debug flags:
# Enable full trace logging at startup
Trace=all Record=1 Disable=false ./Element/Mountain/Target/debug/Mountain
# Launch with Electron developer tools visible (electron-based profiles only)
./Element/Mountain/Target/debug/Mountain --debug
Note
All debug profiles write to Target/debug/. The profile name affects which
env vars are set and which Sky assets are produced - not the target directory
name.
Build Artifacts
After a successful build, artifacts are placed in:
Land/
├── Element/
│ ├── Mountain/Target/debug/... # Native Tauri binary and .app bundle
│ ├── Air/Target/debug/Air # Background daemon binary
│ ├── Output/Source/... # @codeeditorland/output platform bundle sources
│ ├── Cocoon/Target/Main.js # Built extension host entry point
│ └── Sky/Target/Static/... # UI static assets (Application/, Bundled/)
└── Maintain/Debug/Build.sh # Build orchestration script
Every debug-* profile writes to Target/debug/; the profile changes the tier
flags and the Sky assets produced, not the directory name. The .app bundle is
named by the product identity resolved from .env.Land, so Mountain.app is the
default and not a guarantee.
Element-Specific Build Instructions
Each Element may have additional build details. Refer to the specific README for element-specific workflows:
| Element | Build Instructions |
|---|---|
Air |
Element/Air/README.md - Background daemon build & daemon lifecycle |
Grove |
Element/Grove/README.md - Native Rust/WASM extension host build |
Mist |
Element/Mist/README.md - DNS server build & testing |
Rest |
Element/Rest/README.md - CLI compiler usage |
SideCar |
Element/SideCar/README.md - Download tool for runtime binaries |
Sky |
Element/Sky/README.md - Astro UI development |
Wind |
Element/Wind/README.md - Effect-TS service layer |
Cocoon |
Element/Cocoon/README.md - Extension host details |
Troubleshooting
npm install stalls or never completes
The Editor submodule includes packages that download large platform-specific binaries during installation:
electron(~200 MB) - a devDependency of the Copilot extension, only needed for running Electron integration tests@playwright/browser-chromium(~300 MB) - only needed for running browser-based e2e tests
Neither binary is needed for compilation. Without the skip flags, npm install
will stall indefinitely downloading them on every fresh install.
Fix: add these to your shell profile and reload:
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
Playwright lockfile blocks install
If npm install fails with:
Error: An active lockfile is found at: ~/Library/Caches/ms-playwright/__dirlock
A previous install was interrupted and left a stale lockfile. Remove it:
rm -rf ~/Library/Caches/ms-playwright/__dirlock
Then re-run npm install.
npm warn Unknown project config messages
npm install prints several harmless warnings:
npm warn Unknown project config "target"
npm warn Unknown project config "disturl"
npm warn Unknown project config "runtime"
npm warn Unknown project config "build_from_source"
These come from upstream VS Code’s .npmrc, which uses keys that npm 11+
considers non-standard. The keys are still read correctly by the build tooling
(node-gyp, native module compilers) that actually uses them. No action needed.
Compilation errors in Dependency/Editor
If the VS Code compilation fails, ensure you have cleaned the directory properly and are on Node 24:
cd Dependency/Microsoft/Dependency/Editor
nvm use 24
export NODE_ENV=development
git clean -dfx
rm -rf node_modules
npm install
npm run compile
Rest binary not found
The build script expects the rest CLI compiler to be on PATH or pointed to
by REST_BINARY_PATH. If you see errors about a missing Rest binary:
export REST_BINARY_PATH=/path/to/rest
Missing environment variables
The build reads .env.Land from the repository root. If variables appear
missing, verify the file exists and is formatted correctly. See
Configuration for syntax.
# Verify the file exists
ls -la .env.Land
# Check for common issues
cat .env.Land | grep -E '^(ProductVersion|Bundle|Network)'
Port conflicts
If NetworkMountainPort (default 50051) or NetworkCocoonPort (default
50052) are already in use from a previous run, kill the orphaned process or
change the port numbers in .env.Land:
# Find orphaned Land processes
lsof -i :50051
lsof -i :50052
# Kill by PID
kill -9 <PID>
# Alternatively, pick a different port in .env.Land
echo "NetworkMountainPort=50061" >> .env.Land
App crashes immediately on macOS (code signing)
Tauri’s ad-hoc signature does not embed the entitlements from
Element/Mountain/Entitlements.plist. Without the correct entitlements,
Cocoon’s V8 JIT crashes, extension helpers fail to spawn, and file pickers
silently do nothing.
Re-sign the .app after any tauri build:
BundleLevel=debug sh Maintain/Script/SignBundle.sh
The script runs xattr -cr to strip quarantine bits, then re-signs with
codesign --force --deep --sign - using the entitlements file. Build.sh
calls this automatically at the end of every build.
Rebuilding & Clean
To perform a clean rebuild:
# Clean Rust artifacts
cd Element/Mountain
cargo clean
# Clean TypeScript builds
cd ../Sky
rm -rf .tina .astro Target
# Clean VS Code recompilation
cd ../../Dependency/Microsoft/Dependency/Editor
git clean -dfx
rm -rf node_modules out
# Rebuild everything from the repository root
cd ../../../..
./Maintain/Debug/Build.sh --profile debug-electron-bundled
Warning
git clean -dfx is not a tidy-up: it deletes every untracked file in the
Editor submodule, including patches, scratch scripts and any file you added
there by hand. rm -rf Target and cargo clean discard build output, so the
next build pays the full compile cost again. Run this only on a checkout whose
Editor submodule you have not modified - and read what git status reports
before the clean, not after.
The build script also has a generated-artefact clean of its own. Setting
Clean=true makes it wipe the generated trees under Wind, Cocoon, Sky and
Mountain and bump every .proto mtime so each build.rs re-emits its
bindings; leaving Clean unset skips that step.
CI/CD & Automation
The repository’s GitHub Actions definitions live under .github/workflows/
(Auto.yml, Dependabot.yml, GitHub.yml, Node.yml, NPM.yml, Rust.yml).
They cover dependency upkeep and per-language checks; they do not invoke
Maintain/Debug/Build.sh, so a green workflow run is not a statement that the
desktop application builds. Read CI/CD Pipeline for the
build pipeline itself - the environment-file cascade and the profile-to-file
mapping.
Further Reading
- Quickstart - Concise build reference with minimal setup
- Configuration - Complete environment variable reference
- CI/CD Pipeline - Pipeline stages and automation
- Deep Dives - Component architecture details
Documentation/GitHub/BuildMatrix.md- Full build variant matrixDocumentation/GitHub/Workflow/- Detailed component interaction workflows
- MANUAL THREE TOOLCHAINS: NODE 24 FOR THE EDITOR SUBMODULE, RUST STABLE FOR THE NATIVE ELEMENTS, AND TWO SKIP FLAGS FOR THE TEST BINARIES THE BUILD DOES NOT NEED. 00
- READER nvm install 24 01
- READER nvm use 24 02
- MANUAL NODE 24 IS REQUIRED SPECIFICALLY TO COMPILE THE EDITOR SUBMODULE. THE PINNED VERSION IS TRACKED IN DEPENDENCY/MICROSOFT/DEPENDENCY/EDITOR/.NVMRC. 03
- READER rustup install stable 04
- READER rustup default stable 05
- READER rustup target add aarch64-apple-darwin 06
- MANUAL ON APPLE SILICON THAT IS THE ONLY TARGET NEEDED. X86_64-APPLE-DARWIN IS FOR INTEL HARDWARE OR A UNIVERSAL BINARY VIA LIPO, AND THE TWO LINUX TARGETS ARE FOR CROSS-COMPILATION. 07
- READER export ELECTRON_SKIP_BINARY_DOWNLOAD=1 08
- READER export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 09
- MANUAL WITHOUT THESE TWO FLAGS `npm install` STALLS ON THE PLATFORM BINARIES ITS TEST INFRASTRUCTURE WANTS - ELECTRON AT ROUGHLY 200 MB AND PLAYWRIGHT CHROMIUM AT ROUGHLY 300 MB. NEITHER IS NEEDED TO COMPILE. 10
- READER source ~/.zshrc 11
EVERY COMMAND AND NOTE ABOVE IS QUOTED FROM THE MANUAL'S OWN SHELL ENVIRONMENT SECTION; THE BUILD RECORDS NO SESSION LOG, SO NOTHING HERE IS PRESENTED AS CAPTURED OUTPUT.
SOURCE: SOURCE/CONTENT/DOC/GETTING-STARTED.MD SECTIONS: BUILD OVERVIEW, STEP 1, STEP 2