bazelbuild/bazel

Selectively silence warnings from the bazel downloader

Open

#23,173 opened on Jul 31, 2024

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Java (4,465 forks)batch import
P3help wantedteam-ExternalDepstype: feature request

Repository metrics

Stars
 (25,384 stars)
PR merge metrics
 (Avg merge 22d 20h) (77 merged PRs in 30d)

Description

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

Contributor guide