-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Add experimental cc_static_library
rule
#16954
base: master
Are you sure you want to change the base?
Conversation
fbcb331
to
a42ff75
Compare
0f9622b
to
f260501
Compare
799d1e8
to
dce3fe7
Compare
@fmeum Any update on my comments? |
@aminya and @fmeum any updates on the status / timeline for this? We (as in, my company) are considering moving off Bazel partially or completely and lack of transitive static libraries is one of the major factors in making such decisions. We need to understand our timeline and resource allocation should be and that hinges on this MR + issue thread. |
Sorry for the lack of response, other efforts kept needing priority over the one. I'm planning to get back to it in April. @Algomorph If you really just want to build transitive static libraries, then you could really use any of the Starlark rules proposed on the original issue without being blocked on me. Do you have any special requirements that only my design would address? |
@fmeum thanks for getting back to me so promptly and sharing the plan. April will probably work for us. I got the general sense from reading through the thread that people are running into issues with the proposed rules, but granted, I haven't personally tried any of them yet. We will review further at our next planning session and reevaluate, perhaps even assist -- if we can allocate the resources for it. |
Unfortunately, one of my dependencies uses Bazel, and I am stuck in the walled garden of Bazel without a way out. Having static libraries is the only way that allows us to build the dependency in isolation and use it in other projects without the fragile and bulky alternative of whole archive shared libraries.
I tried all the proposed rules, and only this PR seems to partially work for me except for the errors I mentioned here
|
836e4df
to
af7c5ce
Compare
af7c5ce
to
5313d07
Compare
beb3f42
to
ce875e8
Compare
# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35201). | ||
DUPLICATE_SYMBOLS=$( | ||
"%{nm}" -A -g -P %{nm_extra_args} "$1" | | ||
sed -E -e 's/.*\[([^][]+)\]: (.+) ([A-TX-Z]) [a-f0-9]+ [a-f0-9]+/\1: \3 \2/g' -e t -e d | |
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.
Can this sed be simplified?
My suggestions:
- the last part
[a-f0-9]+ [a-f0-9]+
of the matcher is not used in the output, so it could be removed \[([^][]+)\]
is quite complex, is the occurence of[
or]
in any other strings even possible? if not, then do just\[(.*)\]
. It's easier to understand.- shouldn't
sed -E -e <> -e t -e d
do the same assed -E <>
? If that's the case remove-e
s.
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.
- We need to match this part so that it is consumed and replaced, otherwise it would end up in the
sed
output. I could use another wildcard, but using two wildcards around a part we need to match exactly seemed too brittle to me. - It may appear in file names, which is why i wanted this match to be as precise as possible. It is only relevant in edge cases though (and maybe not even there).
t
andd
additionally drop unmatched lines, which is required to drop some symbol types that should be ignored. Default sed doesn't do that as far as I know.
src/main/starlark/builtins_bzl/common/cc/experimental_cc_static_library.bzl
Outdated
Show resolved
Hide resolved
src/main/starlark/builtins_bzl/common/cc/experimental_cc_static_library.bzl
Outdated
Show resolved
Hide resolved
src/main/starlark/builtins_bzl/common/cc/experimental_cc_static_library.bzl
Show resolved
Hide resolved
d89a77c
to
54957f9
Compare
RELNOTES: The new
cc_static_library
rule produces a static library that bundles given targets and all their transitive dependencies. It has to be enabled via--experimental_cc_static_library
.Implements https://docs.google.com/document/d/1jN0LUmp6_-rV9_f-Chx-Cs6t_5iOm3fziOklzBGjGIg/edit
Fixes #1920