ali5h / rules_pip

pip package rules for bazel that are fast (incremental fetch), support different python versions and work with all kinds of packages (i.e. packages with namespaces)
MIT License
60 stars 24 forks source link

symlink to requirements file not being generated. #14

Closed sambatyon closed 4 years ago

sambatyon commented 4 years ago

We introduced the rules pip in our system a few weeks back, then we started having certain issues, the output error is the following (slightly edited):

INFO: Call stack for the definition of repository 'pypi__3__cython_0_29_13' which is a whl_library (rule definition at /home/ubuntu/.cache/bazel-cache/<custom-output-path>/external/com_github_ali5h_rules_pip/defs.bzl:97:15):
 - /home/ubuntu/.cache/bazel-cache/<custom-output-path>/external/subsystem_import/requirements.bzl:8:5
 - /home/ubuntu/.cache/src/WORKSPACE:308:1
ERROR: An error occurred during the fetch of repository 'pypi__3__cython_0_29_13':
   Not a regular file: /home/ubuntu/.cache/bazel-cache/<custom-output-path>/external/subsystem_import/requirements.txt
ERROR: /home/ubuntu/.cache/src/path/to/target/BUILD:12:1: //path/to/target:python_tool depends on @pypi__3__cython_0_29_13//:pkg in repository @pypi__3__cython_0_29_13 which failed to fetch. no such package '@pypi__3__cython_0_29_13//': Not a regular file: /home/ubuntu/.cache/bazel-cache/<custom-output-path>/external/subsystem_import/requirements.txt
ERROR: Analysis of target '//path/to/target:python_tool' failed; build aborted: no such package '@pypi__3__cython_0_29_13//': Not a regular file: /home/ubuntu/.cache/bazel-cache/<custom-output-path>/external/subsystem_import/requirements.txt

Checking the directory /home/ubuntu/.cache/bazel-cache/<custom-output-path>/external/subsystem_import/ we only have the following files:

BUILD
WORKSPACE
requirements.bzl

Our WORKSPACE looks something like this:

pip_import(
    name = "subsystem_imports",
    python_version = "3",
    requirements = "//path/to/target:requirements.txt",
)

load("@subsystem_imports//:requirements.bzl", subsystem_pip_install = "pip_install")

subsystem_pip_install()
ali5h commented 4 years ago

would u try no-symlink branch (https://github.com/ali5h/rules_pip/tree/no-symlink)

sambatyon commented 4 years ago

I will close this, apparently we had a cleanup script which deleted some symlinks it shouldn't