This builder has been updated to work with the CortexIDE 1.106.x fork located at ../cortexide. It now correctly integrates with the working local development flow.
- CortexIDE Source: The main editor codebase must be at
../cortexide(relative to this builder repo) - Node.js: v20.18.2 (same as used in CI)
- Build Tools:
- macOS: Xcode Command Line Tools, Rust
- Linux: GCC, libkrb5-dev, Rust
- Windows: Visual Studio Build Tools, Rust
- Memory: At least 16GB RAM recommended (Node will use up to 12GB)
# Set environment variables for CortexIDE
export APP_NAME="CortexIDE"
export BINARY_NAME="cortexide"
export VSCODE_QUALITY="stable"
export CI_BUILD="no" # Important: disables CI-specific logic
export SHOULD_BUILD="yes"
# Set architecture (choose one)
export VSCODE_ARCH="x64" # Intel/AMD 64-bit
# export VSCODE_ARCH="arm64" # Apple Silicon / ARM 64-bit# From the builder repo directory
export OS_NAME="osx"
# Run the build
./build.sh
# Output will be in: ../VSCode-darwin-${VSCODE_ARCH}/
# Application bundle: ../VSCode-darwin-${VSCODE_ARCH}/CortexIDE.app# From the builder repo directory
export OS_NAME="linux"
# Run the build
./build.sh
# Output will be in: ../VSCode-linux-${VSCODE_ARCH}/
# Binary: ../VSCode-linux-${VSCODE_ARCH}/bin/cortexide# From the builder repo directory (in Git Bash or WSL)
export OS_NAME="windows"
# Run the build
./build.sh
# Output will be in: ../VSCode-win32-${VSCODE_ARCH}/
# Binary: ../VSCode-win32-${VSCODE_ARCH}/CortexIDE.exe-
Source Preparation (
get_repo.sh):- Checks for local
../cortexidedirectory - If found, copies it to
vscode/in the builder - If not found, clones from GitHub
- Reads version info from
product.json
- Checks for local
-
Patching (
prepare_vscode.sh):- Applies patches from
patches/directory - Handles branding replacements (APP_NAME, BINARY_NAME, etc.)
- Installs npm dependencies
- Sets up product configuration
- Applies patches from
-
Building (
build.sh):- Cleanup: Kills any running processes, removes stale React builds
- React Build: Runs
npm run buildreact(CortexIDE's custom UI) - TypeScript Compilation: Runs
gulp compile-build-without-mangling - Extension Media: Compiles extension assets
- Extensions: Compiles built-in extensions
- CSS Fixes: Applies CortexIDE-specific CSS path fixes
- Minification: Bundles and minifies the application
- Packaging: Creates platform-specific packages
-
Platform Packaging:
- macOS: Creates
.appbundle → DMG - Windows: Creates executable → InnoSetup installer
- Linux: Creates binaries → tar.gz, .deb, .rpm, AppImage
- macOS: Creates
- Uses
NODE_OPTIONS="--max-old-space-size=12288"(12GB) - Required for CortexIDE's larger codebase with React components
The builder now includes cleanup steps matching your working local flow:
# Kill any running editor processes
pkill -f "/path/to/out/main.js" || true
# Remove stale React build artifacts
rm -rf src/vs/workbench/contrib/void/browser/react/out
rm -rf src/vs/workbench/contrib/cortexide/browser/react/out- Clean up (new in this update)
- Build React components (
npm run buildreact) - Compile TypeScript (
gulp compile-build-without-mangling) - Compile extension media
- Compile extensions
- Fix CSS paths (CortexIDE-specific)
- Minify and bundle
- Package for platform
The CI builds work differently from local builds:
- Check Job: Determines if a build is needed
- Compile Job: Compiles the TypeScript/React (once)
- Build Job: Packages for each architecture (parallel)
Manual Dispatch:
# Go to GitHub Actions tab
# Select "stable-macos", "stable-linux", or "stable-windows"
# Click "Run workflow"
# Options:
# - cortexide_commit: Specific commit to build
# - cortexide_release: Custom release number
# - generate_assets: Create downloadable artifactsAutomatic Triggers:
- Push to
masterbranch - Pull request to
masterbranch
The workflows automatically set:
APP_NAME=CortexIDEBINARY_NAME=cortexideVSCODE_QUALITY=stableCI_BUILD=no(for compile job) or implicitly true (for package jobs)NODE_OPTIONS=--max-old-space-size=12288- Architecture-specific variables per matrix job
Solution: Increase Node memory limit
export NODE_OPTIONS="--max-old-space-size=16384" # 16GBExpected: Some patches may not apply to CortexIDE if the changes are already in the source.
Check: Look at PATCHES_ASSESSMENT.md for which patches are needed.
Fix: The builder will continue with warnings for non-critical patch failures.
Solution: Clean and rebuild:
cd ../cortexide
rm -rf src/vs/workbench/contrib/*/browser/react/out
npm run buildreactSolution: Ensure you've run get_repo.sh first or that ../cortexide exists:
./get_repo.shCheck:
- All dependencies installed:
cd vscode && npm ci - React was built: Check for
src/vs/workbench/contrib/cortexide/browser/react/out/ - Product branding correct:
cat vscode/product.json | grep -A5 applicationName
To use a different CortexIDE source location:
# Edit get_repo.sh and change:
CORTEXIDE_REPO="../cortexide"
# to your custom pathTo skip specific patches, move them out of the patches/ directory:
mkdir patches/disabled
mv patches/some-patch.patch patches/disabled/The builder merges product.json from the builder repo with the one from CortexIDE:
# Edit this file to add/override product.json values:
vim product.json# macOS
../VSCode-darwin-${VSCODE_ARCH}/CortexIDE.app/Contents/MacOS/Electron
# Linux
../VSCode-linux-${VSCODE_ARCH}/bin/cortexide
# Windows
../VSCode-win32-${VSCODE_ARCH}/CortexIDE.execd ../cortexide
npm test./prepare_assets.sh # After successful build
# Creates: assets/CortexIDE-darwin-${VSCODE_ARCH}-${VERSION}.dmg./prepare_assets.sh # After successful build
# Creates: assets/CortexIDESetup-${VSCODE_ARCH}-${VERSION}.exe./prepare_assets.sh # After successful build
# Creates:
# assets/cortexide-${VERSION}-${ARCH}.tar.gz
# assets/cortexide_${VERSION}_${ARCH}.deb
# assets/cortexide-${VERSION}-${ARCH}.rpmcortexide-builder/ # This repository
├── .github/workflows/ # CI/CD workflows
├── build/ # Platform-specific build scripts
│ ├── linux/
│ │ ├── package_bin.sh # Linux packaging
│ │ └── package_reh.sh # Remote Extension Host
│ ├── windows/
│ │ └── package.sh # Windows packaging
│ └── osx/ # macOS-specific configs
├── patches/ # Patches to apply to source
│ ├── *.patch # Core patches
│ ├── linux/ # Linux-specific
│ ├── windows/ # Windows-specific
│ └── osx/ # macOS-specific
├── build.sh # Main build script
├── get_repo.sh # Fetches CortexIDE source
├── prepare_vscode.sh # Applies patches, sets up
├── utils.sh # Shared utility functions
├── version.sh # Version management
└── vscode/ # CortexIDE source (created during build)
../cortexide/ # Main CortexIDE repository
└── (source files)
- Test Local Build: Follow "Quick Start" for your platform
- Test CI Build: Trigger a manual workflow run
- Create Release: Use
./release.shafter successful build - Update Documentation: Document any issues you encounter
For issues with:
- Builder: Check
PATCHES_ASSESSMENT.mdand this file - CortexIDE Source: Check the main
../cortexiderepository - CI/CD: Check
.github/workflows/and GitHub Actions logs
- Cleanup steps (pkill, rm -rf) matching working local flow
- NODE_OPTIONS environment variable (12GB memory limit)
- Better patch tolerance (non-critical patches can fail)
- Comprehensive logging and progress indicators
- Platform-specific build documentation
- Updated memory limit from 8GB to 12GB
- Improved error handling in patch application
- Better CI workflow documentation
- Separated compile and package steps in CI
- CSS path fixes for CortexIDE components
- React build integration
- Patch application for 1.106 compatibility
- Source directory handling (uses ../cortexide correctly)