Build Flecha from source
What you need
Section titled “What you need”- A Mac with Xcode and its command line tools. The scripts build for Apple silicon by default; set
FLECHA_ARCH=x64for Intel. - depot_tools on your
PATH. - A Chromium checkout at version 158, on an APFS volume, with 100 GB or more free. Fetch it with Chromium’s macOS build instructions. A first build takes several hours.
- Node 22.5 or newer (the helper uses
node:sqlite).
chromium/scripts/env.sh says where things live, and every script reads it. Point it at your setup with CHROMIUM_SRC (the checkout’s src), DEPOT_TOOLS, FLECHA_PROFILE (the dev profile), and FLECHA_DISK / FLECHA_VOLUME if you keep the checkout on a disk image.
Build and run
Section titled “Build and run”-
Install the npm dependencies at the repository root:
Terminal window npm ci -
Apply the patches and build Chromium.
apply.shresets every file it touches first, so it’s safe to run again.Terminal window chromium/scripts/build.sh -
Launch the dev build with its own profile:
Terminal window chromium/scripts/run.sh
The dev build is a component build, so after the first time a change relinks one small library.
Shell-only changes
Section titled “Shell-only changes”run.sh loads the shell from chromium/shell/dist. Rebuild it and relaunch:
npm run shell:watch # rebuild on savenpm run typecheck # must pass before you send a changeThe helper builds with npm run host:build. To register a helper you built yourself:
chromium/scripts/install-native-host.shChanging a patch
Section titled “Changing a patch”- Run
chromium/scripts/apply.sh. - Edit Chromium, marking your lines with
// Flecha:. Put new code in new files where you can. - Save the diff as the patch:
git diff > chromium/patches/00NN-name.patchin the checkout. - Run
apply.shagain to check it applies cleanly.
Contributing
Section titled “Contributing”- Pull requests go to lucianodiisouza/flecha-browser. Bugs and ideas go to Issues.
- Use conventional commits:
feat,fix,docs,refactor,chore, with a scope such asshell,chromiumornative-host. - TypeScript is strict and
npm run typecheckmust pass. - No new dependencies without a reason, and no Arc code, assets or text.
- Check light and dark mode, and attach a screenshot for UI changes.
- Contributions are MIT-licensed, like the rest of Flecha.
Next: how releases are made.