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

Silence Bazel warnings from external repositories #12358

Closed
GMNGeoffrey opened this issue Oct 27, 2020 · 4 comments
Closed

Silence Bazel warnings from external repositories #12358

GMNGeoffrey opened this issue Oct 27, 2020 · 4 comments
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: feature request

Comments

@GMNGeoffrey
Copy link
Contributor

Note that this is not the same as related questions about silencing warnings from external C++ dependencies, like #12009 (although I also spend quite a lot of time trying to get that working). I'm specifically talking about silencing Bazel warnings.

Description of the problem / feature request:

My project (https://github.com/google/iree) depends on some other projects that use Bazel. We have very little control over these dependencies. In particular, depending on TensorFlow comes with a boatload of warnings. Every time I have to build a target that loads tensorflow I get a nice preamble like:

WARNING: /usr/local/google/home/gcmn/.cache/bazel/_bazel_gcmn/c17d50ae90e3b490378de262a2ee1611/external/org_tensorflow/tensorflow/core/lib/gtl/BUILD:129:11: in linkstatic attribute of cc_library rule @org_tensorflow//tensorflow/core/lib/gtl:map_util: setting 'linkstatic=1' is recommended if there are no object files. Since this rule was created by the macro 'cc_library', the error might have been caused by the macro implementation
WARNING: /usr/local/google/home/gcmn/.cache/bazel/_bazel_gcmn/c17d50ae90e3b490378de262a2ee1611/external/org_tensorflow/tensorflow/core/BUILD:1220:11: in linkstatic attribute of cc_library rule @org_tensorflow//tensorflow/core:lib_internal: setting 'linkstatic=1' is recommended if there are no object files. Since this rule was created by the macro 'cc_library', the error might have been caused by the macro implementation
WARNING: /usr/local/google/home/gcmn/.cache/bazel/_bazel_gcmn/c17d50ae90e3b490378de262a2ee1611/external/org_tensorflow/tensorflow/core/BUILD:1614:16: in linkstatic attribute of cc_library rule @org_tensorflow//tensorflow/core:framework_internal: setting 'linkstatic=1' is recommended if there are no object files. Since this rule was created by the macro 'tf_cuda_library', the error might have been caused by the macro implementation
WARNING: /usr/local/google/home/gcmn/.cache/bazel/_bazel_gcmn/c17d50ae90e3b490378de262a2ee1611/external/org_tensorflow/tensorflow/compiler/xla/client/lib/BUILD:57:11: in hdrs attribute of cc_library rule @org_tensorflow//tensorflow/compiler/xla/client/lib:comparators: file 'libliteral_util.a' from target '@org_tensorflow//tensorflow/compiler/xla:literal_util' is not allowed in hdrs. Since this rule was created by the macro 'cc_library', the error might have been caused by the macro implementation
WARNING: /usr/local/google/home/gcmn/.cache/bazel/_bazel_gcmn/c17d50ae90e3b490378de262a2ee1611/external/org_tensorflow/tensorflow/compiler/xla/client/lib/BUILD:57:11: in hdrs attribute of cc_library rule @org_tensorflow//tensorflow/compiler/xla/client/lib:comparators: file 'libliteral_util.pic.a' from target '@org_tensorflow//tensorflow/compiler/xla:literal_util' is not allowed in hdrs. Since this rule was created by the macro 'cc_library', the error might have been caused by the macro implementation
WARNING: /usr/local/google/home/gcmn/.cache/bazel/_bazel_gcmn/c17d50ae90e3b490378de262a2ee1611/external/org_tensorflow/tensorflow/compiler/xla/client/lib/BUILD:57:11: in hdrs attribute of cc_library rule @org_tensorflow//tensorflow/compiler/xla/client/lib:comparators: file 'libliteral_util.so' from target '@org_tensorflow//tensorflow/compiler/xla:literal_util' is not allowed in hdrs. Since this rule was created by the macro 'cc_library', the error might have been caused by the macro implementation

Personally I'm of the opinion that warnings should almost always be errors or nothing (otherwise they just become log spam), but setting the more general philosophy aside, these are not warnings that we have much control over and I'd like to not see them every time I build.

Feature requests: what underlying problem are you trying to solve with this feature?

Add a flag to allow silencing WARNING messages from external repositories.

What operating system are you running Bazel on?

Linux Debian

What's the output of bazel info release?

release 3.3.1 (but also reproducible with 3.7.0)

What's the output of git remote get-url origin ; git rev-parse main ; git rev-parse HEAD ?

Don't assume the default branch is master ;-P

$ git remote get-url origin ; git rev-parse main ; git rev-parse HEAD
git@github.com:GMNGeoffrey/iree.git
1cece448eef33e8c1f953788757ed74c8ac7103c
1cece448eef33e8c1f953788757ed74c8ac7103c

Have you found anything relevant by searching the web?

No. https://google.com/search?q=bazel+warnings+from+external+repositories

@aiuto aiuto added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. untriaged labels Oct 29, 2020
@sventiffe sventiffe added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Dec 4, 2020
@philwo philwo added P3 We're not considering working on this, but happy to review a PR. (No assignee) type: feature request and removed untriaged labels Dec 8, 2020
@philwo philwo removed the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Nov 29, 2021
@github-actions
Copy link

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label May 24, 2023
@GMNGeoffrey
Copy link
Contributor Author

Still a thing, though potentially a duplicate of #17030

@github-actions github-actions bot removed the stale Issues or PRs that are stale (no activity for 30 days) label May 25, 2023
Copy link

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label Jul 29, 2024
Copy link

This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please post @bazelbuild/triage in a comment here and we'll take a look. Thanks!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: feature request
Projects
None yet
Development

No branches or pull requests

4 participants