Skip to content

Commit fd9bd10

Browse files
committed
CI: Update Ubuntu runners to 24.04, but keep 22.04 for Linux builds
Pin clang-format to version 16, and black to 24.10.0. Keep using Ubuntu 22.04 for Linux builds for portability.
1 parent 960898c commit fd9bd10

20 files changed

+65
-45
lines changed

.github/workflows/android_builds.yml

+1-8
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,12 @@ concurrency:
1414

1515
jobs:
1616
android-template:
17-
runs-on: "ubuntu-20.04"
17+
runs-on: "ubuntu-24.04"
1818
name: Template (target=release, tools=no)
1919

2020
steps:
2121
- uses: actions/checkout@v4
2222

23-
# Azure repositories are not reliable, we need to prevent azure giving us packages.
24-
- name: Make apt sources.list use the default Ubuntu repositories
25-
run: |
26-
sudo rm -f /etc/apt/sources.list.d/*
27-
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
28-
sudo apt-get update
29-
3023
- name: Set up Java 17
3124
uses: actions/setup-java@v4
3225
with:

.github/workflows/javascript_builds.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ concurrency:
1616

1717
jobs:
1818
javascript-template:
19-
runs-on: "ubuntu-22.04"
19+
runs-on: "ubuntu-24.04"
2020
name: Template (target=release, tools=no)
2121

2222
steps:

.github/workflows/linux_builds.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ concurrency:
1414

1515
jobs:
1616
build-linux:
17-
runs-on: "ubuntu-20.04"
17+
# Stay one LTS before latest to increase portability of Linux artifacts.
18+
runs-on: "ubuntu-22.04"
1819
name: ${{ matrix.name }}
1920
strategy:
2021
fail-fast: false
@@ -62,14 +63,13 @@ jobs:
6263
- name: Linux dependencies
6364
shell: bash
6465
run: |
65-
# Azure repositories are not reliable, we need to prevent azure giving us packages.
66-
sudo rm -f /etc/apt/sources.list.d/*
67-
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
66+
# Azure repositories are flaky, remove them.
67+
sudo rm -f /etc/apt/sources.list.d/{azure,microsoft}*
6868
sudo apt-get update
69-
# The actual dependencies
70-
sudo apt-get install build-essential pkg-config libx11-dev libxcursor-dev \
71-
libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev \
72-
libdbus-1-dev libudev-dev libxi-dev libxrandr-dev yasm xvfb wget unzip \
69+
# The actual dependencies.
70+
sudo apt-get install --no-install-recommends build-essential pkg-config libx11-dev \
71+
libxcursor-dev libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev \
72+
libpulse-dev libdbus-1-dev libudev-dev libxi-dev libxrandr-dev yasm xvfb wget unzip \
7373
libspeechd-dev speech-dispatcher
7474
7575
- name: Free disk space on runner

.github/workflows/server_builds.yml

+9-8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ concurrency:
1414

1515
jobs:
1616
build-server:
17-
runs-on: "ubuntu-20.04"
17+
# Stay one LTS before latest to increase portability of Linux artifacts.
18+
runs-on: "ubuntu-22.04"
1819
name: ${{ matrix.name }}
1920
strategy:
2021
fail-fast: false
@@ -36,14 +37,14 @@ jobs:
3637
- name: Linux dependencies
3738
shell: bash
3839
run: |
39-
# Azure repositories are not reliable, we need to prevent azure giving us packages.
40-
sudo rm -f /etc/apt/sources.list.d/*
41-
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
40+
# Azure repositories are flaky, remove them.
41+
sudo rm -f /etc/apt/sources.list.d/{azure,microsoft}*
4242
sudo apt-get update
43-
# The actual dependencies
44-
sudo apt-get install build-essential pkg-config libx11-dev libxcursor-dev \
45-
libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev \
46-
libdbus-1-dev libudev-dev libxi-dev libxrandr-dev yasm xvfb wget unzip
43+
# The actual dependencies.
44+
sudo apt-get install --no-install-recommends build-essential pkg-config libx11-dev \
45+
libxcursor-dev libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev \
46+
libpulse-dev libdbus-1-dev libudev-dev libxi-dev libxrandr-dev yasm xvfb wget unzip \
47+
libspeechd-dev speech-dispatcher
4748
4849
- name: Restore Godot build cache
4950
uses: ./.github/actions/godot-cache-restore

.github/workflows/static_checks.yml

+7-13
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,20 @@ concurrency:
99
jobs:
1010
static-checks:
1111
name: Static Checks (clang-format, black format, file format, documentation checks)
12-
runs-on: ubuntu-20.04
12+
runs-on: "ubuntu-24.04"
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v4
1616

17-
# Azure repositories are not reliable, we need to prevent Azure giving us packages.
18-
- name: Make apt sources.list use the default Ubuntu repositories
19-
run: |
20-
sudo rm -f /etc/apt/sources.list.d/*
21-
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
22-
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
23-
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main"
24-
sudo apt-get update
25-
2617
- name: Install dependencies
2718
run: |
28-
sudo apt-get install -qq dos2unix clang-format-15 libxml2-utils python3-pip moreutils
19+
# Azure repositories are flaky, remove them.
20+
sudo rm -f /etc/apt/sources.list.d/{azure,microsoft}*
21+
sudo apt-get update
22+
sudo apt-get install -qq dos2unix libxml2-utils python3-pip moreutils
2923
sudo update-alternatives --remove-all clang-format || true
30-
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-15 100
31-
sudo pip3 install black==22.3.0 pygments
24+
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-16 100
25+
sudo pip3 install black==24.10.0 pygments
3226
3327
# This needs to happen before Python and npm execution; it must happen before any extra files are written.
3428
- name: .gitignore checks (gitignore_check.sh)

core/io/http_client.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -713,15 +713,16 @@ PoolByteArray HTTPClient::read_response_body_chunk() {
713713
chunk_left -= rec;
714714

715715
if (chunk_left == 0) {
716-
if (chunk[chunk.size() - 2] != '\r' || chunk[chunk.size() - 1] != '\n') {
716+
const int chunk_size = chunk.size();
717+
if (chunk[chunk_size - 2] != '\r' || chunk[chunk_size - 1] != '\n') {
717718
ERR_PRINT("HTTP Invalid chunk terminator (not \\r\\n)");
718719
status = STATUS_CONNECTION_ERROR;
719720
break;
720721
}
721722

722-
ret.resize(chunk.size() - 2);
723+
ret.resize(chunk_size - 2);
723724
PoolByteArray::Write w = ret.write();
724-
memcpy(w.ptr(), chunk.ptr(), chunk.size() - 2);
725+
memcpy(w.ptr(), chunk.ptr(), chunk_size - 2);
725726
chunk.clear();
726727
}
727728

core/io/packet_peer_udp.cpp

+19-1
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,21 @@ Error PacketPeerUDP::get_packet(const uint8_t **r_buffer, int &r_buffer_size) {
105105
return ERR_UNAVAILABLE;
106106
}
107107

108+
/* Bogus GCC warning here:
109+
* In member function 'int RingBuffer<T>::read(T*, int, bool) [with T = unsigned char]',
110+
* inlined from 'virtual Error PacketPeerUDP::get_packet(const uint8_t**, int&)' at core/io/packet_peer_udp.cpp:112:9,
111+
* inlined from 'virtual Error PacketPeerUDP::get_packet(const uint8_t**, int&)' at core/io/packet_peer_udp.cpp:99:7:
112+
* Error: ./core/ring_buffer.h:68:46: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
113+
* 68 | p_buf[dst++] = read[pos + i];
114+
* | ~~~~~~~~~~~~~^~~~~~~
115+
*/
116+
#if defined(__GNUC__) && !defined(__clang__)
117+
#pragma GCC diagnostic push
118+
#pragma GCC diagnostic warning "-Wstringop-overflow=0"
119+
#endif
120+
108121
uint32_t size = 0;
109-
uint8_t ipv6[16];
122+
uint8_t ipv6[16] = {};
110123
rb.read(ipv6, 16, true);
111124
packet_ip.set_ipv6(ipv6);
112125
rb.read((uint8_t *)&packet_port, 4, true);
@@ -115,6 +128,11 @@ Error PacketPeerUDP::get_packet(const uint8_t **r_buffer, int &r_buffer_size) {
115128
--queue_count;
116129
*r_buffer = packet_buffer;
117130
r_buffer_size = size;
131+
132+
#if defined(__GNUC__) && !defined(__clang__)
133+
#pragma GCC diagnostic pop
134+
#endif
135+
118136
return OK;
119137
}
120138

core/io/stream_peer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,12 @@ void StreamPeer::put_var(const Variant &p_variant, bool p_full_objects) {
213213
}
214214

215215
uint8_t StreamPeer::get_u8() {
216-
uint8_t buf[1];
216+
uint8_t buf[1] = {};
217217
get_data(buf, 1);
218218
return buf[0];
219219
}
220220
int8_t StreamPeer::get_8() {
221-
uint8_t buf[1];
221+
uint8_t buf[1] = {};
222222
get_data(buf, 1);
223223
return buf[0];
224224
}

doc/translations/extract.py

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
sys.modules["_elementtree"] = None
6060
import xml.etree.ElementTree as ET
6161

62+
6263
## override the parser to get the line number
6364
class LineNumberingParser(ET.XMLParser):
6465
def _start(self, *args, **kwargs):

editor/editor_builders.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
All such functions are invoked in a subprocess on Windows to prevent build flakiness.
44
55
"""
6+
67
import os
78
import os.path
89
import shutil

editor/icons/editor_icons_builders.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
All such functions are invoked in a subprocess on Windows to prevent build flakiness.
44
55
"""
6+
67
import os
78
from platform_methods import subprocess_main
89
from compat import StringIO

gles_builders.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
All such functions are invoked in a subprocess on Windows to prevent build flakiness.
44
55
"""
6+
67
from platform_methods import subprocess_main
78
import re
89

main/main_builders.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
All such functions are invoked in a subprocess on Windows to prevent build flakiness.
44
55
"""
6+
67
from platform_methods import subprocess_main
78
from compat import byte_to_str
89
from collections import OrderedDict

modules/denoise/resource_to_cpp.py

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import os
2020
from array import array
2121

22+
2223
# Generates a C++ file from the specified binary resource file
2324
def generate(in_path, out_path):
2425

modules/gdnative/gdnative_builders.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
All such functions are invoked in a subprocess on Windows to prevent build flakiness.
44
55
"""
6+
67
import json
78
from platform_methods import subprocess_main
89

platform/osx/platform_osx_builders.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
All such functions are invoked in a subprocess on Windows to prevent build flakiness.
44
55
"""
6+
67
import os
78
from platform_methods import subprocess_main
89

platform/windows/platform_windows_builders.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
All such functions are invoked in a subprocess on Windows to prevent build flakiness.
44
55
"""
6+
67
import os
78
from platform_methods import subprocess_main
89

platform/x11/platform_x11_builders.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
All such functions are invoked in a subprocess on Windows to prevent build flakiness.
44
55
"""
6+
67
import os
78
from platform_methods import subprocess_main
89

scene/2d/tile_map.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,8 @@ void TileMap::_set_tile_data(const PoolVector<int> &p_data) {
12691269
for (int i = 0; i < c; i += offset) {
12701270
const uint8_t *ptr = (const uint8_t *)&r[i];
12711271
uint8_t local[12];
1272-
for (int j = 0; j < ((format == FORMAT_2) ? 12 : 8); j++) {
1272+
const int buffer_size = (format == FORMAT_2) ? 12 : 8;
1273+
for (int j = 0; j < buffer_size; j++) {
12731274
local[j] = ptr[j];
12741275
}
12751276

scu_builders.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Functions used to generate scu build source files during build time
22
33
"""
4+
45
import glob, os
56
import math
67
from pathlib import Path
@@ -159,6 +160,7 @@ def find_section_name(sub_folder):
159160
# which is slow like a normal build, but prevents the naming conflicts.
160161
# Ideally in these situations, the source code should be changed to prevent naming conflicts.
161162

163+
162164
# "extension" will usually be cpp, but can also be set to c (for e.g. third party libraries that use c)
163165
def process_folder(folders, sought_exceptions=[], includes_per_scu=0, extension="cpp"):
164166
if len(folders) == 0:

0 commit comments

Comments
 (0)