rules_python icon indicating copy to clipboard operation
rules_python copied to clipboard

cycle support which replaces `:pkg` with `:_pkg`breaks aspects

Open johnynek opened this issue 1 year ago • 0 comments

🐞 bug report

Affected Rule

pip_parse/pip_repository

Is this a regression?

Yes this is a regression.

Description

The change in this PR: https://github.com/bazelbuild/rules_python/pull/1166/files

specifically unconditionally introducing an impl label _pkg https://github.com/bazelbuild/rules_python/pull/1166/files#diff-ca70482c01526a5439dab7ac2cb14e637684e50daca723d8e6b4e58ca45cbc67R20

that is aliased back to pkg breaks aspects. In an aspect, you will get the target of the alias, which will be _pkg. So, with this change, we need to realias back to the public alias.

This causes breakages for anyone using aspects.

🔬 Minimal Reproduction

You can clearly see the generated build files now make the real :_pkg target private.

🌍 Your Environment

Operating System:

  
macos and linux
  

Output of bazel version:

  
Bazelisk version: v1.16.0
Build label: 6.3.2
Build target: bazel-out/darwin_arm64-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Aug 8 15:51:44 2023 (1691509904)
Build timestamp: 1691509904
Build timestamp as int: 1691509904
  

Rules_python version:

  
0.31.0
  

johnynek avatar Feb 14 '24 23:02 johnynek