Skip to content

(pipstar) Wheel install fails when wheel has bogus permissions #3554

@thirtyseven

Description

@thirtyseven

🐞 bug report

Affected Rule

The issue is caused by the rule: pip.parse

Is this a regression?

Yes, the previous version in which this bug was not present was: 1.7

Description

When building ag-ui-adk==0.4.2 via pip.parse, _find_namespace_package_files fails with a permission denied error

🔬 Minimal Reproduction

MODULE.bazel:

bazel_dep(name = "rules_python", version = "1.8.3")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(python_version = "3.11.9")

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
    requirements_lock = "//:requirements_lock.txt",
    hub_name = "pypi",
    python_version = "3.11.9", 
)
use_repo(pip, "pypi")

requirements.in:

ag-ui-adk==0.4.2

BUILD

load("@rules_python//python:pip.bzl", "compile_pip_requirements")

compile_pip_requirements(
    name = "requirements",
    src = "requirements.in",
    requirements_txt = "requirements_lock.txt",
)

Steps to reproduce:

bazel run :requirements.update        
bazel build @pypi//...

🔥 Exception or Error




ERROR: /Users/tkaplan/Library/Caches/bazel/_bazel_tkaplan/dfc5910e1204e65cb55de615cec627b5/external/rules_python+/python/private/pypi/pypi_repo_utils.bzl:188:28: An error occurred during the fetch of repository 'rules_python++pip+pypi_311_ag_ui_adk':
   Traceback (most recent call last):
	File "/Users/tkaplan/Library/Caches/bazel/_bazel_tkaplan/dfc5910e1204e65cb55de615cec627b5/external/rules_python+/python/private/pypi/whl_library.bzl", line 433, column 79, in _whl_library_impl
		namespace_package_files = pypi_repo_utils.find_namespace_package_files(rctx, install_dir_path)
	File "/Users/tkaplan/Library/Caches/bazel/_bazel_tkaplan/dfc5910e1204e65cb55de615cec627b5/external/rules_python+/python/private/pypi/pypi_repo_utils.bzl", line 188, column 28, in _find_namespace_package_files
		content = rctx.read(init_py)
Error in read: com.google.devtools.build.lib.vfs.FileAccessException: /Users/tkaplan/Library/Caches/bazel/_bazel_tkaplan/dfc5910e1204e65cb55de615cec627b5/external/rules_python++pip+pypi_311_ag_ui_adk/site-packages/ag_ui_adk/__init__.py (Permission denied)
ERROR: no such package '@@rules_python++pip+pypi_311_ag_ui_adk//': com.google.devtools.build.lib.vfs.FileAccessException: /Users/tkaplan/Library/Caches/bazel/_bazel_tkaplan/dfc5910e1204e65cb55de615cec627b5/external/rules_python++pip+pypi_311_ag_ui_adk/site-packages/ag_ui_adk/__init__.py (Permission denied)
ERROR: /Users/tkaplan/Library/Caches/bazel/_bazel_tkaplan/dfc5910e1204e65cb55de615cec627b5/external/rules_python++pip+pypi/ag_ui_adk/BUILD.bazel:5:12: @@rules_python++pip+pypi//ag_ui_adk:dist_info depends on @@rules_python++pip+pypi_311_ag_ui_adk//:dist_info in repository @@rules_python++pip+pypi_311_ag_ui_adk which failed to fetch. no such package '@@rules_python++pip+pypi_311_ag_ui_adk//': com.google.devtools.build.lib.vfs.FileAccessException: /Users/tkaplan/Library/Caches/bazel/_bazel_tkaplan/dfc5910e1204e65cb55de615cec627b5/external/rules_python++pip+pypi_311_ag_ui_adk/site-packages/ag_ui_adk/__init__.py (Permission denied)

🌍 Your Environment

Operating System:

  
macOS 15.7.3
  

Output of bazel version:

  
9.0.0
  

Rules_python version:

  
1.8.3
  

Anything else relevant?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions