Skip to content

Commit ba6a20b

Browse files
committed
Add a clang preset and use it in CI alongside gcc
This preset configures the project for building with clang. Use it in the GH workflow to do a test build, to make sure we can also build with clang successfully. Keep using the gcc based image for testing, though, as that's the more common setup in rpm based distros, and running the test-suite twice would be wasteful. That said, the test-suite does indeed pass with this preset. Disable WERROR and ASAN/UBSAN for now, though, as those currently cause configuration and runtime errors, respectively, which is tracked via the tickets rpm-software-management#4105 and rpm-software-management#4112. We can reenable these options (drop them from cacheVariables) once those tickets are resolved. Fixes: 4104
1 parent 5a97113 commit ba6a20b

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)