-
-
Notifications
You must be signed in to change notification settings - Fork 610
Description
🐞 bug report
Affected Rule
The issue is caused by the rule: py_wheel
Is this a regression?
I am unaware of a previous version where this is working.
Description
The output filename of a py_wheel
target does not respect stamp info rendering
of the version
field, even though it is used in the internal wheel files.
Here is example output from a target that uses BUILD_TIMESTAMP
in the version.
$ bazel build //:wheel
Starting local Bazel server and connecting to it...
INFO: Analyzed target //:wheel (42 packages loaded, 319 targets configured).
INFO: Found 1 target...
Target //:wheel up-to-date:
bazel-bin/test_wheel-0.0.1_BUILD_TIMESTAMP_-py3-none-any.whl
INFO: Elapsed time: 3.387s, Critical Path: 0.14s
INFO: 7 processes: 6 internal, 1 linux-sandbox.
INFO: Build completed successfully, 7 total actions
Note the output file is named test_wheel-0.0.1_BUILD_TIMESTAMP_-py3-none-any.whl
instead of rendering the stamp value of BUILD_TIMESTAMP
.
However, if the .whl
file is opened, it contains the expected name of e.g.
test_wheel-0.0.1_1656829011.dist-info
for the dist-info
directory.
In addition, bazel-bin/wheel.name
contains the correctly rendered name, e.g.
test-wheel-0.0.1-1656829011-py3-none-any.whl
, which does not match the output file.
🔬 Minimal Reproduction
https://github.com/psigen/rules_python-issue-741
🔥 Exception or Error
N/A
🌍 Your Environment
Operating System:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.4 LTS"
Output of bazel version
:
Bazelisk version: v1.10.1
Build label: 5.2.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Jun 7 16:02:26 2022 (1654617746)
Build timestamp: 1654617746
Build timestamp as int: 1654617746
Rules_python version:
http_archive(
name = "rules_python",
sha256 = "56dc7569e5dd149e576941bdb67a57e19cd2a7a63cc352b62ac047732008d7e1",
strip_prefix = "rules_python-0.10.0",
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.10.0.tar.gz",
)
Anything else relevant?
Note that this behavior happens with the --stamp
flag or with stamp=1
on the py_wheel
target.