Check candidate uploads against main index#1469
Merged
gbaz merged 1 commit intohaskell:masterfrom Mar 21, 2026
Merged
Conversation
Reuse logic of checkPublish to prevent uploading a candidate version if that version is already published or would be a case-variant of a published version.
Contributor
|
Thank you! |
DigitalBrains1
added a commit
to clash-lang/clash-compiler
that referenced
this pull request
Apr 12, 2026
Since haskell/hackage-server#1469 (Check candidate uploads against main index), Hackage no longer allows candidates for published versions. But we use the `.ci/publish_sdist.sh` script from our stable branches to publish a candidate before we do the final release, so we do want it to run for nightlies on our stable branch. But we need to differentiate between runs that do not contain a new version and runs that do contain a new version. So we do this check in the CI job, and exit with a special exit code to flag when we did not upload a candidate. This means normal nightlies will have an exclamation mark in an orange circle next to the `hackage-release-candidate`, indicating a failure that does not cause the pipeline as a whole to fail. When the "special" nightly before a release is run, the developer inspecting the result should verify a candidate was published (check mark in green circle). In the usual case, where only one candidate will be uploaded before release, they will also necessarily notice that the candidate is simply not on Hackage if they forget to check the CI job's result. Because we don't have control over the exit codes of any binaries we invoke, a trap handler is added in `.ci/functions.sh` that makes sure no other exits will have the exit code we reserve for allowed-to-fail. Currently, GitLab runners will not actually propagate the exit code of a failing step in the script, but this might very well change in an update. So we also proof our `.ci/setup.sh` script against such exits so they don't trigger unwantedly in the `hackage-release-candidate` job.
1 task
DigitalBrains1
added a commit
to clash-lang/clash-compiler
that referenced
this pull request
Apr 12, 2026
Since haskell/hackage-server#1469 (Check candidate uploads against main index), Hackage no longer allows candidates for published versions. But we use the `.ci/publish_sdist.sh` script from our stable branches to publish a candidate before we do the final release, so we do want it to run for nightlies on our stable branch. But we need to differentiate between runs that do not contain a new version and runs that do contain a new version. So we do this check in the CI job, and exit with a special exit code to flag when we did not upload a candidate. This means normal nightlies will have an exclamation mark in an orange circle next to the `hackage-release-candidate`, indicating a failure that does not cause the pipeline as a whole to fail. When the "special" nightly before a release is run, the developer inspecting the result should verify a candidate was published (check mark in green circle). In the usual case, where only one candidate will be uploaded before release, they will also necessarily notice that the candidate is simply not on Hackage if they forget to check the CI job's result. Because we don't have control over the exit codes of any binaries we invoke, a trap handler is added in `.ci/functions.sh` that makes sure no other exits will have the exit code we reserve for allowed-to-fail. Currently, GitLab runners will not actually propagate the exit code of a failing step in the script, but this might very well change in an update. So we also proof our `.ci/setup.sh` script against such exits so they don't trigger unwantedly in the `hackage-release-candidate` job.
DigitalBrains1
added a commit
to clash-lang/clash-compiler
that referenced
this pull request
Apr 12, 2026
Since haskell/hackage-server#1469 (Check candidate uploads against main index), Hackage no longer allows candidates for published versions. But we use the `.ci/publish_sdist.sh` script from our stable branches to publish a candidate before we do the final release, so we do want it to run for nightlies on our stable branch. But we need to differentiate between runs that do not contain a new version and runs that do contain a new version. So we do this check in the CI job, and exit with a special exit code to flag when we did not upload a candidate. This means normal nightlies will have an exclamation mark in an orange circle next to the `hackage-release-candidate`, indicating a failure that does not cause the pipeline as a whole to fail. When the "special" nightly before a release is run, the developer inspecting the result should verify a candidate was published (check mark in green circle). In the usual case, where only one candidate will be uploaded before release, they will also necessarily notice that the candidate is simply not on Hackage if they forget to check the CI job's result. Because we don't have control over the exit codes of any binaries we invoke, a trap handler is added in `.ci/functions.sh` that makes sure no other exits will have the exit code we reserve for allowed-to-fail. Currently, GitLab runners will not actually propagate the exit code of a failing step in the script, but this might very well change in an update. So we also proof our `.ci/setup.sh` script against such exits so they don't trigger unwantedly in the `hackage-release-candidate` job.
mergify bot
pushed a commit
to clash-lang/clash-compiler
that referenced
this pull request
Apr 12, 2026
Since haskell/hackage-server#1469 (Check candidate uploads against main index), Hackage no longer allows candidates for published versions. But we use the `.ci/publish_sdist.sh` script from our stable branches to publish a candidate before we do the final release, so we do want it to run for nightlies on our stable branch. But we need to differentiate between runs that do not contain a new version and runs that do contain a new version. So we do this check in the CI job, and exit with a special exit code to flag when we did not upload a candidate. This means normal nightlies will have an exclamation mark in an orange circle next to the `hackage-release-candidate`, indicating a failure that does not cause the pipeline as a whole to fail. When the "special" nightly before a release is run, the developer inspecting the result should verify a candidate was published (check mark in green circle). In the usual case, where only one candidate will be uploaded before release, they will also necessarily notice that the candidate is simply not on Hackage if they forget to check the CI job's result. Because we don't have control over the exit codes of any binaries we invoke, a trap handler is added in `.ci/functions.sh` that makes sure no other exits will have the exit code we reserve for allowed-to-fail. Currently, GitLab runners will not actually propagate the exit code of a failing step in the script, but this might very well change in an update. So we also proof our `.ci/setup.sh` script against such exits so they don't trigger unwantedly in the `hackage-release-candidate` job. (cherry picked from commit 7aef241)
1 task
DigitalBrains1
added a commit
to clash-lang/clash-compiler
that referenced
this pull request
Apr 12, 2026
Since haskell/hackage-server#1469 (Check candidate uploads against main index), Hackage no longer allows candidates for published versions. But we use the `.ci/publish_sdist.sh` script from our stable branches to publish a candidate before we do the final release, so we do want it to run for nightlies on our stable branch. But we need to differentiate between runs that do not contain a new version and runs that do contain a new version. So we do this check in the CI job, and exit with a special exit code to flag when we did not upload a candidate. This means normal nightlies will have an exclamation mark in an orange circle next to the `hackage-release-candidate`, indicating a failure that does not cause the pipeline as a whole to fail. When the "special" nightly before a release is run, the developer inspecting the result should verify a candidate was published (check mark in green circle). In the usual case, where only one candidate will be uploaded before release, they will also necessarily notice that the candidate is simply not on Hackage if they forget to check the CI job's result. Because we don't have control over the exit codes of any binaries we invoke, a trap handler is added in `.ci/functions.sh` that makes sure no other exits will have the exit code we reserve for allowed-to-fail. Currently, GitLab runners will not actually propagate the exit code of a failing step in the script, but this might very well change in an update. So we also proof our `.ci/setup.sh` script against such exits so they don't trigger unwantedly in the `hackage-release-candidate` job. (cherry picked from commit 7aef241) Co-authored-by: Peter Lebbing <peter@digitalbrains.com>
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
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.
Reuse logic of checkPublish to prevent uploading a candidate version if that version is already published or would be a case-variant of a published version.
Fixes #907
Fixes #768
Fixes #920
These issues talk about this matter as well but they also include other things so I'm not sure if they can be closed by this:
#558
#69