Implement hermetic symbol renaming for hyperscan fat runtime#3675
Closed
Copilot wants to merge 9 commits intocopilot/implement-fat-runtime-hyperscanfrom
Closed
Implement hermetic symbol renaming for hyperscan fat runtime#3675Copilot wants to merge 9 commits intocopilot/implement-fat-runtime-hyperscanfrom
Copilot wants to merge 9 commits intocopilot/implement-fat-runtime-hyperscanfrom
Conversation
- Replace genrule with Starlark hs_rename_symbols rule using cc_toolchain - Add comprehensive symbol keep list including libc symbols - Remove rename_symbols.sh shell script - Update BUILD.bazel and source.json hashes Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
- Derive llvm-nm and llvm-objcopy paths from llvm-ar path - Fix sed command to generate proper rename map for objcopy - Update source.json hash for fat_runtime.bzl Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Make hyperscan fat runtime symbol renaming hermetic
Make hyperscan fat runtime symbol renaming hermetic
Jan 31, 2026
- Change archive attribute from allow_single_file to providers = [CcInfo] - Extract static library from CcInfo linking context - Update source.json with correct hash Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
- Change script to accept tool paths as arguments instead of hardcoding - Pass tool paths via ctx.actions.args() at runtime - This ensures tools are resolved correctly in remote execution - Update source.json hash Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
- Use realpath to convert all paths to absolute before cd - This ensures tools and files can be found after changing directory - Fixes: "No such file or directory" errors in remote execution - Update source.json hash Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Copilot
AI
changed the title
Make hyperscan fat runtime symbol renaming hermetic
Make hyperscan fat runtime symbol renaming hermetic and fix path resolution
Jan 31, 2026
- Replace all double curly braces with single in bash variables - Fixes: "bad substitution" error - Double braces are for Python string escaping, not bash syntax - Update source.json hash Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Copilot
AI
changed the title
Make hyperscan fat runtime symbol renaming hermetic and fix path resolution
Make hyperscan fat runtime symbol renaming hermetic
Jan 31, 2026
- Change -f p to --format=posix for llvm-nm compatibility - Use awk instead of cut/sed for more reliable symbol extraction - Properly format symbol rename map as "old_symbol new_symbol" - Fixes: "llvm-nm: error: --format value should be one of..." - Fixes: "llvm-objcopy: error: missing new symbol name" - Update source.json hash Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
- Add ^mmbit_ to KEEP_SYMBOLS list - These symbols are defined in hs_common (not renamed) - Referenced from variant libraries (which get renamed) - Prevents renaming mmbit_ references in variant libs - Fixes undefined symbol errors for mmbit_* at link time - Update source.json hash Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Copilot
AI
changed the title
Make hyperscan fat runtime symbol renaming hermetic
Implement hermetic symbol renaming for hyperscan fat runtime
Jan 31, 2026
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.
Hyperscan's fat runtime builds 5 architecture-specific libraries (core2, corei7, avx2, avx512, avx512vbmi) that must coexist without symbol conflicts. The existing genrule used non-hermetic system tools and failed in remote execution.
Changes
Starlark rule using cc_toolchain
hs_rename_symbolsrule extracts LLVM tools viafind_cc_toolchain()andcc_common.get_tool_for_action()cc_librarytargets throughCcInfoprovider, extracts static library from linking contextScript execution fixes
ctx.actions.args(), converted to absolute withrealpathbeforecd${VAR}not${{VAR}}--format=posixnot-f pold_symbol new_symbolformatSymbol preservation
^mmbit_Removes
rename_symbols.sh, updatessource.jsonoverlay hashes.Original prompt
This pull request was created from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.