Thanks to visit codestin.com
Credit goes to github.com

Skip to content

experimental_index_url appears to invalidate dependency cache frequentlyΒ #3034

Open
@engnatha

Description

@engnatha

🐞 bug report

Affected Rule

The issue is caused by the rule: `pip.parse` used in `MODULE.bazel`

Is this a regression?

Unknown. We have not used this feature on previous versions.

Description

A clear and concise description of the problem...

pip.parse with experimental_index_url configured appears to invalidate the cache of third party pypi packages. Specifically I see a frequent rebuild of Fetching module extension pip in @@rules_python~//python/extensions:pip.bzl; starting reported in the beginning of builds despite nothing changing followed by fetches of all the packages again.

πŸ”¬ Minimal Reproduction

I can make a reproduction, but I don't think it's particularly useful if folks do not have a mirror already set up to test. The relevant needs are just to have

  1. A requirements file with some third party dependencies pip compiled to a lock file with the index url embedded.
  2. A credential helper that provides authentication to the index.
  3. A MODULE.bazel file that also sets experimental_index_url to the same index.
  4. A py_binary or some other buildable target.
  5. bazel build <the target>
  6. Stop the bazel server with bazel shutdown
  7. Rerun the command and observe it fetch from the index again.

🌍 Your Environment

Operating System:

  
Ubuntu 22.04
  

Output of bazel version:

  
Bazelisk version: v1.17.0
Build label: 7.5.0
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Thu Jan 30 18:33:17 2025 (1738261997)
Build timestamp: 1738261997
Build timestamp as int: 1738261997
  

Rules_python version:

  
1.4.1
  

Metadata

Metadata

Assignees

No one assigned

    Labels

    need: reproNeeds a minimal reproduction

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions