Automatically detect file-bearing compiler/linker flags for fingerprint invalidation#53
Open
Orphis wants to merge 1 commit into
Conversation
…nt invalidation Flags such as -fsanitize-memory-ignorelist=msan.ignore or -include forced.h take a file as their argument. HFC's toolchain fingerprint already captured the flag string, but not the content of the referenced file, so editing that file left dependencies reused with stale instrumentation. Users worked around this by hashing the file themselves and injecting the digest on the command line. This detects file-bearing flags automatically and folds each referenced file's SHA256 content hash into the toolchain fingerprint, so editing the file triggers a rebuild with no manual hashing. - hfc_scan_file_flags.cmake: built-in GCC/Clang table (sanitizer/coverage ignore/allow-lists, PGO/sample/auto profiles, XRay lists, modules, plugins/ specs, -include/-imacros, linker --version-script/--dynamic-list/-T incl. -Wl,/-Xlinker unwrapping, @response files). Attached "flag=path" and separated "flag path" forms, deterministic sorted output, unresolved files skipped. - Wired into both fingerprint paths: literal flags in compute_live_toolchain_fingerprint, GENEX-resolved flags in compute_augmented_toolchain_fingerprint_isolated. - On by default; HERMETIC_FETCHCONTENT_DISABLE_FILE_FLAG_DETECTION opt-out and HERMETIC_FETCHCONTENT_ADDITIONAL_FILE_FLAGS user-extensible list. - End-to-end test (AtBuildTime + AtConfigureTime) plus docs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Change-Id: I1b32bf81f1aca2d35210d0d33ea10423a032761c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Flags such as -fsanitize-memory-ignorelist=msan.ignore or -include forced.h take a file as their argument. HFC's toolchain fingerprint already captured the flag string, but not the content of the referenced file, so editing that file left dependencies reused with stale instrumentation. Users worked around this by hashing the file themselves and injecting the digest on the command line.
This detects file-bearing flags automatically and folds each referenced file's SHA256 content hash into the toolchain fingerprint, so editing the file triggers a rebuild with no manual hashing.
@responsefiles). Attached "flag=path" and separated "flag path" forms, deterministic sorted output, unresolved files skipped.Change-Id: I1b32bf81f1aca2d35210d0d33ea10423a032761c