Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Move git revision fetching #51107

Closed
wants to merge 1 commit into from

Conversation

zanderso
Copy link
Member

@zanderso zanderso commented Feb 29, 2024

Avoids GN invoking python scripts that run git commands to determine git hashes. Instead the git hashes are saved in files by gclient sync, and then read out of the files into GN arguments by the gn script.

Part of flutter/flutter#144430

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@zanderso zanderso force-pushed the git-revision-as-hook branch 3 times, most recently from 38846ea to 292a369 Compare March 3, 2024 03:29
@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

Changes reported for pull request #51107 at sha 292a369

@zanderso zanderso force-pushed the git-revision-as-hook branch from 292a369 to e6ddd23 Compare March 3, 2024 15:45
@jason-simmons
Copy link
Member

Would the performance be acceptable if this invoked the git rev-parse command from within the tools/gn script instead of writing a file during gclient runhooks?

When I run git rev-parse on a repository locally it takes around 30 milliseconds. Doing this within tools/gn will avoid the overhead of launching Python within the build scripts and also avoid the need to keep these temporary files in sync.

@zanderso
Copy link
Member Author

zanderso commented Mar 4, 2024

Does git rev-parse hit the network?

@jason-simmons
Copy link
Member

No - it should only read the local repository filesystem

@zanderso
Copy link
Member Author

zanderso commented Mar 4, 2024

Closing in favor of #51175

@zanderso zanderso closed this Mar 4, 2024
@zanderso zanderso deleted the git-revision-as-hook branch March 4, 2024 20:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants