Skip to content

Add no-bootstrap option for fast worktree clones - #38699

Open
bridiver wants to merge 3 commits into
masterfrom
no-bootstrap
Open

Add no-bootstrap option for fast worktree clones#38699
bridiver wants to merge 3 commits into
masterfrom
no-bootstrap

Conversation

@bridiver

@bridiver bridiver commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

This is useful for bots that need to create worktrees for running presubmit, etc...

Running vendor/depot_tools/gclient-new-workdir.py [repo] [workdir] --use-git-worktree --no-copy-on-write --max-depth 4 gives you a full (almost) recursive worktree checkout and then pnpm run init --nohooks --no-bootstrap syncs up the repo after checkout out the correct brave-core branch

@bridiver
bridiver requested a review from a team as a code owner August 2, 2026 01:12
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

📋 Code Owners Summary

2 file(s) changed, 2 with assigned owners

1 team(s) affected: @brave/build-commands-reviewers


Owners and Their Files

@brave/build-commands-reviewers — 2 file(s)

args.push('-D')
}

if (program.bootstrap === false) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not great that we have to do this in two places, this needs a follow-up

@bridiver
bridiver requested a review from nikhedonia August 2, 2026 01:19

if (program.bootstrap === false) {
args.push('--no-bootstrap')
}

@goodov goodov Aug 2, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running vendor/depot_tools/gclient-new-workdir.py [repo] [workdir] --use-git-worktree --no-copy-on-write --max-depth 4 gives you a full (almost) recursive worktree checkout and then pnpm run init --nohooks --no-bootstrap syncs up the repo after checkout out the correct brave-core branch

this workflow with gclient-new-workdir.py only makes sense if you're working on a chromium repo directly.

for brave development you should have gitcache configured and create worktrees from src/brave, the gitcache will do the rest.

allowing --no-bootstrap makes no sense to me at all - if you configured gitcache, then you use it everywhere. Just make sure you don't misconfigure it in any new worktree you add.

here's a script to have multiple brave checkout with gitcache, siso cache and vpython cache all shared automatically (run without args first time, then pass worktree name via first arg): https://gist.github.com/goodov/4d1c8721ec7059621b25594dfe611b02

@bridiver bridiver Aug 2, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this for a very specific purpose which is to run presubmit and gn checks only for bot PRs. This creates a very fast and space efficient checkout. Significant time and download is wasted for bootstrap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants