Skip to content

dev.sh: snapshot worktree sources on btrfs and bcachefs - #479

Merged
dumbmoron merged 1 commit into
mainfrom
snapshots
Nov 27, 2026
Merged

dumbmoron merged 1 commit into
mainfrom
snapshots

Conversation

@dumbmoron

@dumbmoron dumbmoron commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

reflinking build/src file by file takes about a minute per worktree. on btrfs and bcachefs, he setup now makes it a subvolume, so he wt new can snapshot it instantly and he wt rm can delete it as a whole.

@dumbmoron
dumbmoron requested a review from wukko November 26, 2026 09:06
@dumbmoron
dumbmoron force-pushed the snapshots branch 2 times, most recently from a9b94c5 to abb38af Compare November 26, 2026 09:08
@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

The PR appears safe to merge; no actionable defects were established.RetriggerView in Greptile

[Low impact] The PR appears safe to merge; no actionable defects were established.

Reviews (1) · Last reviewed commit: "dev.sh: snapshot worktree sources on btr..." · Reviewed by Greptile

wukko
wukko previously approved these changes Nov 26, 2026

@helium-gardener helium-gardener Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Worktree removal can delete a source tree outside the worktree. The review also found two compatibility defects in the new snapshot path.

Review walkthrough

Changes

Files Summary
scripts/dev.sh he setup attempts to create build/src as a subvolume. he wt new attempts a writable snapshot before falling back to a recursive copy, and he wt rm attempts subvolume deletion before removing the build directory.

Review checks

Check Result Notes
Scope ✅ Passed The Git tree diff contains only scripts/dev.sh. Both revisions pin helium-chromium at 89984354, so the platform patch entries in provenance describe existing code.
Project Policy ✅ Passed All edits are in platform-owned developer tooling outside the Chromium patch series.
Correctness And Safety ⚠️ Finding Removal can traverse symlinks, and Btrfs snapshot success can leave nested build inputs behind.
Chromium Idioms ⚠️ Finding Chromium’s build/update-linux-sandbox.sh uses numeric filesystem detection, which avoids the GNU stat name lookup behind the bcachefs finding.
Simplicity And Decomposition ✅ Passed Setup, snapshot, and deletion share one filesystem dispatch helper and serve the same worktree lifecycle.
Patch Organization ➖ Not applicable The PR edits a platform script outside the patch stack.

Analysis record

  • Changed files considered: 1
  • Findings: 3 new, 0 retained, 0 resolved
  • Source snapshot: 450ada5f0937
  • Codex: gpt-6.2-sol, reasoning xhigh, requested tier ultrafast, web search cached
  • Patch application: clean
  • Chromium context tool calls: none
  • Maintainer conventions applied: ground-validation-in-reachable-failures, justify-patch-structure-changes, preserve-incremental-loading, preserve-privacy-boundaries, preserve-shared-tab-state, script-resource-lifecycle, stop-work-after-failure, ui-command-contexts, validate-supported-ui-paths, verify-constrained-layouts, verify-current-revision, verify-runtime-selection-paths, verify-shipped-data-before-migration, verify-storage-references-before-deletion, visible-ui-anchors

Limitations

  • Filesystem and build behavior were assessed by static inspection only.

Comment thread scripts/dev.sh Resolved
Comment thread scripts/dev.sh Resolved
Comment thread scripts/dev.sh Resolved
reflinking build/src file by file takes about a minute per worktree.
on btrfs and bcachefs, he setup now makes it a subvolume, so he wt new
can snapshot it instantly and he wt rm can delete it as a whole.

@helium-gardener helium-gardener Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The new Btrfs setup path can drop inherited access controls and block he wt new on checkouts configured with NOCOW.

Review walkthrough

Changes

Files Summary
scripts/dev.sh he setup creates a subvolume where supported. he wt new tries a snapshot before the recursive copy, and he wt rm tries subvolume deletion when both source path components are free of symlinks.

Review checks

Check Result Notes
Scope ✅ Passed The base and head differ only in scripts/dev.sh and pin the same Helium commit. The reviewable provenance entries map to platform patches with identical base and head blobs.
Project Policy ✅ Passed The tracked change is confined to the Linux developer helper and introduces no Chromium test changes.
Correctness And Safety ⚠️ Finding Btrfs subvolume creation changes ACL and NOCOW inheritance. The current removal guard addresses both symlink cases from the earlier review.
Chromium Idioms ➖ Not applicable The changed behavior lives in Linux developer shell tooling and uses filesystem commands.
Simplicity And Decomposition ✅ Passed Creation, snapshotting, and deletion share a single worktree source lifecycle.
Patch Organization ➖ Not applicable The developer helper lives outside the Chromium patch series.

Analysis record

  • Changed files considered: 1
  • Findings: 2 new, 0 retained, 1 resolved
  • Source snapshot: 996542321d46
  • Codex: gpt-6.2-sol, reasoning xhigh, requested tier ultrafast, web search cached
  • Patch application: clean
  • Chromium context tool calls: none
  • Maintainer conventions applied: ground-validation-in-reachable-failures, justify-patch-structure-changes, preserve-incremental-loading, preserve-privacy-boundaries, preserve-shared-tab-state, script-resource-lifecycle, stop-work-after-failure, ui-command-contexts, validate-supported-ui-paths, verify-constrained-layouts, verify-current-revision, verify-runtime-selection-paths, verify-shipped-data-before-migration, verify-storage-references-before-deletion, visible-ui-anchors

Limitations

  • None reported.

Comment thread scripts/dev.sh Resolved
Comment thread scripts/dev.sh Resolved
@dumbmoron
dumbmoron requested a review from wukko November 27, 2026 10:29
@dumbmoron
dumbmoron merged commit 2499c4a into main Nov 27, 2026
5 checks passed
@dumbmoron
dumbmoron deleted the snapshots branch November 27, 2026 10:39
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