Skip to content

Dependency package metadata fetched excessively despite valid build cache #3034

@engnatha

Description

@engnatha

🐞 bug report

Affected Rule

The issue is caused when dependencies are used with `pip.parse` (or `pip_parse` in WORKSPACE).

Is this a regression?

Yes, this previously worked well up to version `1.3.0`. It first broke with `1.4.0-rc0` and is still broken on the latest release of `1.5.1`.

Description

A clear and concise description of the problem...

pip.parse 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. Without an internet connection, this step fails and successive runs with internet restored keep failing until bazel shutdown is called. Note that this cache invalidation is not happening due to a terminated or failed build nor is it because any digest inputs have changed. It appears related to the lifetime of the bazel server.

🔬 Minimal Reproduction

See https://github.com/engnatha/rules_python_package_fetch_repro

🌍 Your Environment

Operating System:

  
Ubuntu 22.04 and 24.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.0-rc0 and forward
  

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