-
-
Notifications
You must be signed in to change notification settings - Fork 585
fix: escape name segment of stamped wheel files #2741
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
base: main
Are you sure you want to change the base?
Conversation
6bc8b25
to
1856170
Compare
@@ -440,7 +440,7 @@ def test_rule_creates_directory_and_is_included_in_wheel(self): | |||
|
|||
def test_rule_expands_workspace_status_keys_in_wheel_metadata(self): | |||
filename = self._get_path( | |||
"example_minimal_library{BUILD_USER}-0.1.{BUILD_TIMESTAMP}-py3-none-any.whl" | |||
"example_minimal_library{BUILD_USER}-0.1._BUILD_TIMESTAMP_-py3-none-any.whl" |
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.
The distribution likely needs escaping too.
abi = _replace_make_variables(ctx.attr.abi, ctx) | ||
python_tag = _replace_make_variables(ctx.attr.python_tag, ctx) | ||
version = _replace_make_variables(ctx.attr.version, ctx) | ||
|
||
filename_segments = [ | ||
_escape_filename_distribution_name(ctx.attr.distribution), | ||
normalize_pep440(version), | ||
_escape_filename_segment(normalize_pep440(version)) if is_stamping else normalize_pep440(version), |
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.
Something strange is going on, or I'm missing something.
The net code change is the same as before: normalize(...) if ... else normalize(...)
The test was updated, though? Which would mean it's working?? Is the test not covering something...?
~1 year ago
py_wheel
changed to enforce PEP440, however the resulting stamp vars are no longer escaped.For example:
Before:
bazel-bin/xxxx/xxxx-_STABLE_BUILD_SCM_VERSION_-py3-none-any.whl
After:
bazel-bin/xxxx/xxxx-{STABLE_BUILD_SCM_VERSION}-py3-none-any.whl
This results in downstream consumers of the wheel that are publishing, or generating "manifest" stye files of release artifacts and other metadata will now incorrectly replace the
{STABLE_BUILD_SCM_VERSION}
in the artifact name and path, leading to the incorrect artifact metadata and pathing.Original reported here, however this could be seen as breaking, as it changes the unstamped wheel file names.
https://bazelbuild.slack.com/archives/C0174UDLAF3/p1706726049830819