Skip to content

Conversation

@cameel
Copy link
Collaborator

@cameel cameel commented Oct 10, 2025

Depends on #16245. Merged.
Depends on #16252. Merged.
Related to #16244.

Currently our scripts do not handle tagged prereleases correctly. They assume that a tag always represents a release, at most filtering out ones not starting with v (but not consistently). This PR adds a distinction between:

  • releases: tags consisting of v followed by version number only
  • tagged prereleases: tags consisting of v followed by version number and -pre. suffix.
  • other prereleases, such as nightlies, CI builds, random builds from develop.

I also took the opportunity to remove some inconsistencies and outdated elements I spotted:

  • conf.py in the docs was wrongly assuming that missing prerelease.txt means a release.
  • Special-casing of release branch, which we no longer have.
  • Unnecessary creation of commit_hash.txt in CI builds.
  • Prerelease source tarball always using nightly in its version, regardless of what is in prerelease.txt.

The PR is incomplete, we still need to:

  • Update build_win.ps1 to apply the same prerelease logic on Windows.
  • Adjust c_release_binaries job to run on tagged prereleases.
  • Test that it all works in practice, including:
    • solc-bin properly picking up prerelease binaries as such (by filling out prerelease field in list.json).
    • FORCE_RELEASE being passed all the way down to prerelease_suffix.sh.
    • Scripts which we do not run in CI, e.g. source tarball creation.

@cameel cameel added build system 🏗️ has dependencies The PR depends on other PRs that must be merged first labels Oct 10, 2025
@cameel cameel changed the title Proper handling of tagged prereleases Correct handling of tagged prereleases Oct 10, 2025
@cameel cameel force-pushed the prerelease-logic-update branch from b3a2170 to 4c773aa Compare October 10, 2025 20:22
@cameel
Copy link
Collaborator Author

cameel commented Oct 10, 2025

Note that there are several bits of prerelease logic that I did not bother to update here:

  • docker_deploy_manual.sh and release_ppa.sh both check for a release.
  • rebuild_current.sh (Scripts used to rebuild old compiler versions to wasm)
  • snap/snapcraft.yml (Snap package)
  • The CI bits and scripts that use scripts/get_version.sh will get a version without the suffix even on a prerelease tag, but as far as I can tell, that should not cause problems (would be good for someone to double check just in case).

else
date -u +"nightly.%Y.%-m.%-d" > prerelease.txt;
fi
echo -n "$CIRCLE_SHA1" > commit_hash.txt
Copy link
Collaborator Author

@cameel cameel Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure if there was a reason we were creating commit_hash.txt here, but it seems completely unnecessary now. It appeared a long time ago in #3470, with no explanation, even though the logic for getting it from git already existed in buildinfo.cmake at that time. Then it spread to other places when this logic was copied.

@cameel cameel force-pushed the prerelease-logic-update branch from b4032bd to f6d6167 Compare October 10, 2025 21:00
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that tagged prereleases will skip most of the CI in solc-bin, because compare_bytecode_reports.sh filters out anything that's not a release. I think it's fine, because they are supposed to have passed CI checks in the solidity repo and messing this up is not as big of a deal as with a full release. Still, one thing that would be useful to keep is the sanity check that the filename matches the output of solc --version. This check now sits in validate_reported_version() in bytecode_reports_for_modified_binaries.sh. We should extract it into a separate PR check that runs on all binaries.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds to me like it's almost easier to adapt the regex to allow for prereleases as well:)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, that's an option too.

@cameel cameel force-pushed the prerelease-logic-update branch from f6d6167 to 686b5a6 Compare October 11, 2025 00:02
Base automatically changed from prerelease-logic-cleanup to develop October 14, 2025 08:29
@nikola-matic nikola-matic removed the has dependencies The PR depends on other PRs that must be merged first label Oct 14, 2025
@cameel cameel force-pushed the prerelease-logic-update branch from 686b5a6 to 9d6a6c7 Compare October 15, 2025 16:43
@cameel cameel added the has dependencies The PR depends on other PRs that must be merged first label Oct 15, 2025
@cameel cameel changed the base branch from develop to rewrite-powershell-ci-build-script-in-bash October 15, 2025 16:45
@cameel
Copy link
Collaborator Author

cameel commented Oct 15, 2025

build_win.ps1 has been addressed by converting it to a Bash script (#16252).

c_release_binaries job actually does not need adjustment. Upon a closer look, the regex preserves the prerelease suffix. I tested it for nightlies and I think it will work for -pre releases the same way.

@cameel cameel force-pushed the prerelease-logic-update branch from 9d6a6c7 to 3776ee7 Compare October 15, 2025 17:03
@cameel cameel mentioned this pull request Oct 15, 2025
@cameel cameel force-pushed the prerelease-logic-update branch 3 times, most recently from 875a154 to dc7b1e8 Compare October 15, 2025 17:56
@cameel cameel force-pushed the rewrite-powershell-ci-build-script-in-bash branch from bcb67b0 to 9327b28 Compare October 15, 2025 18:33
@cameel cameel force-pushed the prerelease-logic-update branch from dc7b1e8 to d1a3af6 Compare October 15, 2025 18:34
@cameel cameel force-pushed the rewrite-powershell-ci-build-script-in-bash branch from 9327b28 to e4421c0 Compare October 16, 2025 09:01
@cameel cameel force-pushed the prerelease-logic-update branch from d1a3af6 to 7275366 Compare October 16, 2025 09:06
@cameel cameel marked this pull request as ready for review October 16, 2025 09:27
Base automatically changed from rewrite-powershell-ci-build-script-in-bash to develop October 16, 2025 09:49
@cameel cameel force-pushed the prerelease-logic-update branch from 7275366 to 1a73646 Compare October 16, 2025 09:50
@cameel cameel force-pushed the prerelease-logic-update branch from 1a73646 to fda735a Compare October 16, 2025 10:25
@cameel cameel removed the has dependencies The PR depends on other PRs that must be merged first label Oct 16, 2025
@cameel cameel force-pushed the prerelease-logic-update branch from fda735a to 8439e2a Compare October 16, 2025 10:55
version = re.search('PROJECT_VERSION "([^"]+)"', f.read()).group(1)
# The full version, including alpha/beta/rc tags.
if not os.path.isfile('../prerelease.txt') or os.path.getsize('../prerelease.txt') == 0:
if os.path.isfile('../prerelease.txt') and os.path.getsize('../prerelease.txt') == 0:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prerelease_file = '../prerelease.txt' would have been nice

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intentionally didn't want to introduce new variables here since I'm not sure if these don't become visible as settings.

@cameel cameel enabled auto-merge October 16, 2025 11:16
@cameel cameel merged commit b59566f into develop Oct 16, 2025
74 of 75 checks passed
@cameel cameel deleted the prerelease-logic-update branch October 16, 2025 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants