Skip to content

Commit

Permalink
github: use fedora:40 image for testing
Browse files Browse the repository at this point in the history
instead of using ubuntu:jammy and setup-cpp action for prepearing
the building toolchain, use fedora:40 container for building and
testing.

after switching to the github workflow based CI, we've been
seeing test failures due to networking issue:

```
  Failed to install llvm via system package manager Error: Command failed with exit code 35: curl -LJO https://apt.llvm.org/llvm.sh
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed

    0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
    0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
    0     0    0     0    0     0      0      0 --:--:--  0:04:19 --:--:--     0
  curl: (35) OpenSSL SSL_connect: Broken pipe in connection to apt.llvm.org:443
```

since fedora 40 comes with all the dependencies we need, let's
build and test in a container with the fedora:40 image. with,
hopefully the better CDN of the docker, and more reliable mirrors
of fedora repositories, and the package retrievial machinary built
into fedora's package management tools, we should have a more
resilient CI.

please note, in this change, we also

* install git before checkout the repo. the reason is that, unlike
  the github-hosted runner, the fedora:40 image does not have `git`
  installed, so we have to install it manually before using
  "actions/checkout" action.
* install clang-tools-extra when building with C++ modules enabled,
  because cmake and clang depend on clang-scan-deps to analyze the
  dependencies in betweener of C++20 modules.
* use static library in "dev" build mode. this is to work around
  the issue where seastar allocator causes infinite recursive call
  if seastar is compiled as a shared library. this only happens when
  the tree is compiled with newer glibc. see also scylladb#2247

Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed May 17, 2024
1 parent 0f56770 commit ff07df9
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 23 deletions.
55 changes: 36 additions & 19 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
workflow_call:
inputs:
compiler:
# only the compilers supported by setup-cpp can be used
description: 'the C++ compiler to use'
type: string
required: true
Expand All @@ -33,7 +32,12 @@ on:
jobs:
test:
runs-on: ubuntu-latest
container: fedora:40
steps:
- name: Install Git
run: |
sudo dnf -y install git
- uses: actions/checkout@v4
with:
submodules: "${{ contains(inputs.enables, 'dpdk') }}"
Expand All @@ -42,31 +46,44 @@ jobs:
run: |
sudo ./install-dependencies.sh
- name: Install ${{ inputs.compiler }}
uses: aminya/setup-cpp@master
with:
compiler: ${{ inputs.compiler }}
ccache: true
# ubuntu:latest comes with CMake 3.29, so we just need to install
# ninja. see
# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md#tools
ninja: "${{ contains(inputs.enables, 'cxx-modules') }}"
- name: Install clang++
if: ${{ inputs.compiler == 'clang++' }}
run: |
sudo dnf -y install clang
- name: Install clang-scan-deps
if: ${{ contains(inputs.enables, 'cxx-modules') }}
run: |
sudo dnf -y install clang-tools-extra
- name: Install ccache
run: |
sudo dnf -y install ccache
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ inputs.compiler }}-${{ inputs.standard }}-${{ inputs.mode }}-${{ inputs.enables }}

- name: Configure
run: >
./configure.py
--ccache
--c++-standard ${{ inputs.standard }}
--compiler $CXX
--c-compiler $CC
--mode ${{ inputs.mode }}
${{ inputs.options }}
${{ inputs.enables }} ;
run: |
if [ ${{ inputs.compiler }} = "clang++" ]; then
CC=clang
else
CC=gcc
fi
./configure.py \
--ccache \
--c++-standard ${{ inputs.standard }} \
--compiler ${{ inputs.compiler }} \
--c-compiler $CC \
--mode ${{ inputs.mode }} \
${{ inputs.options }} \
${{ inputs.enables }}
# this works around https://github.com/scylladb/seastar/issues/2247
if [ ${{ inputs.mode }} = "dev" ]; then
sed -E -i 's|(BUILD_SHARED_LIBS:BOOL=)yes|\1no|' build/dev/CMakeCache.txt
fi;
- name: Build
run: cmake --build build/${{inputs.mode}}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
# only the compilers supported by setup-cpp
compiler: [clang++-18, gcc-13]
compiler: [clang++, g++]
standard: [20, 23]
mode: [dev, debug, release]
with:
Expand All @@ -32,7 +31,7 @@ jobs:
strategy:
fail-fast: false
with:
compiler: clang++-18
compiler: clang++
standard: 23
mode: release
enables: --enable-dpdk
Expand All @@ -43,7 +42,7 @@ jobs:
strategy:
fail-fast: false
with:
compiler: clang++-18
compiler: clang++
standard: 23
mode: debug
enables: --enable-cxx-modules

0 comments on commit ff07df9

Please sign in to comment.