-
-
Notifications
You must be signed in to change notification settings - Fork 590
Fix leading forward slashes in RECORD files produced by py_wheel
.
#789
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
groodt
approved these changes
Aug 14, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
rdesgroppes
added a commit
to rdesgroppes/bookingcom-buildtools
that referenced
this pull request
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 pull request
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: closes #745
What is the new behavior?
This fixes broken packages produced by
py_wheel
.Does this PR introduce a breaking change?
Other information