rules_python icon indicating copy to clipboard operation
rules_python copied to clipboard

pypi__installer error writing entrypoints: FileExistsError: File already exists

Open UebelAndre opened this issue 1 year ago • 3 comments

🐞 bug report

Affected Rule

pip_parse

Is this a regression?

Surely at some point but have yet to bisect

Description

Some dependencies cause failures when rendering wheels making pip_parse unusable with them.

🔬 Minimal Reproduction

With the files listed below, run:

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

WORKSPACE.bazel

workspace(name = "entrypoints")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "rules_python",
    sha256 = "e85ae30de33625a63eca7fc40a94fea845e641888e52f32b6beea91e8b1b2793",
    strip_prefix = "rules_python-0.27.1",
    url = "https://github.com/bazelbuild/rules_python/releases/download/0.27.1/rules_python-0.27.1.tar.gz",
)

load("@rules_python//python:repositories.bzl", "py_repositories")

py_repositories()

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

pip_parse(
    name = "pip_deps",
    requirements_lock = "//:requirements.txt",
)

load("@pip_deps//:requirements.bzl", "install_deps")

install_deps()

BUILD.bazel

load("@pip_deps//:requirements.bzl", "requirement")
load("@rules_python//python:defs.bzl", "py_library")
load("@rules_python//python:pip.bzl", "compile_pip_requirements")

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

py_library(
    name = "bad",
    srcs = [],
    deps = [requirement("jupyter-contrib-nbextensions")],
)

.bazelrc

# I don't know bzlmod so going old-school
common --noenable_bzlmod

requirements.in

jupyter-contrib-nbextensions==0.5.1

requirements.txt

#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
#    bazel run //:requirements.update
#

🔥 Exception or Error


ERROR: /private/var/tmp/_bazel_user/2a35cccdc05cbec59a6acf085a26daa2/external/pip_deps/jupyter_contrib_nbextensions/BUILD.bazel:8:6: @@pip_deps//jupyter_contrib_nbextensions:pkg depends on @@pip_deps_jupyter_contrib_nbextensions//:pkg in repository @@pip_deps_jupyter_contrib_nbextensions which failed to fetch. no such package '@@pip_deps_jupyter_contrib_nbextensions//': whl_library pip_deps_jupyter_contrib_nbextensions failed:  (Traceback (most recent call last):
  File "", line 198, in _run_module_as_main
  File "", line 88, in _run_code
  File "/private/var/tmp/_bazel_user/2a35cccdc05cbec59a6acf085a26daa2/external/rules_python/python/pip_install/tools/wheel_installer/wheel_installer.py", line 207, in 
    main()
  File "/private/var/tmp/_bazel_user/2a35cccdc05cbec59a6acf085a26daa2/external/rules_python/python/pip_install/tools/wheel_installer/wheel_installer.py", line 163, in main
    _extract_wheel(
  File "/private/var/tmp/_bazel_user/2a35cccdc05cbec59a6acf085a26daa2/external/rules_python/python/pip_install/tools/wheel_installer/wheel_installer.py", line 123, in _extract_wheel
    whl.unzip(installation_dir)
  File "/private/var/tmp/_bazel_user/2a35cccdc05cbec59a6acf085a26daa2/external/rules_python/python/pip_install/tools/wheel_installer/wheel.py", line 105, in unzip
    installer.install(
  File "/private/var/tmp/_bazel_user/2a35cccdc05cbec59a6acf085a26daa2/external/pypi__installer/installer/_core.py", line 109, in install
    record = destination.write_file(
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/tmp/_bazel_user/2a35cccdc05cbec59a6acf085a26daa2/external/pypi__installer/installer/destinations.py", line 203, in write_file
    return self.write_to_fs(
           ^^^^^^^^^^^^^^^^^
  File "/private/var/tmp/_bazel_user/2a35cccdc05cbec59a6acf085a26daa2/external/pypi__installer/installer/destinations.py", line 167, in write_to_fs
    raise FileExistsError(message)
FileExistsError: File already exists: ./bin/jupyter-contrib-nbextension
) error code: '1'

🌍 Your Environment

Operating System:

  
Linux, MacOS
  

Output of bazel version:

  
7.0.0
  

Rules_python version:

  
0.27.1
  

Anything else relevant?

UebelAndre avatar Dec 28 '23 14:12 UebelAndre

Same error using a bzlmod installation too.

Bazel version: 7.1.2

#MODULE.bazel
module(
    name = "aws",
    version = "0.0.0",
)

bazel_dep(name = "rules_python", version = "0.32.2")

python = use_extension("@rules_python//extensions:python.bzl", "python")
python.toolchain(
    name = "python",
    is_default = True,
    python_version = "3.11",
)
use_repo(python, "python_toolchains")

register_toolchains("@python_toolchains//:all")

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
    hub_name = "awsebcli",
    python_version = "3.11",
    requirements_lock = "//:requirements.txt",
)
use_repo(pip, "awsebcli")
#requirements.txt
awsebcli
bazel build @awsebcli//...

or

bazel run @awsebcli//awsebcli:awsebcli
#output
nick@walnut:~/src/api$ bazel build @awsebcli//awsebcli
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=372
INFO: Reading rc options for 'build' from /home/nick/.bazelrc:
  Inherited 'common' options: --announce_rc
INFO: Repository rules_python~~pip~awsebcli_311_awsebcli instantiated at:
  <builtin>: in <toplevel>
Repository rule whl_library defined at:
  /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/pip_repository.bzl:1024:30: in <toplevel>
ERROR: An error occurred during the fetch of repository 'rules_python~~pip~awsebcli_311_awsebcli':
   Traceback (most recent call last):
        File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/pip_repository.bzl", line 874, column 31, in _whl_library_impl
                repo_utils.execute_checked(
        File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/private/repo_utils.bzl", line 145, column 29, in _execute_checked
                return _execute_internal(fail_on_error = True, *args, **kwargs)
        File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/private/repo_utils.bzl", line 86, column 13, in _execute_internal
                fail((
Error in fail: repo.execute: whl_library.ExtractWheel(rules_python~~pip~awsebcli_311_awsebcli, /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~pip~awsebcli_311_awsebcli/awsebcli-3.20.10-py3-none-any.whl): end: failure:
  command: /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~python2~python_3_11_host/python -m python.pip_install.tools.wheel_installer.wheel_installer --requirement awsebcli --isolated --extra_pip_args "{\"arg\":[]}" --pip_data_exclude "{\"arg\":[]}" --environment "{\"arg\":{}}" --whl-file /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~pip~awsebcli_311_awsebcli/awsebcli-3.20.10-py3-none-any.whl
  return code: 1
  working dir: <default: /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~pip~awsebcli_311_awsebcli>
  timeout: 600
  environment:
PYTHONPATH="/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__build:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__click:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__colorama:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__importlib_metadata:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__installer:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__more_itertools:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__packaging:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__pep517:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__pip:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__pip_tools:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__pyproject_hooks:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__setuptools:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__tomli:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__wheel:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__zipp"
CPPFLAGS="-isystem /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~python2~python_3_11_host/include/python3.11"
<stdout empty>
===== stderr start =====
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/tools/wheel_installer/wheel_installer.py", line 205, in <module>
    main()
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/tools/wheel_installer/wheel_installer.py", line 160, in main
    _extract_wheel(
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/tools/wheel_installer/wheel_installer.py", line 121, in _extract_wheel
    whl.unzip(installation_dir)
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/tools/wheel_installer/wheel.py", line 637, in unzip
    installer.install(
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__installer/installer/_core.py", line 109, in install
    record = destination.write_file(
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__installer/installer/destinations.py", line 203, in write_file
    return self.write_to_fs(
           ^^^^^^^^^^^^^^^^^
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__installer/installer/destinations.py", line 167, in write_to_fs
    raise FileExistsError(message)
FileExistsError: File already exists: ./bin/eb
===== stderr end =====
ERROR: <builtin>: fetching whl_library rule //:rules_python~~pip~awsebcli_311_awsebcli: Traceback (most recent call last):
        File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/pip_repository.bzl", line 874, column 31, in _whl_library_impl
                repo_utils.execute_checked(
        File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/private/repo_utils.bzl", line 145, column 29, in _execute_checked
                return _execute_internal(fail_on_error = True, *args, **kwargs)
        File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/private/repo_utils.bzl", line 86, column 13, in _execute_internal
                fail((
Error in fail: repo.execute: whl_library.ExtractWheel(rules_python~~pip~awsebcli_311_awsebcli, /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~pip~awsebcli_311_awsebcli/awsebcli-3.20.10-py3-none-any.whl): end: failure:
  command: /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~python2~python_3_11_host/python -m python.pip_install.tools.wheel_installer.wheel_installer --requirement awsebcli --isolated --extra_pip_args "{\"arg\":[]}" --pip_data_exclude "{\"arg\":[]}" --environment "{\"arg\":{}}" --whl-file /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~pip~awsebcli_311_awsebcli/awsebcli-3.20.10-py3-none-any.whl
  return code: 1
  working dir: <default: /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~pip~awsebcli_311_awsebcli>
  timeout: 600
  environment:
PYTHONPATH="/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__build:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__click:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__colorama:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__importlib_metadata:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__installer:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__more_itertools:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__packaging:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__pep517:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__pip:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__pip_tools:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__pyproject_hooks:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__setuptools:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__tomli:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__wheel:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__zipp"
CPPFLAGS="-isystem /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~python2~python_3_11_host/include/python3.11"
<stdout empty>
===== stderr start =====
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/tools/wheel_installer/wheel_installer.py", line 205, in <module>
    main()
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/tools/wheel_installer/wheel_installer.py", line 160, in main
    _extract_wheel(
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/tools/wheel_installer/wheel_installer.py", line 121, in _extract_wheel
    whl.unzip(installation_dir)
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/tools/wheel_installer/wheel.py", line 637, in unzip
    installer.install(
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__installer/installer/_core.py", line 109, in install
    record = destination.write_file(
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__installer/installer/destinations.py", line 203, in write_file
    return self.write_to_fs(
           ^^^^^^^^^^^^^^^^^
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__installer/installer/destinations.py", line 167, in write_to_fs
    raise FileExistsError(message)
FileExistsError: File already exists: ./bin/eb
===== stderr end =====
ERROR: no such package '@@rules_python~~pip~awsebcli_311_awsebcli//': repo.execute: whl_library.ExtractWheel(rules_python~~pip~awsebcli_311_awsebcli, /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~pip~awsebcli_311_awsebcli/awsebcli-3.20.10-py3-none-any.whl): end: failure:
  command: /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~python2~python_3_11_host/python -m python.pip_install.tools.wheel_installer.wheel_installer --requirement awsebcli --isolated --extra_pip_args "{\"arg\":[]}" --pip_data_exclude "{\"arg\":[]}" --environment "{\"arg\":{}}" --whl-file /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~pip~awsebcli_311_awsebcli/awsebcli-3.20.10-py3-none-any.whl
  return code: 1
  working dir: <default: /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~pip~awsebcli_311_awsebcli>
  timeout: 600
  environment:
PYTHONPATH="/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__build:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__click:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__colorama:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__importlib_metadata:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__installer:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__more_itertools:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__packaging:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__pep517:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__pip:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__pip_tools:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__pyproject_hooks:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__setuptools:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__tomli:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__wheel:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__zipp"
CPPFLAGS="-isystem /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~python2~python_3_11_host/include/python3.11"
<stdout empty>
===== stderr start =====
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/tools/wheel_installer/wheel_installer.py", line 205, in <module>
    main()
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/tools/wheel_installer/wheel_installer.py", line 160, in main
    _extract_wheel(
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/tools/wheel_installer/wheel_installer.py", line 121, in _extract_wheel
    whl.unzip(installation_dir)
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/tools/wheel_installer/wheel.py", line 637, in unzip
    installer.install(
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__installer/installer/_core.py", line 109, in install
    record = destination.write_file(
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__installer/installer/destinations.py", line 203, in write_file
    return self.write_to_fs(
           ^^^^^^^^^^^^^^^^^
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__installer/installer/destinations.py", line 167, in write_to_fs
    raise FileExistsError(message)
FileExistsError: File already exists: ./bin/eb
===== stderr end =====
ERROR: /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~pip~awsebcli/awsebcli/BUILD.bazel:10:6: @@rules_python~~pip~awsebcli//awsebcli:pkg depends on @@rules_python~~pip~awsebcli_311_awsebcli//:pkg in repository @@rules_python~~pip~awsebcli_311_awsebcli which failed to fetch. no such package '@@rules_python~~pip~awsebcli_311_awsebcli//': repo.execute: whl_library.ExtractWheel(rules_python~~pip~awsebcli_311_awsebcli, /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~pip~awsebcli_311_awsebcli/awsebcli-3.20.10-py3-none-any.whl): end: failure:
  command: /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~python2~python_3_11_host/python -m python.pip_install.tools.wheel_installer.wheel_installer --requirement awsebcli --isolated --extra_pip_args "{\"arg\":[]}" --pip_data_exclude "{\"arg\":[]}" --environment "{\"arg\":{}}" --whl-file /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~pip~awsebcli_311_awsebcli/awsebcli-3.20.10-py3-none-any.whl
  return code: 1
  working dir: <default: /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~pip~awsebcli_311_awsebcli>
  timeout: 600
  environment:
PYTHONPATH="/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__build:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__click:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__colorama:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__importlib_metadata:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__installer:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__more_itertools:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__packaging:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__pep517:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__pip:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__pip_tools:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__pyproject_hooks:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__setuptools:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__tomli:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__wheel:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__zipp"
CPPFLAGS="-isystem /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~python2~python_3_11_host/include/python3.11"
<stdout empty>
===== stderr start =====
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/tools/wheel_installer/wheel_installer.py", line 205, in <module>
    main()
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/tools/wheel_installer/wheel_installer.py", line 160, in main
    _extract_wheel(
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/tools/wheel_installer/wheel_installer.py", line 121, in _extract_wheel
    whl.unzip(installation_dir)
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/tools/wheel_installer/wheel.py", line 637, in unzip
    installer.install(
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__installer/installer/_core.py", line 109, in install
    record = destination.write_file(
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__installer/installer/destinations.py", line 203, in write_file
    return self.write_to_fs(
           ^^^^^^^^^^^^^^^^^
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__installer/installer/destinations.py", line 167, in write_to_fs
    raise FileExistsError(message)
FileExistsError: File already exists: ./bin/eb
===== stderr end =====
ERROR: Analysis of target '@@rules_python~~pip~awsebcli//awsebcli:awsebcli' failed; build aborted: Analysis failed
INFO: Elapsed time: 1.003s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
nick@walnut:~/src/api$ code: 1
  working dir: <default: /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~pip~awsebcli_311_awsebcli>
  timeout: 600
  environment:
PYTHONPATH="/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__build:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__click:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__colorama:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__importlib_metadata:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__installer:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__more_itertools:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__packaging:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__pep517:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__pip:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__pip_tools:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__pyproject_hooks:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__setuptools:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__tomli:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__wheel:/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~internal_deps~pypi__zipp"
CPPFLAGS="-isystem /home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~~python2~python_3_11_host/include/python3.11"
<stdout empty>
===== stderr start =====
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/tools/wheel_installer/wheel_installer.py", line 205, in <module>
    main()
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/tools/wheel_installer/wheel_installer.py", line 160, in main
    _extract_wheel(
  File "/home/nick/.cache/bazel/_bazel_nick/262edbc3edec9cf736bf598752259bf0/external/rules_python~/python/pip_install/tools/wheel_installer/wheel_installer.py", line 121, in _extract_wheel
    whl.unzip(installation_dir)

nickbreen avatar May 18 '24 04:05 nickbreen

I think we should probably stop writing/installing entry points as we have a py_console_script_binary alternative. Is anyone depending on using the entrypoints?

aignas avatar Jul 23 '24 08:07 aignas

Agree. I actually meant to do this the other day. You do need it to grab scripts however...

I think as a temporary worse found, this issue can be fixed upstream or the wheel patched. I believe it will fail outside bazel too.

groodt avatar Jul 23 '24 10:07 groodt