How to build VSCodium
Dependencies
- node 20.18
- jq
- git
- python3 3.11
- rustup
Linux
- gcc
- g++
- make
- pkg-config
- libx11-dev
- libxkbfile-dev
- libsecret-1-dev
- libkrb5-dev
- fakeroot
- rpm
- rpmbuild
- dpkg
- imagemagick (for AppImage)
- snapcraft
MacOS
Windows
- powershell
- sed
- 7z
- WiX Toolset
- 'Tools for Native Modules' from the official Node.js installer
Build for Development
A build helper script can be found at dev/build.sh.
- Linux:
./dev/build.sh - MacOS:
./dev/build.sh - Windows:
powershell -ExecutionPolicy ByPass -File .\dev\build.ps1or"C:\Program Files\Git\bin\bash.exe" ./dev/build.sh
Insider
The insider version can be built with ./dev/build.sh -i on the insider branch.
You can try the latest version with the command ./dev/build.sh -il but the patches might not be up to date.
Flags
The script dev/build.sh provides several flags:
-i: build the Insiders version-l: build with latest version of Visual Studio Code-o: skip the build step-p: generate the packages/assets/installers-s: do not retrieve the source code of Visual Studio Code, it won't delete the existing build
Build for CI/Downstream
Here is the base script to build VSCodium:
# Export necessary environment variables
export SHOULD_BUILD="yes"
export SHOULD_BUILD_REH="no"
export CI_BUILD="no"
export OS_NAME="linux"
export VSCODE_ARCH="${vscode_arch}"
export VSCODE_QUALITY="stable"
export RELEASE_VERSION="${version}"
. get_repo.sh
. build.sh
To go further, you should look at how we build it:
- Linux: https://github.com/VSCodium/vscodium/blob/master/.github/workflows/stable-linux.yml
- macOS: https://github.com/VSCodium/vscodium/blob/master/.github/workflows/stable-macos.yml
- Windows: https://github.com/VSCodium/vscodium/blob/master/.github/workflows/stable-windows.yml
The ./dev/build.sh script is for development purpose and must be avoided for a packaging purpose.
Build Snap
# for the stable version
cd ./stores/snapcraft/stable
# for the insider version
cd ./stores/snapcraft/insider
# create the snap
snapcraft --use-lxd
# verify the snap
review-tools.snap-review --allow-classic codium*.snap
Patch Update Process
Semi-Automated
- run
./dev/build.sh, if a patch is failing then, - run
./dev/update_patches.sh - when the script pauses at
Press any key when the conflict have been resolved..., openvscodedirectory in VSCodium - fix all the
*.rejfiles - run
npm run watch - run
./script/code.shuntil everything is ok - press any key to continue the script
update_patches.sh
Manual
- run
./dev/build.sh, if a patch is failing then, - run
./dev/patch.sh <name>.patchwhere<name>.patchis the failed patch - open
vscodedirectory in a new VSCodium's window - fix all the
*.rejfiles - run
npm run watch - run
./script/code.shuntil everything is ok - go back to the command line running
./dev/patch.sh, pressenterto validate the changes and it will update the patch
icons/build_icons.sh
To run icons/build_icons.sh, you will need:
- imagemagick
- png2icns (
npm install png2icns -g) - librsvg