Skip to content

Conversation

@anupsdf
Copy link
Contributor

@anupsdf anupsdf commented Sep 25, 2025

What:

Update Github CI, docker setup and documentation to run on Ubuntu 24.04 with clang-20 and gcc-14

Why:

Since stellar-core packages would be produced for Ubuntu 22.04 (jammy) and 24.04 (noble) with clang-20 moving forward, we would like to switch our Github CI to run on the new leading OS version of Ubuntu.

  • Update Github actions runner to build with clang-20
  • Update docker setup script and docs
  • Drop support for Ubuntu 20.04 focal
  • Update documentation
  • Switch to corresponding gcc/g++ v14. Noble comes with gcc/g++ version 14 while jammy comes with 12. We could get gcc/g++ 13 on Jammy with PPA dependency. Which version should we recommend in our documentation? Currently, I have set Github CI to run gcc/g++ v14 since we run on GHA runner on Ubuntu 24.04.
  • Run clang-format-20. Bunch of files have format changes due to this. Refer to clang-format20 style options

@anupsdf anupsdf force-pushed the clang-19-ci branch 2 times, most recently from 22bdd9a to c29f2ff Compare September 25, 2025 19:14
@anupsdf anupsdf marked this pull request as ready for review September 25, 2025 19:14
Copilot AI review requested due to automatic review settings September 25, 2025 19:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the GitHub CI workflow to use Ubuntu 24.04 with clang-19 instead of Ubuntu 22.04 with clang-12, aligning the CI environment with the package distribution targets for stellar-core.

Key changes:

  • Upgrades Ubuntu runner versions from 22.04 to 24.04
  • Updates clang toolchain from version 12 to version 19
  • Removes the dedicated clang-19 static analysis workflow

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/clang-19-static-analysis.yml Removes the entire dedicated clang-19 static analysis workflow file
.github/workflows/build.yml Updates Ubuntu versions, clang toolchain to version 19, and adds format check skip

@MonsieurNicolas
Copy link
Contributor

Not sure where the overall work to migrate to the right toolchain for Ubuntu 22.04 is tracked.
If this is the PR, you also need to update a few places, including https://github.com/stellar/stellar-core/blob/master/docker/Dockerfile.testing and https://github.com/stellar/stellar-core/tree/master/.devcontainer (grep for mentions of clang).

There is also the question of which version of gcc/g++ to reference in guides etc.

@anupsdf
Copy link
Contributor Author

anupsdf commented Sep 25, 2025

Not sure where the overall work to migrate to the right toolchain for Ubuntu 22.04 is tracked. If this is the PR, you also need to update a few places, including https://github.com/stellar/stellar-core/blob/master/docker/Dockerfile.testing and https://github.com/stellar/stellar-core/tree/master/.devcontainer (grep for mentions of clang).

There is also the question of which version of gcc/g++ to reference in guides etc.

I can use this PR to track the overall migration including the documentation. Will also include gcc/g++ updates here.

@anupsdf anupsdf marked this pull request as draft September 26, 2025 05:05
@anupsdf anupsdf changed the title Update Github CI to run on Ubuntu 24.04 with clang-19 Update Github CI, docker setup and documentation to run on Ubuntu 24.04 with clang-19 and gcc-12 Sep 26, 2025
@anupsdf anupsdf force-pushed the clang-19-ci branch 4 times, most recently from e60358b to 273dc36 Compare September 29, 2025 06:09
@anupsdf anupsdf changed the title Update Github CI, docker setup and documentation to run on Ubuntu 24.04 with clang-19 and gcc-12 Update Github CI, docker setup and documentation to run on Ubuntu 24.04 with clang-19 and gcc-14 Sep 29, 2025
@anupsdf anupsdf force-pushed the clang-19-ci branch 2 times, most recently from 9a26c48 to e1f3240 Compare October 5, 2025 17:14
@anupsdf anupsdf changed the title Update Github CI, docker setup and documentation to run on Ubuntu 24.04 with clang-19 and gcc-14 Update Github CI, docker setup and documentation to run on Ubuntu 24.04 with clang-20 and gcc-14 Nov 13, 2025
@anupsdf anupsdf force-pushed the clang-19-ci branch 2 times, most recently from 6d32580 to 2c50f58 Compare November 14, 2025 00:03
@anupsdf anupsdf marked this pull request as ready for review November 14, 2025 00:03
@anupsdf anupsdf enabled auto-merge November 14, 2025 00:23
@anupsdf anupsdf marked this pull request as draft November 14, 2025 19:35
@anupsdf anupsdf force-pushed the clang-19-ci branch 4 times, most recently from 12610f0 to 7f7f1f2 Compare November 18, 2025 22:04
@anupsdf anupsdf marked this pull request as ready for review November 19, 2025 00:30
@MonsieurNicolas
Copy link
Contributor

you may want to tweak the clang-format config to avoid spurious reformatting (usually it's because they add new config flags or change defaults).
You may be able to get a hint of what is going on by diffing the effective config with: clang-format -dump-config > .clang-format and tweak lines that changed and/or review what those configs do https://clang.llvm.org/docs/ClangFormatStyleOptions.html

@anupsdf
Copy link
Contributor Author

anupsdf commented Nov 20, 2025

you may want to tweak the clang-format config to avoid spurious reformatting (usually it's because they add new config flags or change defaults). You may be able to get a hint of what is going on by diffing the effective config with: clang-format -dump-config > .clang-format and tweak lines that changed and/or review what those configs do https://clang.llvm.org/docs/ClangFormatStyleOptions.html

Thanks for the tip! Here are the three categories of formatting changes I looked into but the conclusion is that we could tackle them in a followup PR to not clutter this one. Let me know what you think.

  1. I am having a hard time tracking down which setting adds a space between closing parenthesis and opening curly brackets. I will keep looking at different combination of settings.
    () {};

  2. In v12 we had AlwaysBreakAfterReturnType: AllDefinitions. In v20 they have replaced it with BreakAfterReturnType which has few options but they all modify a bunch of files and clutter this PR.
    I am inclining towards BreakAfterReturnType: ExceptShortType option which would break after return type based on PenaltyReturnTypeOnItsOwnLine with exception of short return types but we could discuss in a followup.

  3. Optionally, switching BraceWrapping:BeforeLambdaBody to true would break the { of lambda functions onto a new line. But its something we could discuss as a followup issue as well.

@anupsdf anupsdf marked this pull request as draft November 21, 2025 00:37
Copy link
Contributor

@graydon graydon left a comment

Choose a reason for hiding this comment

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

Nice! Handful of mostly doc nits. I don't really care what happens with the formatting.

Temporarily comment out restoring cached llvm-12 builds

Update Github CI to run on Ubuntu 24.04 with clang-20

i# temporarily switch to standard GHA runner since 16-core jammy runner does not have some packages

parent 691b19a983be2f3b561517714a9e01a854b4e19c
author anupsdf <[email protected]> 1763712854 -0800
committer anupsdf <[email protected]> 1763713191 -0800
gpgsig -----BEGIN PGP SIGNATURE-----

 iQIzBAABCAAdFiEEsVPy9QBRCNnRvXpUEUPOcP21IwMFAmkgIKcACgkQEUPOcP21
 IwPyaxAAu6VD+bcJrh3ecbfseNDO9JPaH62uoVKTJn7yOX/D/nIV1XnWflvJE/c8
 ulgn9nvGWVCg8qCLQ5whxuPubVJQwvhKHzBvj7tBMw2iPAV0BOkgsSB+m3wzYxXl
 0fiDhWtDw21ju+d3RMu+vrag8AXJLyfOpXLF3oRRO2uzB/XKpPL7UDdE63/d7sW1
 qgsY3HIhPQ9DLkEOxYw0lVZPAl+WHNFm2BU+Af7XFI29y/e/L1HYTQ6700FUJVUp
 AFzqWmk6zZwHOeWk3ZpRmm20beLvHfx2nJGYFe0HnfJTay1VWKW8tH3mHxpzY/lu
 wblB0B+SIrpOLxHJcQrxRCdQ9xyujcCcq4Pv6Y8/X8Xzn86IH9BHOd/V6CEdwrWq
 JxWNuyB4XWIbDvCwKExFdxmB4Fe0XBQX5Nwnbu3/II78h5jt1f9M1dQ9Y9N58xIV
 2Ha9dRPYA4dKvblyrIVM7mstlASWx+XzvC80aGx22EjlgxY0uP7/rStm1uqqrIT6
 23jY53jx9dySMxAKaQ1Y+Nr+zB1Ig2G5IprNGh4VW/S/mj5K/4aNi68VMLVq7p5Z
 hie3RGA+lT8kaCIkbcwvG9zwr5tzXjyf/g1YgG41FOR0R0wqXuLgzNlAtT6r01zq
 DA9kC93QgekmntExsK4AAviJHWW2xrodzkj1zEXufoz+j/0y/7c=
 =DES8
 -----END PGP SIGNATURE-----

Co-authored-by: Graydon Hoare <[email protected]>

Update INSTALL.md

Co-authored-by: Graydon Hoare <[email protected]>

restore from cache
@anupsdf anupsdf marked this pull request as ready for review November 21, 2025 19:19
graydon
graydon previously approved these changes Nov 21, 2025
@graydon graydon added this pull request to the merge queue Nov 21, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Nov 21, 2025
@graydon graydon added this pull request to the merge queue Nov 22, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Nov 22, 2025
@anupsdf anupsdf added this pull request to the merge queue Nov 22, 2025
Merged via the queue into stellar:master with commit 6591319 Nov 22, 2025
15 checks passed
@anupsdf anupsdf deleted the clang-19-ci branch November 22, 2025 10:15
docker-build:
ifndef STELLAR_CORE_VERSION
$(error STELLAR_CORE_VERSION environment variable must be set. For example STELLAR_CORE_VERSION=17.0.0-557.096f6a7.focal )
$(error STELLAR_CORE_VERSION environment variable must be set. For example STELLAR_CORE_VERSION=23.0.2-2724.7b9e6c863)
Copy link
Contributor

Choose a reason for hiding this comment

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

How will you deal with version strings such as 24.1.1-2874.5a7035d49.noble~notforprod ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think in a future clean up we should have RUN_TAG also passed in along with the DISTRO so we can append the them to the stellar-core-version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants