[roll] Roll fuchsia [git] Centralize git path resolution and fix regen
Introduce a centralized mechanism to resolve Git paths (like HEAD and
index) in GN, with full support for git worktrees. This replaces
direct accesses to `.git/` files which fail in worktrees because `.git`
is a file pointing to the real git directory.
Also fix the GN auto-regeneration bug by implementing a two-step
resolution in GN:
1. Resolve the paths to the git files (like HEAD and ref) dynamically
using `resolve_git_paths.py` (which uses `git rev-parse --git-path`
and is worktree-aware).
2. Pass these resolved paths as `file_dependencies` to the second
`exec_script` call that resolves the actual revision hashes using
`resolve_git_revisions.py`.
This forces Ninja to rerun GN when HEAD or the branch ref changes,
without the performance penalty of tracking the `index` file at
GN-time.
Performance (10 runs)
- Before (min: 9.38s, mean: 10.00s)
- After (min: 9.36s, mean: 10.11s)
Testing:
- Host Unit Tests:
Run python unit tests for Bazel Git input resolution:
$ python3 build/bazel/scripts/get_git_head_commit_test.py
- Manual Integration Verification:
1. GN Auto-Regeneration (Branch):
Create an empty commit on a branch. The next `fx build` must
trigger `gn gen` automatically as the branch ref file changed.
2. GN Auto-Regeneration (Detached HEAD):
Create an empty commit in detached HEAD state. The next
`fx build` must trigger `gn gen` automatically as the HEAD
file changed.
3. Zircon Fast Rebuild (Index tracking):
Stage a change (e.g. `git add`). The next `fx build` must
rebuild the `version-string.txt` target (appending the
`-dirty` suffix) WITHOUT triggering `gn gen`.
Test: python3 build/bazel/scripts/get_git_head_commit_test.py
Test: Manual integration verification (see description)
Original-Original-Bug: 516876349
TAG=agy
CONV=fbaa9ac0-a008-4115-9c94-a99ca81177f3
Original-Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1646937
Original-Original-Revision: 357056196a7f657e2e6143ad5030e1d6707ba54a
GitOrigin-RevId: c6f8fbb9aff9d4dce42a71af2f2b950422749789
Change-Id: I4c960a78dd29402d071dab4aadb97b3514e365fb
This repository contains Fuchsia's Global Integration manifest files.
All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.
Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance in one of the communication channels documented at get involved.
First install Jiri.
Next run:
$ jiri init $ jiri import minimal https://fuchsia.googlesource.com/integration $ jiri update
Third party projects should have their own subdirectory in ./third_party.