Skip to content

Commit 2cd71ab

Browse files
committed
Add a clang preset and use it in CI alongside gcc
Do a separate build with this preset in the CI job so that we make sure the project is always buildable with clang as well. While the clang build passes the test suite just fine, keep using only the gcc build for that, to save resources and time. Disable WERROR and sanitizers for now, as they cause configuration and runtime errors, respectively, which is tracked via 4105 and 4112. We can reenable these options (drop them from cacheVariables) once those tickets are resolved. Fixes: 4104
1 parent c2782dd commit 2cd71ab

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

.github/workflows/linux.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,22 @@ jobs:
1818

1919
steps:
2020
- uses: actions/checkout@v3
21+
22+
- name: Build the Fedora testing environment (clang)
23+
run: ./mktree.oci build --preset dev-clang
24+
working-directory: ./tests
25+
2126
- name: Build the Fedora testing environment (gcc)
27+
# This replaces the previous clang based image
2228
run: ./mktree.oci build --preset dev-gcc
2329
working-directory: ./tests
30+
2431
- name: Fix kernel mmap rnd bits
2532
# High entropy setting in GH runner images >= 20240310.1.0
2633
# causes ASAN blowing up here and there:
2734
# https://github.com/actions/runner-images/issues/9491
2835
run: sudo sysctl vm.mmap_rnd_bits=28
36+
2937
- name: Run the test suite
3038
run: ./mktree.oci check --interactive=false -j$(nproc)
3139
working-directory: ./tests

CMakePresets.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@
2727
"CMAKE_C_COMPILER": "gcc",
2828
"CMAKE_CXX_COMPILER": "g++"
2929
}
30+
},
31+
{
32+
"name": "dev-clang",
33+
"inherits": "dev",
34+
"displayName": "Clang based development",
35+
"cacheVariables": {
36+
"CMAKE_C_COMPILER": "clang",
37+
"CMAKE_CXX_COMPILER": "clang++",
38+
"ENABLE_WERROR": "OFF",
39+
"ENABLE_ASAN": "OFF",
40+
"ENABLE_UBSAN": "OFF"
41+
}
3042
}
3143
]
3244
}

tests/Dockerfile.fedora

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ RUN dnf -y install \
5858
sequoia-sq \
5959
libasan \
6060
libubsan \
61-
nss-altfiles
61+
nss-altfiles \
62+
clang \
63+
compiler-rt \
64+
libomp-devel
6265
# If updates to specific packages are needed, do it here
6366
# RUN dnf -y --enablerepo=updates install ...
6467

0 commit comments

Comments
 (0)