-
-
Notifications
You must be signed in to change notification settings - Fork 650
Closed
Labels
Description
🐞 bug report
Affected Rule
The issue is caused by the rule: https://github.com/bazelbuild/rules_python/blob/b106f91c9da7e31d73a7293e88ac78eedcad2057/gazelle/python/generate.go#L215Is this a regression?
NoDescription
This is necessary in monorepo situations where there are multiple # gazelle:python_root directives used, e.g. in the structure below:
ROOT
proj_1
src # is a python root and depends on proj_2
foo
proj_2
src # is a python root
bar ← The visibility here will be incorrect; proj_1 cannot see this.
As it stands, we write a narrowly scoped visibility attribute for every generated rule; the visibility is //{python-root-package}:__subpackages__. Bazel will fail to build targets in proj_1 because of this.
🔥 Exception or Error
🌍 Your Environment
Operating System:
macOS 14.2
Output of bazel version:
Build label: 7.0.0
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Mon Dec 11 16:52:42 2023 (1702313562)
Build timestamp: 1702313562
Build timestamp as int: 1702313562
Rules_python version:
0.27.1
Anything else relevant?
The desired implementation is not to set everything to //visibility:public, rather, it's to resolve cross-project dependencies in a monorepo the same way as they are within one directory.
Consider a working example here: main...aryamccarthy:rules_python:main