-
-
Notifications
You must be signed in to change notification settings - Fork 644
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
generate unstable package versions which can be ordered by timestamp in release.sh #7399
Comments
Note that the timestamp component should be relatively easy to generate, but may require coordination between wheel shards in CI to work: see #7400 (comment). This might not be too difficult though. |
cosmicexplorer
added a commit
that referenced
this issue
Mar 19, 2019
… parsed and truncated as a number (#7400) ### Problem See #7399. The commit 0672383 experienced CI failures, because our current method of generating the "unstable" pants version to build wheels puts the hexadecimal sha as its own version component: if the sha happens to be completely numeric and begins with any zeroes, `packaging.version.Version()` will helpfully truncate it -- but our `release.sh` script wasn't aware of that. ### Solution - Add a non-numeric prefix before the sha to generate `PANTS_UNSTABLE_VERSION` in `release.sh` to avoid possible truncation. - The prefix chosen was `git`. ### Result Commit shas starting with zero and containing only numbers for the first 8 characters will no longer fail in CI.
stuhood
pushed a commit
that referenced
this issue
Mar 20, 2019
… parsed and truncated as a number (#7400) ### Problem See #7399. The commit 0672383 experienced CI failures, because our current method of generating the "unstable" pants version to build wheels puts the hexadecimal sha as its own version component: if the sha happens to be completely numeric and begins with any zeroes, `packaging.version.Version()` will helpfully truncate it -- but our `release.sh` script wasn't aware of that. ### Solution - Add a non-numeric prefix before the sha to generate `PANTS_UNSTABLE_VERSION` in `release.sh` to avoid possible truncation. - The prefix chosen was `git`. ### Result Commit shas starting with zero and containing only numbers for the first 8 characters will no longer fail in CI.
Thinking about this again, it should be possible to deterministically extract the commit timestamp to use here, which avoid needing to coordinate between shards. |
huonw
added a commit
that referenced
this issue
May 31, 2023
…#19179) Fixes #7399 by adjusting the local version identifier of 'unstable' wheels to also include a timestamp, so that builds with the same stable version can be sorted in a vaguely sensible way, without having to dereference the git hash manually. The timestamp chosen is the committer date of the commit in question, formatted as a vaguely human readable number (`yyyymmddHHMM`). For example, this PR's CI built `pantsbuild.pants-2.18.0.dev0+202305302357.git111f44db-cp39-cp39-macosx_11_0_arm64.whl`, corresponding to 2023-05-30 23:57.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CI on master was broken after merging 0672383, because when building wheels, our release script sets
PANTS_UNSTABLE_VERSION
to be the version insrc/python/pants/VERSION
, along with the first 8 characters of the commit sha. This should be fine, but not mentioned in https://www.python.org/dev/peps/pep-0440/#local-version-identifiers is that local build tags which consist of only numbers will have leading zeroes truncated, e.g.:This required a fix in #7400 by prefacing the sha with a constant non-numeric string to avoid it getting parsed as a number.
While that was fixed, it might also be pretty useful to further modify the
PANTS_UNSTABLE_VERSION
, to add a timestamp before the SHA. This would allowls
to ensure the most recently produced wheel would always be at the bottom of the output.The text was updated successfully, but these errors were encountered: