Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle multiple alwayslink error in objc_library #938

Merged
merged 3 commits into from
Jan 21, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion rules/library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,7 @@ def apple_library(
if module_map:
objc_hdrs.append(module_map)

default_alwayslink = kwargs.pop("alwayslink", True) # By default set it to True to ensure symbols from static deps are always included
native.objc_library(
name = objc_libname,
srcs = objc_sources + objc_private_hdrs + objc_non_exported_hdrs,
Expand All @@ -1124,7 +1125,7 @@ def apple_library(
defines = defines + objc_defines,
testonly = testonly,
features = features,
alwayslink = True, # ensure symbols from any static deps are always included (see https://github.com/bazelbuild/rules_apple/issues/1938)
alwayslink = default_alwayslink, # ensure symbols from any static deps are always included (see https://github.com/bazelbuild/rules_apple/issues/1938)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'd probably drop this comment and move it up to the default_alwayslink declaration

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved! I'll enable auto-merge

**kwargs
)
launch_screen_storyboard_name = name + "_launch_screen_storyboard"
Expand Down