How to Filter out some deps before calling cc_library rule

21 views
Skip to first unread message

Kamlesh Kumar

unread,
Oct 9, 2024, 7:32:41 AMOct 9
to bazel-discuss
Hi All,
I'm working for the first time with Bazel build and please let me know if this is not the correct channel to ask for help.
I am particularly tweaking the tensorflow build which uses bazel.
I would like to write a wrapper to cc_library  which filters out llvm related library like below.
Since deps also contains select causing error like deps not iterable.
Any thought on how we can achieve intended behavior?
def my_cc_library(name, srcs = [], data = [], deps = [], copts = [], linkstatic = None, hdrs = [], textual_hdrs = [], alwayslink = None, compatible_with = None , tags = [], features = [], testonly = None, visibility = None, defines = [], deprecation = None, includes=[], local_defines = [], linkopts=[], restricted_to=None, strip_include_prefix=None): def get_filtered_deps(deps): return [dep for dep in deps if not dep.startswith("@llvm-project")] cc_library(name = name, srcs = srcs, data = data, deps = get_filtered_deps(deps), copts = copts, linkstatic = linkstatic, hdrs = hdrs, textual_hdrs=textual_hdrs, alwayslink=alwayslink, compatible_with=compatible_with, tags=tags, features=features, testonly = testonly, visibility= visibility, defines=defines, deprecation=deprecation, includes=includes, local_defines=local_defines,linkopts=linkopts,restricted_to=restricted_to,strip_include_prefix=strip_include_prefix,)

Filip Filmar

unread,
Oct 9, 2024, 12:33:29 PMOct 9
to Kamlesh Kumar, bazel-discuss
Why do you need to filter anything out?

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/b29e411c-efca-4089-aa7a-c3e55ae385cfn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages