-
-
Notifications
You must be signed in to change notification settings - Fork 591
RECORD file is broken if strip_path_prefixes
used
#745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
12 tasks
rdesgroppes
added a commit
to rdesgroppes/bookingcom-buildtools
that referenced
this issue
Nov 24, 2022
Prior to `rules_python` version 0.11.0, `py_wheel` used to generate invalid RECORD entries for file paths outside of the current package: ``` Traceback (most recent call last): File "[...]/pip_install/extract_wheels/extract_single_wheel.py", line 105, in <module> main() File "[...]/pip_install/extract_wheels/extract_single_wheel.py", line 93, in main bazel.extract_wheel( File "[...]/pip_install/extract_wheels/bazel.py", line 364, in extract_wheel whl.unzip(directory) File "[...]/pip_install/extract_wheels/wheel.py", line 90, in unzip installer.install( File "[...]/pypi__installer/installer/_core.py", line 96, in install for record_elements, stream, is_executable in source.get_contents(): File "[...]/pypi__installer/installer/sources.py", line 158, in get_contents assert record is not None, "In {}, {} is not mentioned in RECORD".format( AssertionError: In unused_deps_py-0.0.5-py3-none-any.whl, compatibility_tests/v2.5.0/tests/__init__.py is not mentioned in RECORD ``` This was reported through bazel-contrib/rules_python#745, then fixed by bazel-contrib/rules_python#789. `rules_python`'s version gets here conservatively bumped to the corresponding bugfix version: [0.11.0](https://github.com/bazelbuild/rules_python/releases/tag/0.11.0) Practically, the main difference between unused_deps_py-0.0.5.dist-info/RECORD and unused_deps_py-0.0.6.dist-info/RECORD consists in leading `/` being stripped: ```diff -/compatibility_tests/v2.5.0/tests/__init__.py,sha256=8SXBh8YGxPXGDmFtR_n90wt5xWvc5CEp_L5Pn687VaU,150 [...] -/compatibility_tests/v2.5.0/tests/google/protobuf/internal/__init__.py,sha256=H-9Le6XWW7Ikwaq9qPneZts4ZitfM2XgeK4x-B5joTA,1867 +compatibility_tests/v2.5.0/tests/__init__.py,sha256=8SXBh8YGxPXGDmFtR_n90wt5xWvc5CEp_L5Pn687VaU,150 [...] +compatibility_tests/v2.5.0/tests/google/protobuf/internal/__init__.py,sha256=H-9Le6XWW7Ikwaq9qPneZts4ZitfM2XgeK4x-B5joTA,1867 ``` and: ```diff -/google/__init__.py,sha256=8SXBh8YGxPXGDmFtR_n90wt5xWvc5CEp_L5Pn687VaU,150 [...] -/google/protobuf/wrappers_pb2.py,sha256=xybMLGFD_xtm-GZ0owcWN-44dDkI5oR2U8Tl_ZngwpQ,12473 +google/__init__.py,sha256=8SXBh8YGxPXGDmFtR_n90wt5xWvc5CEp_L5Pn687VaU,150 [...] +google/protobuf/wrappers_pb2.py,sha256=xybMLGFD_xtm-GZ0owcWN-44dDkI5oR2U8Tl_ZngwpQ,12473 ``` Note: with latest version of `rules_python` (0.14.0 as of Nov 24, 2022), the build would fail on: > ERROR: $PWD/unused_deps_py/unused_deps_py_lib/BUILD.bazel:5:11: no > such package '@unused_deps_py_pip_java_manifest//': The repository > '@unused_deps_py_pip_java_manifest' could not be resolved: Repository > '@unused_deps_py_pip_java_manifest' is not defined and referenced by > '//unused_deps_py/unused_deps_py_lib:unused_deps_py_lib'
rdesgroppes
added a commit
to rdesgroppes/bookingcom-buildtools
that referenced
this issue
Nov 24, 2022
Prior to `rules_python` version 0.11.0, `py_wheel` used to generate invalid RECORD entries for file paths outside of the current package: ``` Traceback (most recent call last): File "[...]/pip_install/extract_wheels/extract_single_wheel.py", line 105, in <module> main() File "[...]/pip_install/extract_wheels/extract_single_wheel.py", line 93, in main bazel.extract_wheel( File "[...]/pip_install/extract_wheels/bazel.py", line 364, in extract_wheel whl.unzip(directory) File "[...]/pip_install/extract_wheels/wheel.py", line 90, in unzip installer.install( File "[...]/pypi__installer/installer/_core.py", line 96, in install for record_elements, stream, is_executable in source.get_contents(): File "[...]/pypi__installer/installer/sources.py", line 158, in get_contents assert record is not None, "In {}, {} is not mentioned in RECORD".format( AssertionError: In unused_deps_py-0.0.5-py3-none-any.whl, compatibility_tests/v2.5.0/tests/__init__.py is not mentioned in RECORD ``` This was reported through bazel-contrib/rules_python#745, then fixed by bazel-contrib/rules_python#789. `rules_python`'s version gets here conservatively bumped to the corresponding bugfix version: [0.11.0](https://github.com/bazelbuild/rules_python/releases/tag/0.11.0) Practically, the main difference between unused_deps_py-0.0.5.dist-info/RECORD and unused_deps_py-0.0.6.dist-info/RECORD consists in leading `/` being stripped: ```diff -/compatibility_tests/v2.5.0/tests/__init__.py,sha256=8SXBh8YGxPXGDmFtR_n90wt5xWvc5CEp_L5Pn687VaU,150 [...] -/compatibility_tests/v2.5.0/tests/google/protobuf/internal/__init__.py,sha256=H-9Le6XWW7Ikwaq9qPneZts4ZitfM2XgeK4x-B5joTA,1867 +compatibility_tests/v2.5.0/tests/__init__.py,sha256=8SXBh8YGxPXGDmFtR_n90wt5xWvc5CEp_L5Pn687VaU,150 [...] +compatibility_tests/v2.5.0/tests/google/protobuf/internal/__init__.py,sha256=H-9Le6XWW7Ikwaq9qPneZts4ZitfM2XgeK4x-B5joTA,1867 ``` and: ```diff -/google/__init__.py,sha256=8SXBh8YGxPXGDmFtR_n90wt5xWvc5CEp_L5Pn687VaU,150 [...] -/google/protobuf/wrappers_pb2.py,sha256=xybMLGFD_xtm-GZ0owcWN-44dDkI5oR2U8Tl_ZngwpQ,12473 +google/__init__.py,sha256=8SXBh8YGxPXGDmFtR_n90wt5xWvc5CEp_L5Pn687VaU,150 [...] +google/protobuf/wrappers_pb2.py,sha256=xybMLGFD_xtm-GZ0owcWN-44dDkI5oR2U8Tl_ZngwpQ,12473 ``` Note: with latest version of `rules_python` (0.14.0 as of Nov 24, 2022), the build would fail on: > ERROR: $PWD/unused_deps_py/unused_deps_py_lib/BUILD.bazel:5:11: no > such package '@unused_deps_py_pip_java_manifest//': The repository > '@unused_deps_py_pip_java_manifest' could not be resolved: Repository > '@unused_deps_py_pip_java_manifest' is not defined and referenced by > '//unused_deps_py/unused_deps_py_lib:unused_deps_py_lib'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! Following rule
creates wheel with RECORD file containing following records:
The issue is that remaining leading slash in first files break the package. If you will try to install such wheel with
requirement
it failes athttps://github.com/pypa/installer/blob/main/src/installer/sources.py#L158
The solution is to merely
lstrip
this slash for every line in RECORDThe text was updated successfully, but these errors were encountered: