From 8651496f089afa3ce52db5a60fcfd124e703f5f8 Mon Sep 17 00:00:00 2001 From: 2xB <31772910+2xB@users.noreply.github.com> Date: Wed, 5 Jun 2024 15:44:21 +0200 Subject: [PATCH 1/7] Docker: Fedora 38 => 40 --- Dockerfile | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 932c5545e..283dbbcc9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,8 +10,7 @@ ARG KASSIOPEIA_GIT_COMMIT="" ARG KASSIOPEIA_CPUS="" # --- runtime-base --- -# NOTE: For Fedora 39, remove marked lines below -FROM fedora:38 as runtime-base +FROM fedora:40 as runtime-base ARG KASSIOPEIA_UID ARG KASSIOPEIA_USER ARG KASSIOPEIA_GID @@ -19,13 +18,6 @@ ARG KASSIOPEIA_GROUP LABEL description="Runtime base container" -# TODO REMOVE FOR FEDORA 39 -RUN dnf update -y \ - && dnf install -y --setopt=install_weak_deps=False dnf-plugins-core \ - && dnf clean all -RUN dnf copr enable thofmann/log4xx-1.x -y -# END TODO - COPY Docker/packages.runtime packages RUN dnf update -y \ && dnf install -y --setopt=install_weak_deps=False $(cat packages) \ From 6b5f21542e7eeb39fe414b9c8088f5689f6ad5b8 Mon Sep 17 00:00:00 2001 From: 2xB <2xB@users.noreply.github.com> Date: Mon, 10 Jun 2024 20:56:56 +0200 Subject: [PATCH 2/7] Fix compiler warning about uninitialized member gcc does not think fHolder was initialized. This fixes that by using a unique_ptr that is initialized automatically. --- Kassiopeia/Objects/Include/KSObject.h | 9 +++------ Kassiopeia/Objects/Source/KSObject.cxx | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Kassiopeia/Objects/Include/KSObject.h b/Kassiopeia/Objects/Include/KSObject.h index a4ba1a3ac..5f02dd2d0 100644 --- a/Kassiopeia/Objects/Include/KSObject.h +++ b/Kassiopeia/Objects/Include/KSObject.h @@ -3,6 +3,7 @@ #include "KSObjectsMessage.h" #include "KTagged.h" +#include namespace Kassiopeia { @@ -53,7 +54,7 @@ class KSObject : public katrin::KTagged XType* fObject; }; - mutable KSHolder* fHolder; + mutable std::unique_ptr fHolder; }; inline KSObject::KSHolder::KSHolder() = default; @@ -141,12 +142,8 @@ template<> inline const KSObject* KSObject::As() const template inline void KSObject::Set(XType* anObject) { - if (fHolder != nullptr) { - delete fHolder; - fHolder = nullptr; - } auto* tHolder = new KSHolderTemplate(anObject); - fHolder = tHolder; + fHolder = std::unique_ptr(tHolder); return; } diff --git a/Kassiopeia/Objects/Source/KSObject.cxx b/Kassiopeia/Objects/Source/KSObject.cxx index e33b0af8f..8660d414a 100644 --- a/Kassiopeia/Objects/Source/KSObject.cxx +++ b/Kassiopeia/Objects/Source/KSObject.cxx @@ -3,8 +3,8 @@ namespace Kassiopeia { -KSObject::KSObject() : KTagged(), fHolder(nullptr) {} -KSObject::KSObject(const KSObject& aCopy) : KTagged(aCopy), fHolder(nullptr) {} +KSObject::KSObject() : KTagged() {}; +KSObject::KSObject(const KSObject& aCopy) : KTagged(aCopy) {} KSObject::~KSObject() = default; } // namespace Kassiopeia From 81d617309a80ebebc5471019eb88c53366db0c11 Mon Sep 17 00:00:00 2001 From: 2xB <31772910+2xB@users.noreply.github.com> Date: Mon, 10 Jun 2024 21:32:34 +0200 Subject: [PATCH 3/7] CI: Fedora 37 => Fedora 40 --- .github/workflows/test.yml | 12 +++--------- Documentation/gh-pages/source/setup_manual.rst | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5c1d7183b..9560ffe2f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ on: pull_request: branches: [ "main" ] -# Keep the following in sync with Documentation/gh-pages/source/compiling.rst ! +# Keep the following in sync with Documentation/gh-pages/source/setup_manual.rst ! jobs: ubuntu_20_04: strategy: @@ -51,20 +51,14 @@ jobs: source root/bin/thisroot.sh && source install/bin/kasperenv.sh && UnitTestKasper shell: bash - fedora_37: + fedora_40: strategy: matrix: use_clang: [false] # FIXME add "true" after solving https://github.com/KATRIN-Experiment/Kassiopeia/issues/87 runs-on: ubuntu-latest - container: fedora:37 + container: fedora:40 steps: - uses: actions/checkout@v3 - - name: Run workaround for log4cxx bug (no longer needed with Fedora 39) - run: | - dnf update -y - dnf install -y --setopt=install_weak_deps=False dnf-plugins-core - dnf clean all - dnf copr enable thofmann/log4xx-1.x -y - name: Install dependencies run: | dnf install -y \ diff --git a/Documentation/gh-pages/source/setup_manual.rst b/Documentation/gh-pages/source/setup_manual.rst index b61169dad..b671c70d9 100644 --- a/Documentation/gh-pages/source/setup_manual.rst +++ b/Documentation/gh-pages/source/setup_manual.rst @@ -100,7 +100,7 @@ On a RedHat/Fedora Linux system, the packages can be installed through the comma boost-devel fftw-devel gsl-devel hdf5-devel libomp-devel liburing-devel libxml2-devel log4cxx-devel \ ocl-icd-devel openmpi-devel openssl-devel sqlite-devel vtk-devel zlib-devel -Tested on Fedora Linux 37. +Tested on Fedora Linux 40. Required dependencies ---------------------- From 8cd6b78a5ccc0652dc18420b05fa3a067b706a48 Mon Sep 17 00:00:00 2001 From: 2xB <31772910+2xB@users.noreply.github.com> Date: Mon, 10 Jun 2024 23:53:47 +0200 Subject: [PATCH 4/7] kasperenv.sh: Fix PATH pollution Previously, code that was intended to remove old KASPER entries from PATH variables was broken, this is fixed. The code didn't work since it was introduced in January 2020 due to using single quotes and therefore avoiding variable replacement. Since "/" is also a letter that is frequently used in paths, to avoid future problems the letter was replaced with ";", which `thisroot.sh` also uses for this cause. --- kasperenv.sh.in | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/kasperenv.sh.in b/kasperenv.sh.in index b77d87467..7ea995341 100755 --- a/kasperenv.sh.in +++ b/kasperenv.sh.in @@ -67,10 +67,20 @@ fi export KEMFIELD_CACHE mkdir -p ${KEMFIELD_CACHE} -export PATH=${KASPER_INSTALL_BIN}:$(echo $PATH | sed 's/${OLD_PATH}//g') -export LD_LIBRARY_PATH=${KASPER_INSTALL_LIB}:$(echo $LD_LIBRARY_PATH | sed 's/${OLD_LDLIBPATH}//g') -export PKG_CONFIG_PATH=${KASPER_INSTALL_LIB}/pkgconfig:$(echo $PKG_CONFIG_PATH | sed 's/${OLD_PKGCFGPATH}//g') -export PYTHONPATH=${KASPER_INSTALL_LIB}/python:$(echo $PYTHONPATH | sed 's/${OLD_PYTHONPATH}//g') -export CMAKE_PREFIX_PATH=${KASPER_INSTALL}:$(echo $CMAKE_PREFIX_PATH | sed 's/${OLD_CMAKE_PREF}//g') + +[[ -n $OLD_PATH ]] && export PATH=$(echo $PATH | sed "s;${OLD_PATH};;g") +export PATH=${KASPER_INSTALL_BIN}:$PATH + +[[ -n $OLD_LDLIBPATH ]] && export LD_LIBRARY_PATH=$(echo $LD_LIBRARY_PATH | sed "s;${OLD_LDLIBPATH};;g") +export LD_LIBRARY_PATH=${KASPER_INSTALL_LIB}:$LD_LIBRARY_PATH + +[[ -n $OLD_PKGCFGPATH ]] && export PKG_CONFIG_PATH=$(echo $PKG_CONFIG_PATH | sed "s;${OLD_PKGCFGPATH};;g") +export PKG_CONFIG_PATH=${KASPER_INSTALL_LIB}/pkgconfig:$PKG_CONFIG_PATH + +[[ -n $OLD_PYTHONPATH ]] && export PYTHONPATH=$(echo $PYTHONPATH | sed "s;${OLD_PYTHONPATH};;g") +export PYTHONPATH=${KASPER_INSTALL_LIB}/python:$PYTHONPATH + +[[ -n $OLD_CMAKE_PREF ]] && export CMAKE_PREFIX_PATH=$(echo $CMAKE_PREFIX_PATH | sed "s;${OLD_CMAKE_PREF};;g") +export CMAKE_PREFIX_PATH=${KASPER_INSTALL}:$CMAKE_PREFIX_PATH return 0 From 332bac557a7d6cead169f3fe7a4b9f7aa1add3b5 Mon Sep 17 00:00:00 2001 From: 2xB <31772910+2xB@users.noreply.github.com> Date: Mon, 10 Jun 2024 23:54:41 +0200 Subject: [PATCH 5/7] kasperenv.sh: Fix "Error in cling::[...]" Adding KASPER include path to `ROOT_INCLUDE_PATH` to avoid errors of type `Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:`. --- kasperenv.sh.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kasperenv.sh.in b/kasperenv.sh.in index 7ea995341..903ce438d 100755 --- a/kasperenv.sh.in +++ b/kasperenv.sh.in @@ -14,6 +14,7 @@ if [ -n "${KASPERSYS}" ] OLD_PKGCFGPATH=${OLD_KASPERSYS}/lib/pkgconfig: OLD_PYTHONPATH=${OLD_KASPERSYS}/lib/python: OLD_CMAKE_PREF=${OLD_KASPERSYS}: + OLD_ROOT_INCLUDE_PATH=${OLD_KASPERSYS}/include: fi if [ -n "${KASPER_INSTALL}" ] @@ -24,6 +25,7 @@ if [ -n "${KASPER_INSTALL}" ] OLD_PKGCFGPATH=${OLD_KASPER_INSTALL}/lib/pkgconfig: OLD_PYTHONPATH=${OLD_KASPER_INSTALL}/lib/python: OLD_CMAKE_PREF=${OLD_KASPER_INSTALL}: + OLD_ROOT_INCLUDE_PATH=${OLD_KASPER_INSTALL}/include: fi if [ -n "${KASPER_SOURCE}" ] @@ -36,6 +38,7 @@ export KASPER_INSTALL=@KASPER_INSTALL_DIR@ KASPER_INSTALL_BIN=@BIN_INSTALL_DIR@ KASPER_INSTALL_LIB=@LIB_INSTALL_DIR@ KASPER_INSTALL_CACHE=@CACHE_INSTALL_DIR@ +KASPER_INSTALL_INCLUDE=@INCLUDE_INSTALL_DIR@ printf "\033[32;1m** KASPER source directory set to ${KASPER_SOURCE}\033[0m\n" printf "\033[32;1m** KASPER install directory set to ${KASPER_INSTALL}\033[0m\n" @@ -83,4 +86,7 @@ export PYTHONPATH=${KASPER_INSTALL_LIB}/python:$PYTHONPATH [[ -n $OLD_CMAKE_PREF ]] && export CMAKE_PREFIX_PATH=$(echo $CMAKE_PREFIX_PATH | sed "s;${OLD_CMAKE_PREF};;g") export CMAKE_PREFIX_PATH=${KASPER_INSTALL}:$CMAKE_PREFIX_PATH +[[ -n $OLD_ROOT_INCLUDE_PATH ]] && export ROOT_INCLUDE_PATH=$(echo $ROOT_INCLUDE_PATH | sed "s;${OLD_ROOT_INCLUDE_PATH};;g") +export ROOT_INCLUDE_PATH=${KASPER_INSTALL_INCLUDE}:$ROOT_INCLUDE_PATH + return 0 From 54be51f4f3d0e35cb56236731ce29cd29089057f Mon Sep 17 00:00:00 2001 From: 2xB <31772910+2xB@users.noreply.github.com> Date: Mon, 10 Jun 2024 23:58:10 +0200 Subject: [PATCH 6/7] Docker: Added diffutils & paraview to full image --- Docker/packages.full | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Docker/packages.full b/Docker/packages.full index 07a1543c6..b3f4884c3 100644 --- a/Docker/packages.full +++ b/Docker/packages.full @@ -3,6 +3,8 @@ vim zsh zsh-syntax-highlighting htop +diffutils +paraview root root-notebook From 350dbb5769ea262113fb125c35dba7ad0c0685ff Mon Sep 17 00:00:00 2001 From: 2xB <31772910+2xB@users.noreply.github.com> Date: Mon, 10 Jun 2024 23:59:22 +0200 Subject: [PATCH 7/7] Docker: Install uproot in full image --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 283dbbcc9..ee551fd03 100644 --- a/Dockerfile +++ b/Dockerfile @@ -136,6 +136,7 @@ RUN pip3 install --no-cache-dir jupyterlab \ && pip3 install --no-cache-dir jupyter-server-proxy \ && pip3 install --no-cache-dir jupyterhub \ && pip3 install --no-cache-dir ipympl \ + && pip3 install --no-cache-dir uproot \ && pip3 install --no-cache-dir iminuit # Ensure if LDAP is used on a JupyterHub, user names are correctly resolved