Remove selected libraries with complete linker option groups - #3351
Conversation
Signed-off-by: Karim Alweheshy <karim.alweheshy@reddit.com>
| "-weak_framework", | ||
| } | ||
|
|
||
| _LIBRARY_INPUT_OPTS = { |
There was a problem hiding this comment.
[P2] Handle the remaining library-binding options
The new option tables miss three valid library bindings:
-Wl,-lazy_library,<selected>becomes a dangling-Wl,-lazy_library. With-framework Foundationnext, the linker consumes-frameworkas the library path and fails.-delay_libraryand-assert_weak_libraryare classified as path options but omitted from_LIBRARY_INPUT_OPTS, so their selected archives remain in the output.
I reproduced all three with Apple Clang 21 / Xcode 27. The original linker inputs are accepted. The parent translator removes each complete comma group and the native replacement links successfully; this revision either leaves the dangling option or fails when the Bazel archive being replaced is absent.
Please add these bindings to the appropriate tables and regression tests. All 12 existing focused tests pass, but they do not cover these options.
There was a problem hiding this comment.
Fixed in f2e5f98. I added -lazy_library to both the path-option and removable-library-input tables, and added -delay_library and -assert_weak_library to removable library inputs.
Regression coverage exercises plain, -Xlinker, and -Wl, forms and preserves the retained dependency and following framework option. All 13 focused tests pass locally. New-head CI is still running.
Signed-off-by: Karim Alweheshy <karim.alweheshy@reddit.com>
8f3a59b
into
preview-stack-link-arguments
Summary
Remove a selected Bazel-built library from Xcode linker arguments together with
its complete option group. Previously, removing only the library could leave
-force_loador-Xlinkerto consume the next unrelated argument.-Xlinker-forwarded and-Wl,-grouped library inputs.section-content operands.
Based on branch
preview-stack-link-arguments. This is an independentlyuseful correction to the existing translator; it does not enable native
Previews, reanchor paths or introduce static-library runtime policy.
Validation
tests and five new grouped-removal tests.
parent and passes against this candidate.
targets reuse cached results.
git diff --checkpass.dangling forwarded options. This candidate links and runs the native
replacement implementation together with the retained dependency archive.
Testing
Run
bazel test //tools/params_processors:link_params_processor_testsandbazel test //.... Review the preserved neighboring arguments as well asthe removed library. Preview activation and Canvas validation are outside
this change.