Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test on Ubuntu 24.04 GitHub Images #4306

Merged
merged 24 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build-reuse-unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ on:
# options:
# - ubuntu-20.04
# - ubuntu-22.04
# - ubuntu-24.04
# - macos-12
arch:
required: false
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
matrix:
config: ['Debug', 'Release']
plat: [linux]
os: ['ubuntu-20.04', 'ubuntu-22.04']
os: ['ubuntu-20.04', 'ubuntu-22.04', 'ubuntu-24.04']
arch: [arm, arm64]
tls: [openssl, openssl3]
static: ['', '-Static']
Expand All @@ -102,7 +102,7 @@ jobs:
matrix:
config: ['Debug', 'Release']
plat: [linux, android]
os: ['ubuntu-20.04', 'ubuntu-22.04']
os: ['ubuntu-20.04', 'ubuntu-22.04', 'ubuntu-24.04']
arch: [x86, x64]
tls: [openssl, openssl3]
systemcrypto: ['', '-UseSystemOpenSSLCrypto']
Expand All @@ -127,6 +127,11 @@ jobs:
os: 'ubuntu-22.04'
tls: 'openssl'
systemcrypto: '-UseSystemOpenSSLCrypto'
# No openssl system crypto on ubuntu-24.04
- plat: linux
os: 'ubuntu-24.04'
tls: 'openssl'
systemcrypto: '-UseSystemOpenSSLCrypto'
# linux xdp is for ubuntu22.04 only for now
- plat: android
xdp: "-UseXdp"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dotnet-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
vec: [
{ plat: "linux", os: "ubuntu-20.04", arch: "x64", tls: "openssl" },
{ plat: "linux", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", xdp: "-UseXdp" },
{ plat: "linux", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", xdp: "-UseXdp" },
]
uses: ./.github/workflows/build-reuse-unix.yml
with:
Expand Down Expand Up @@ -74,6 +75,7 @@ jobs:
{ plat: "windows", os: "windows-2022", arch: "x64", tls: "openssl3" },
{ plat: "linux", os: "ubuntu-20.04", arch: "x64", tls: "openssl" },
{ plat: "linux", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", xdp: "-UseXdp" },
{ plat: "linux", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", xdp: "-UseXdp" },
{ plat: "macos", os: "macos-12", arch: "universal", tls: "openssl" },
]
runs-on: ${{ matrix.vec.os }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/package-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
{ config: "Release", os: "ubuntu-22.04", arch: "arm", tls: "openssl3" },
{ config: "Release", os: "ubuntu-22.04", arch: "arm64", tls: "openssl3" },
{ config: "Release", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", xdp: "-UseXdp" },
{ config: "Release", os: "ubuntu-24.04", arch: "arm", tls: "openssl3" },
{ config: "Release", os: "ubuntu-24.04", arch: "arm64", tls: "openssl3" },
{ config: "Release", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", xdp: "-UseXdp" },
]
uses: ./.github/workflows/package-reuse-linux.yml
with:
Expand All @@ -52,6 +55,7 @@ jobs:
vec: [
{ config: "Release", os: "ubuntu-20.04", arch: "x64", tls: "openssl" },
{ config: "Release", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", xdp: "-UseXdp" },
{ config: "Release", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", xdp: "-UseXdp" },
]
steps:
- name: Checkout repository
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/stress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ jobs:
{ config: "Debug", plat: "linux", os: "ubuntu-20.04", arch: "x64", tls: "openssl3", sanitize: "-Sanitize", build: "-Test" },
{ config: "Debug", plat: "linux", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", build: "-Test" },
{ config: "Debug", plat: "linux", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", build: "-Test", xdp: "-UseXdp" },
{ config: "Debug", plat: "linux", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", build: "-Test" },
{ config: "Debug", plat: "linux", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", build: "-Test", xdp: "-UseXdp" },
]
uses: ./.github/workflows/build-reuse-unix.yml
with:
Expand All @@ -75,7 +77,11 @@ jobs:
vec: [
{ config: "Debug", plat: "linux", os: "ubuntu-20.04", arch: "x64", tls: "openssl", sanitize: "-Sanitize", build: "-Test" },
{ config: "Debug", plat: "linux", os: "ubuntu-20.04", arch: "x64", tls: "openssl3", sanitize: "-Sanitize", build: "-Test" },
{ config: "Debug", plat: "linux", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", xdp: "-UseXdp", build: "-Test" },
{ config: "Debug", plat: "linux", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", sanitize: "-Sanitize", build: "-Test" },
# TODO: I don't think this actually testing XDP, since there is no unix XDP builds above.
# { config: "Debug", plat: "linux", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", xdp: "-UseXdp", build: "-Test" },
{ config: "Debug", plat: "linux", os: "ubuntu-24.04", arch: "x64", sanitize: "-Sanitize", build: "-Test" },
{ config: "Debug", plat: "linux", os: "ubuntu-24.04", arch: "x64", sanitize: "-Sanitize", build: "-Test", xdp: "-UseXdp" },
{ config: "Debug", plat: "macos", os: "macos-12", arch: "x64", tls: "openssl", build: "-Test" },
{ config: "Debug", plat: "macos", os: "macos-12", arch: "x64", tls: "openssl3", build: "-Test" },
{ config: "Debug", plat: "windows", os: "windows-2022", arch: "x64", tls: "schannel", sanitize: "-Sanitize", build: "-Test" },
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ jobs:
{ config: "Debug", plat: "linux", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", sanitize: "-Sanitize", build: "-Test" },
{ config: "Debug", plat: "linux", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", build: "-Test", xdp: "-UseXdp" },
{ config: "Debug", plat: "linux", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", systemcrypto: "-UseSystemOpenSSLCrypto", sanitize: "-Sanitize", build: "-Test" },
{ config: "Debug", plat: "linux", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", systemcrypto: "-UseSystemOpenSSLCrypto", sanitize: "-Sanitize", build: "-Test" },
{ config: "Debug", plat: "linux", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", systemcrypto: "-UseSystemOpenSSLCrypto", sanitize: "-Sanitize", build: "-Test", xdp: "-UseXdp" },
]
uses: ./.github/workflows/build-reuse-unix.yml
with:
Expand Down Expand Up @@ -100,6 +102,8 @@ jobs:
{ config: "Debug", plat: "linux", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", sanitize: "-Sanitize", build: "-Test" },
{ config: "Debug", plat: "linux", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", xdp: "-UseXdp", build: "-Test" },
{ config: "Debug", plat: "linux", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", systemcrypto: "-UseSystemOpenSSLCrypto", sanitize: "-Sanitize", build: "-Test" },
{ config: "Debug", plat: "linux", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", systemcrypto: "-UseSystemOpenSSLCrypto", sanitize: "-Sanitize", build: "-Test" },
{ config: "Debug", plat: "linux", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", systemcrypto: "-UseSystemOpenSSLCrypto", sanitize: "-Sanitize", build: "-Test", xdp: "-UseXdp" },
{ config: "Debug", plat: "windows", os: "windows-2019", arch: "x64", tls: "openssl", build: "-Test" },
{ config: "Debug", plat: "windows", os: "windows-2019", arch: "x64", tls: "openssl3", build: "-Test" },
{ config: "Debug", plat: "windows", os: "windows-2022", arch: "x64", tls: "schannel", sanitize: "-Sanitize", build: "-Test" },
Expand Down
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -687,38 +687,48 @@ if(QUIC_CODE_CHECK)
-android-cloexec-fopen
-android-cloexec-socket
-bugprone-assignment-in-if-condition
-bugprone-casting-through-void
-bugprone-easily-swappable-parameters
-bugprone-implicit-widening-of-multiplication-result
-bugprone-macro-parentheses
-bugprone-multi-level-implicit-pointer-conversion
-bugprone-narrowing-conversions
-bugprone-reserved-identifier
-bugprone-sizeof-expression
-bugprone-switch-missing-default-case
-cert-dcl37-c
-cert-dcl51-cpp
-cert-err33-c
-clang-analyzer-optin.core.EnumCastOutOfRange
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling
-clang-diagnostic-invalid-unevaluated-string
-clang-diagnostic-microsoft-anon-tag
-concurrency-mt-unsafe
-cppcoreguidelines-avoid-magic-numbers
-cppcoreguidelines-avoid-non-const-global-variables
-cppcoreguidelines-init-variables
-cppcoreguidelines-macro-to-enum
-cppcoreguidelines-narrowing-conversions
-google-readability-casting
-google-readability-function-size
-google-readability-todo
-hicpp-function-size
-hicpp-no-assembler
-hicpp-signed-bitwise
-llvmlibc-restrict-system-libc-headers
-misc-include-cleaner
-misc-no-recursion # do you really need recursion?
-modernize-macro-to-enum
-readability-avoid-const-params-in-decls
-readability-avoid-nested-conditional-operator
-readability-duplicate-include
-readability-function-cognitive-complexity
-readability-function-size
-readability-identifier-length
-readability-isolate-declaration
-readability-magic-numbers
-readability-non-const-parameter
-readability-redundant-casting
)
string(REPLACE ";" "," CLANG_TIDY_CHECKS "${CLANG_TIDY_CHECKS}")
set(CMAKE_C_CLANG_TIDY_AVAILABLE ${CLANGTIDY} -checks=${CLANG_TIDY_CHECKS}
Expand Down
2 changes: 1 addition & 1 deletion docs/BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ $ pwsh ./scripts/build.ps1 -UseXdp

`./scripts/prepare-machine.ps1` internally does the below commands. This might break your environment.
```sh
# for libxdp v1.4.2
# for libxdp v1.4.2 on Ubuntu 22.04. Ubuntu 24.04 doesn't need this step
sudo apt-add-repository "deb http://mirrors.kernel.org/ubuntu noble main" -y

# install runtime dependencies
Expand Down
17 changes: 11 additions & 6 deletions scripts/prepare-machine.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,10 @@ Set-StrictMode -Version 'Latest'
$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'
$ProgressPreference = 'SilentlyContinue'

if ($IsLinux -and $UseXdp) {
$IsUbuntu2404 = $false
if ($IsLinux) {
$IsUbuntu2404 = (Get-Content -Path /etc/os-release | Select-String -Pattern "24.04") -ne $null
if (!$IsUbuntu2404 -and !$ForceXdpInstall) {
if ($UseXdp -and !$IsUbuntu2404 -and !$ForceXdpInstall) {
Write-Host "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARN !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
Write-Host "Linux XDP installs dependencies from Ubuntu 24.04 packages, which should affect your environment"
Write-Host "You need to understand the impact of this on your environment before proceeding"
Expand Down Expand Up @@ -530,8 +531,10 @@ if ($IsLinux) {
# XDP dependencies
if ($UseXdp) {
sudo apt-get -y install --no-install-recommends libc6-dev-i386 # for building xdp programs
sudo apt-add-repository "deb http://mirrors.kernel.org/ubuntu noble main" -y
sudo apt-get update -y
if (!$IsUbuntu2404) {
sudo apt-add-repository "deb http://mirrors.kernel.org/ubuntu noble main" -y
sudo apt-get update -y
}
sudo apt-get -y install libxdp-dev libbpf-dev
sudo apt-get -y install libnl-3-dev libnl-genl-3-dev libnl-route-3-dev zlib1g-dev zlib1g pkg-config m4 clang libpcap-dev libelf-dev
}
Expand All @@ -544,8 +547,10 @@ if ($IsLinux) {
sudo apt-get install -y liblttng-ust-dev
sudo apt-get install -y gdb
if ($UseXdp) {
sudo apt-add-repository "deb http://mirrors.kernel.org/ubuntu noble main" -y
sudo apt-get update -y
if (!$IsUbuntu2404) {
sudo apt-add-repository "deb http://mirrors.kernel.org/ubuntu noble main" -y
sudo apt-get update -y
}
sudo apt-get install -y libxdp1 libbpf1
sudo apt-get install -y libnl-3-200 libnl-route-3-200 libnl-genl-3-200
sudo apt-get install -y iproute2 iptables
Expand Down
6 changes: 3 additions & 3 deletions src/generated/stdout/quic_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#include <quic_trace.h>


void EncodeHexBuffer(_In_reads_(BufferLen) uint8_t * Buffer,
Copy link
Member Author

Choose a reason for hiding this comment

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

I rather ignore this error than make this change. This code was specifically designed for small buffers where size fit in uint8_t.

_In_ uint8_t BufferLen,
_Out_writes_bytes_(2 * BufferLen) char * HexString);
void EncodeHexBuffer(_In_reads_(BufferLen) const uint8_t* Buffer,
_In_ size_t BufferLen,
_Out_writes_bytes_(2 * BufferLen) char* HexString);


char * casted_clog_bytearray(const uint8_t * const data,
Expand Down
8 changes: 4 additions & 4 deletions src/inc/msquichelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,13 @@ DecodeHexBuffer(
inline
void
EncodeHexBuffer(
_In_reads_(BufferLen) uint8_t* Buffer,
_In_ uint8_t BufferLen,
_Out_writes_bytes_(2*BufferLen) char* HexString
_In_reads_(BufferLen) const uint8_t* Buffer,
_In_ size_t BufferLen,
_Out_writes_bytes_(2 * BufferLen) char* HexString
)
{
#define HEX_TO_CHAR(x) ((x) > 9 ? ('a' + ((x) - 10)) : '0' + (x))
for (uint8_t i = 0; i < BufferLen; i++) {
for (size_t i = 0; i < BufferLen; i++) {
HexString[i*2] = HEX_TO_CHAR(Buffer[i] >> 4);
HexString[i*2 + 1] = HEX_TO_CHAR(Buffer[i] & 0xf);
}
Expand Down
Loading