bazelbuild/bazel

Selectively silence warnings from the bazel downloader

Open

#23,173 建立於 2024年7月31日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)Java (4,465 fork)batch import
P3help wantedteam-ExternalDepstype: feature request

倉庫指標

Star
 (25,384 star)
PR 合併指標
 (平均合併 22天 20小時) (30 天內合併 77 個 PR)

描述

Description of the feature request:

Provide a way to silence warnings from the Bazel downloader.

I'm pretty neutral on the implementation. Options include:

Which category does this issue belong to?

Core

What underlying problem are you trying to solve with this feature?

https://github.com/bazelbuild/rules_python/issues/2100

The current implementation of rules_python's experimental "use bazel downloader to download python packages" will search all indexes - the primary index defined by experimental_index_url and all of the indexes defined by experimental_extra_index_urls - for all packages.

However, only one of the python package indexes will contain the given package, and the rest will either not contain the package (404) or will fail auth (401). This results in a lot of WARNING messages:

$ bazel test //src/pyle_xc/fab/package_tester:web_api_test
Starting local Bazel server and connecting to it...
WARNING: Download from https://[REDACTED]/simple/rsa/ failed: class java.io.FileNotFoundException GET returned 404 Not Found
WARNING: Download from https://[REDACTED]/simple/uv/ failed: class java.io.FileNotFoundException GET returned 404 Not Found
...

For python projects that have a lot of dependencies, this creates a wall of warnings in the terminal.

Current workarounds include:

  • use experimental_index_url_overrides in rules_python
    • Not super feasible when there are a lot of packages, as now multiple package definitions need to stay in sync (the requirements lock file and MODULE.bazel)
  • Use a single virtual repository.
    • This causes all packages to be downloaded from a single source and then 404 errors are real.
    • I'm trying to convince our software ops team to implement this, but it's slow going :upside_down_face:

Which operating system are you running Bazel on?

gLinux

What is the output of bazel info release?

release 7.2.0

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

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

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

貢獻者指南