Skip to content

Test with linux clang-23, and gcc-16 in docker#297

Draft
ClausKlein wants to merge 5 commits into
bemanproject:mainfrom
ClausKlein:feature/test-with-linux-clang-23
Draft

Test with linux clang-23, and gcc-16 in docker#297
ClausKlein wants to merge 5 commits into
bemanproject:mainfrom
ClausKlein:feature/test-with-linux-clang-23

Conversation

@ClausKlein

@ClausKlein ClausKlein commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

This is not intended to be merged, only to show the current problems with import std;

see https://gitlab.kitware.com/cmake/cmake/-/work_items/27962

and ClausKlein/fmt-module#5

@ClausKlein
ClausKlein marked this pull request as draft July 18, 2026 07:52
@coveralls

coveralls commented Jul 18, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 93.742% (+0.004%) from 93.738% — ClausKlein:feature/test-with-linux-clang-23 into bemanproject:main

@ClausKlein

Copy link
Copy Markdown
Collaborator Author

my docker file to build clang-23:

# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright © 2025-2026 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
#                       Matthias Kretz <m.kretz@gsi.de>

FROM ghcr.io/mattkretz/cplusplus-ci/gcc14

ENV DEBIAN_FRONTEND=noninteractive

ENV LLVM_VERSION=23

# NOTE: pipx ensurepath -> appends /root/.local/bin to the PATH environment variable.
ENV PATH="/root/.local/bin:${PATH}"

RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|apt-key add - && \
    add-apt-repository "deb http://apt.llvm.org/noble/ llvm-toolchain-noble main" && \
    apt-get update && \
    apt-get install -y --no-install-recommends \
    bash bash-completion vim tree less symlinks direnv \
    build-essential curl git wget libssl-dev \
    doxygen graphviz python3-pip python-is-python3 pipx \
    zip ccache \
    clang-${LLVM_VERSION} \
    clang-tidy-${LLVM_VERSION} \
    clang-format-${LLVM_VERSION} \
    libc++-${LLVM_VERSION}-dev \
    libc++abi-${LLVM_VERSION}-dev && \
    apt-get install -y --no-install-recommends libclang-rt-${LLVM_VERSION}-dev && \
    update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${LLVM_VERSION} ${LLVM_VERSION}0 \
                        --slave /usr/bin/clang++ clang++ /usr/bin/clang++-${LLVM_VERSION} && \
    update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-${LLVM_VERSION} ${LLVM_VERSION}0 && \
    update-alternatives --install /usr/bin/run-clang-tidy run-clang-tidy /usr/bin/run-clang-tidy-${LLVM_VERSION} ${LLVM_VERSION}0 && \
    update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-${LLVM_VERSION} ${LLVM_VERSION}0 && \
    apt-get clean

# QUICKFIX: ajust the broken relative paths inside libc++.modules.json
RUN sed -i \
    's#\.\./share/libc++#/usr/lib/llvm-'${LLVM_VERSION}'/share/libc++#' \
    /lib/x86_64-linux-gnu/libc++.modules.json

RUN pipx install cmake && \
    pipx install --include-deps cmake-format && \
    pipx install codespell && \
    pipx install conan && \
    pipx install gcovr && \
    pipx install gersemi && \
    pipx install ninja && \
    pipx install pre-commit && \
    pipx install uv

WORKDIR /home/builder/workdir

Comment thread cmake/prelude.cmake
Comment on lines 91 to 121
elseif(LINUX)
execute_process(
OUTPUT_VARIABLE LLVM_MODULES
COMMAND clang++ -print-file-name=libc++.modules.json
COMMAND_ECHO STDOUT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT CMAKE_CXX_STDLIB_MODULES_JSON)
set(CMAKE_CXX_STDLIB_MODULES_JSON ${LLVM_MODULES})
endif()
message(
STATUS
"CMAKE_CXX_STDLIB_MODULES_JSON=${CMAKE_CXX_STDLIB_MODULES_JSON}"
)
endif()

if(EXISTS ${CMAKE_CXX_STDLIB_MODULES_JSON})
message(
STATUS
"CMAKE_CXX_STDLIB_MODULES_JSON=${CMAKE_CXX_STDLIB_MODULES_JSON}"
)
# gersemi: off
set(CACHE{CMAKE_CXX_STDLIB_MODULES_JSON}
TYPE FILEPATH
HELP "Result of: clang++ -print-file-name=c++/libc++.modules.json"
VALUE ${CMAKE_CXX_STDLIB_MODULES_JSON}
)
# gersemi: on
else()
message(STATUS "File does NOT EXISTS! ${CMAKE_CXX_STDLIB_MODULES_JSON}")
endif()

@ClausKlein ClausKlein Jul 18, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Not sure why it is needed, but it works fine!

line 120 should be message(WARNING ...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants