Skip to content

Commit 6591319

Browse files
authored
Update Github CI, docker setup and documentation to run on Ubuntu 24.04 with clang-20 and gcc-14 (#4940)
### 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](https://releases.llvm.org/20.1.0/tools/clang/docs/ClangFormatStyleOptions.html)
2 parents 004d029 + c409b3e commit 6591319

38 files changed

+264
-363
lines changed

.devcontainer/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
44
#-------------------------------------------------------------------------------------------------------------
5-
FROM ubuntu:focal
5+
FROM ubuntu:noble
66

77
# Avoid warnings by switching to noninteractive
88
ENV DEBIAN_FRONTEND=noninteractive
@@ -60,18 +60,18 @@ RUN apt-get update \
6060
RUN apt-get -y install git build-essential pkg-config autoconf automake libtool bison flex sed perl libpq-dev parallel libunwind-dev curl
6161

6262
# Update compiler tools
63-
RUN apt-get -y install libstdc++-10-dev clang-format-12 ccache
63+
RUN apt-get -y install libstdc++-14-dev clang-format-20 ccache
6464

6565
# gcc
66-
RUN apt-get -y install cpp-10 gcc-10 g++-10
66+
RUN apt-get -y install cpp-14 gcc-14 g++-14
6767
# clang
68-
RUN apt-get -y install clang-12 llvm-12
68+
RUN apt-get -y install clang-20 llvm-20
6969
# rust
7070
ENV PATH "/root/.cargo/bin:$PATH"
7171

7272
# clang by default
73-
ENV CC=clang-12
74-
ENV CXX=clang++-12
73+
ENV CC=clang-20
74+
ENV CXX=clang++-20
7575

7676
# Install postgresql to enable tests under make check
7777
RUN apt-get -y install postgresql

.devcontainer/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Ubuntu 20.04 Remote Dev Container Instructions
1+
# Ubuntu 24.04 Remote Dev Container Instructions
22

33
## Who's interested in this and why?
4-
* For those developers who'd like to validate their changes on Ubuntu 20.04, we provide a sandboxed development environment using the 'Remote Development Container' features of Microsoft's Visual Studio Code.
4+
* For those developers who'd like to validate their changes on Ubuntu 24.04, we provide a sandboxed development environment using the 'Remote Development Container' features of Microsoft's Visual Studio Code.
55
* This feature pre-configures a dev environment with all the tools you'll need to build stellar-core
66

77

.github/workflows/build.yml

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ jobs:
1919
complete:
2020
if: always()
2121
needs: [fmt, cargo-deny, rust-check-git-rev-deps, build]
22-
runs-on: ubuntu-22.04
22+
runs-on: ubuntu-24.04
2323
steps:
2424
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
2525
run: exit 1
2626

2727
fmt:
28-
runs-on: ubuntu-22.04
28+
runs-on: ubuntu-24.04
2929
steps:
3030
- uses: actions/checkout@v4
3131
- run: rustup component add rustfmt
3232
- run: rustup update
3333
- run: cargo fmt --all --check
3434

3535
cargo-deny:
36-
runs-on: ubuntu-22.04
36+
runs-on: ubuntu-24.04
3737
strategy:
3838
matrix:
3939
checks:
@@ -51,13 +51,13 @@ jobs:
5151
arguments:
5252

5353
rust-check-git-rev-deps:
54-
runs-on: ubuntu-22.04
54+
runs-on: ubuntu-24.04
5555
steps:
5656
- uses: actions/checkout@v4
5757
- uses: stellar/actions/rust-check-git-rev-deps@main
5858

5959
build:
60-
runs-on: ubuntu-jammy-16-cores-amd64
60+
runs-on: ubuntu-24.04
6161
env:
6262
CACHED_PATHS: |
6363
~/.ccache
@@ -68,6 +68,7 @@ jobs:
6868
matrix:
6969
toolchain: [ "gcc", "clang"]
7070
protocol: ["current", "next"]
71+
scenario: ["", "--check-test-tx-meta"]
7172
steps:
7273
- name: Fix kernel mmap rnd bits
7374
# Asan in llvm provided in ubuntu 22.04 is incompatible with
@@ -115,11 +116,11 @@ jobs:
115116
- name: install tool chain
116117
if: steps.cache.outputs.cache-hit != 'true'
117118
run: |
118-
sudo apt-get -y install libstdc++-10-dev clang-format-12 ccache lldb
119+
sudo apt-get -y install libstdc++-14-dev clang-format-20 ccache lldb
119120
if test "${{ matrix.toolchain }}" = "gcc" ; then
120-
sudo apt-get -y install cpp-10 gcc-10 g++-10
121+
sudo apt-get -y install cpp-14 gcc-14 g++-14
121122
else
122-
sudo apt-get -y install clang-12 llvm-12
123+
sudo apt-get -y install clang-20 llvm-20 libc++-20-dev libc++abi-20-dev
123124
fi
124125
- name: install rustup components
125126
if: steps.cache.outputs.cache-hit != 'true'
@@ -144,8 +145,7 @@ jobs:
144145
export CXX='clang++'
145146
fi
146147
echo Build with $CC and $CXX
147-
echo "Running first scenario"
148-
./ci-build.sh --use-temp-db --protocol ${{ matrix.protocol }}
148+
./ci-build.sh --use-temp-db --protocol ${{ matrix.protocol }} ${{ matrix.scenario }}
149149
150150
# We only _save_ to the cache when we had a cache miss and are running on master.
151151
- name: Save cache after first build
@@ -155,15 +155,3 @@ jobs:
155155
path: ${{ env.CACHED_PATHS }}
156156
key: ${{ steps.cache.outputs.cache-primary-key }}
157157

158-
- name: Build for check-test-tx-meta scenario
159-
if: steps.cache.outputs.cache-hit != 'true'
160-
run: |
161-
if test "${{ matrix.toolchain }}" = "gcc" ; then
162-
export CC='gcc'
163-
export CXX='g++'
164-
else
165-
export CC='clang'
166-
export CXX='clang++'
167-
fi
168-
echo "Running second scenario with --check-test-tx-meta flag"
169-
./ci-build.sh --use-temp-db --protocol ${{ matrix.protocol }} --check-test-tx-meta

.github/workflows/clang-19-static-analysis.yml

Lines changed: 0 additions & 107 deletions
This file was deleted.

0 commit comments

Comments
 (0)