-
Couldn't load subscription status.
- Fork 139
Only build objects when supports_start_end_lib is enabled #493
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -238,14 +238,25 @@ def _cc_library_impl(ctx): | |
| libraries = libraries_to_link, | ||
| ) | ||
|
|
||
| supports_start_end_lib = cc_common.is_enabled( | ||
| feature_configuration = feature_configuration, | ||
| feature_name = "supports_start_end_lib", | ||
| ) | ||
|
|
||
| files_builder = [] | ||
| if linking_outputs.library_to_link != None: | ||
| artifacts_to_build = linking_outputs.library_to_link | ||
| if artifacts_to_build.static_library != None: | ||
| files_builder.append(artifacts_to_build.static_library) | ||
| if supports_start_end_lib and (artifacts_to_build.objects or artifacts_to_build.pic_objects): | ||
| if artifacts_to_build.pic_objects: | ||
| files_builder.extend(artifacts_to_build.pic_objects) | ||
| elif artifacts_to_build.objects: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previously both the pic and non-pic version were built, now only one of the two flavors is requested. There are pros and cons to both approaches, I guess. We should at least leave a comment explaining why this differs between the two feature states. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was wondering why that was the case, or in what configurations you would end up with both, but I can play it safe and mirror today's behavior 🤔 , not sure what the ideal is? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would say it's safer if there are fewer outputs (assuming we change the type of outputs anyway) as this results in fewer downloads with default BwoB settings and smaller BES messages. Building pic of available and non-pic only as a fallback seems reasonable to me. I wouldn't expect non-pic compilation to fail if pic compilation passes. |
||
| files_builder.extend(artifacts_to_build.objects) | ||
| else: | ||
| if artifacts_to_build.static_library != None: | ||
| files_builder.append(artifacts_to_build.static_library) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could advertise new There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added that for discussion, seems fine |
||
|
|
||
| if artifacts_to_build.pic_static_library != None: | ||
| files_builder.append(artifacts_to_build.pic_static_library) | ||
| if artifacts_to_build.pic_static_library != None: | ||
| files_builder.append(artifacts_to_build.pic_static_library) | ||
|
|
||
| if not cc_common.is_enabled( | ||
| feature_configuration = feature_configuration, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BES messages can get larger as they no longer announce just a constant number of outputs per
cc_library. Just something to keep in mind, but I think that the change is still worth it.