Repository navigation
Preserve linker arguments across response files - #3350
Open
karim-alweheshy wants to merge 5 commits into
Open
karim-alweheshy wants to merge 5 commits into
karim-alweheshy wants to merge 5 commits into
Conversation
added 2 commits
September 23, 2026 12:00
Signed-off-by: Karim Alweheshy <karim.alweheshy@reddit.com>
Signed-off-by: Karim Alweheshy <karim.alweheshy@reddit.com>
karim-alweheshy
marked this pull request as ready for review
September 23, 2026 15:57
Signed-off-by: Karim Alweheshy <karim.alweheshy@gmail.com>
Contributor
Comment on lines
+126
to
+148
| if option in _WL_POSITIONAL_PATH_OPTS and option != "-filelist": | ||
| # Section arguments are metadata/content, not positional libraries. | ||
| for _ in range(max(_WL_POSITIONAL_PATH_OPTS[option])): | ||
| if driver_wrappers and end < len(linkopts) and linkopts[end] == "-Xlinker": | ||
| end += 1 | ||
| end = min(end + 1, len(linkopts)) | ||
| elif option in _SPLIT_PATH_OPTS | _SPLIT_NON_PATH_OPTS: | ||
| value_index = end | ||
| if driver_wrappers and value_index < len(linkopts) and linkopts[value_index] == "-Xlinker": | ||
| value_index += 1 | ||
| if value_index < len(linkopts): | ||
| end = value_index + 1 | ||
| if (option in _LIBRARY_INPUT_OPTS and | ||
| linkopts[value_index] in generated_product_paths): | ||
| index = end | ||
| continue | ||
| elif option in generated_product_paths: | ||
| index = end | ||
| continue | ||
|
|
||
| result.extend(linkopts[index:end]) | ||
| index = end | ||
| return result |
Contributor
There was a problem hiding this comment.
This just reads bad. I get what it's doing, generally, but I feel it could be organized better or have way more comments.
Contributor
Author
There was a problem hiding this comment.
Added comments in 60339e7 around the option categories and removal state machine: which operands stay grouped, when -Xlinker wrappers travel with a removed binding, and why unmatched operands remain ordered. This is comments-only; the AST and representative outputs are unchanged, and all 13 Python tests pass. Does that address the organization concern, or is there a section you would prefer split up?
Comment on lines
+201
to
+205
| # This is a Clang response file, not a shell command. Quote the whole | ||
| # argument and escape response syntax. Double quotes also allow apostrophes | ||
| # introduced later by expansion of PROJECT_DIR or another build setting. | ||
| if any(character in opt for character in " \t\n\r'\"\\") or "$(" in opt: | ||
| return '"' + opt.replace("\\", "\\\\").replace('"', '\\"') + '"' |
Contributor
There was a problem hiding this comment.
This is interesting.
Signed-off-by: Karim Alweheshy <karim.alweheshy@reddit.com>
Signed-off-by: Karim Alweheshy <karim.alweheshy@gmail.com>
karim-alweheshy
force-pushed
the
preview-stack-link-arguments
branch
from
October 7, 2026 11:46
87caab3 to
b81aa09
Compare
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.
Why
Xcode needs linker arguments preserved with their original boundaries; the current translator can lose information across Bazel response-file chunks.
What and how
Preserve chunks, expand first-level response-file redirects, and remove selected library bindings as complete option groups, including
-Xlinkerpairs.Boundary
This fixes the existing Bazel-to-Xcode translation path. It does not enable native Preview mode or change library-path resolution.
Validation
Regression tests cover chunk handling, redirects, quoting, and grouped-option removal. Tests were not rerun for this description update.
Testing
Run
bazel test //tools/params_processors:link_params_processor_tests. No Xcode Preview Canvas render is claimed.