From 7ec9c617256e1126c06036bf5402d65998ba2edf Mon Sep 17 00:00:00 2001 From: "Lars T. Kyllingstad" Date: Fri, 17 Apr 2026 14:47:34 +0200 Subject: [PATCH 1/2] Use GCC image for Linux builds and simplify workflow This fixes #800 by making changes to the Conan+Linux CI workflow. The official Conan Center docker image we were using has now been deprecated (all of them have), so I have switched to using the official GCC image instead. This required a GCC version upgrade. The oldest supported version is 12, but I went with 14 so we can stay on the same version for a while. (GCC 15 is the newest, at the time of writing.) I also replaced the roundabout process we had of generating our own Docker image to using Github Actions' built-in facilities for choosing an image. This also fixes #798 by updating the Conan options syntax for both Conan workflows. --- .github/workflows/ci-conan.yml | 60 +++++++++++++++------------------- 1 file changed, 27 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci-conan.yml b/.github/workflows/ci-conan.yml index c32a82dd..6acd096a 100644 --- a/.github/workflows/ci-conan.yml +++ b/.github/workflows/ci-conan.yml @@ -6,37 +6,37 @@ on: [push, workflow_dispatch] jobs: linux: name: Linux - runs-on: ubuntu-latest strategy: fail-fast: false matrix: build_type: [Debug, Release] - compiler_version: [9] + compiler_version: [14] option_proxyfmu: ['proxyfmu=True', 'proxyfmu=False'] option_shared: ['shared=True', 'shared=False'] + runs-on: ubuntu-latest + container: + image: gcc:${{ matrix.compiler_version }} + env: + CONAN_LOGIN_USERNAME_OSP: ${{ secrets.osp_artifactory_usr }} + CONAN_PASSWORD_OSP: ${{ secrets.osp_artifactory_pwd }} + LIBCOSIM_RUN_TESTS_ON_CONAN_BUILD: 1 timeout-minutes: 35 steps: - - uses: actions/checkout@v4 - - name: Generate Dockerfile + - uses: actions/checkout@v6 + - name: Install prerequisites run: | - mkdir /tmp/osp-builder-docker - cat <<'EOF' >/tmp/osp-builder-docker/Dockerfile - FROM conanio/gcc${{ matrix.compiler_version }}-ubuntu16.04 - ENV CONAN_LOGIN_USERNAME_OSP=${{ secrets.osp_artifactory_usr }} - ENV CONAN_PASSWORD_OSP=${{ secrets.osp_artifactory_pwd }} - ENV LIBCOSIM_RUN_TESTS_ON_CONAN_BUILD=1 - COPY entrypoint.sh / - ENTRYPOINT /entrypoint.sh - EOF - - name: Generate entrypoint.sh + apt-get update + apt-get install -y pipx cmake doxygen + pipx install conan + echo "$HOME/.local/bin" >> "$GITHUB_PATH" + - name: Configure Conan + run: | + conan profile detect + conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local + - name: Build package + shell: bash run: | - cat <<'EOF' >/tmp/osp-builder-docker/entrypoint.sh - #!/bin/bash -v - set -eu - cd /mnt/source - pip install conan --upgrade - conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force REFNAME="${GITHUB_REF#refs/*/}" VERSION="v$( Date: Mon, 18 May 2026 08:59:46 +0200 Subject: [PATCH 2/2] Upgrade CMake to v4 (#802) * Enhance CMake configuration for Debug builds and improve error logging messages * Refactor CMake configuration to ensure Release dependencies are used for all build types * Set CMakeDeps configuration to "Release" for Windows builds * Update CMake configuration and dependencies for improved compatibility * Enhance CMake configuration in CI and conanfile for improved dependency management * Revert "Updated" This reverts commit 071dcd979005b3a30e0411e8c4af1e63537143a2. * Remove commented-out configuration mappings in CMakeLists.txt * Updated * Reverted back conanfile.py changes * Remove cmake installation from pipx in ci-conan.yml * Update proxyfmu dependency version to 0.4.2 in conanfile.py * Remove cmake installation from ci-conan.yml --- .github/workflows/ci-conan.yml | 2 +- conanfile.py | 7 ++++--- src/cosim/observer/file_observer.cpp | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-conan.yml b/.github/workflows/ci-conan.yml index 6acd096a..3fc76a8c 100644 --- a/.github/workflows/ci-conan.yml +++ b/.github/workflows/ci-conan.yml @@ -27,7 +27,7 @@ jobs: - name: Install prerequisites run: | apt-get update - apt-get install -y pipx cmake doxygen + apt-get install -y pipx doxygen pipx install conan echo "$HOME/.local/bin" >> "$GITHUB_PATH" - name: Configure Conan diff --git a/conanfile.py b/conanfile.py index 19af82eb..78645781 100755 --- a/conanfile.py +++ b/conanfile.py @@ -40,17 +40,17 @@ def set_version(self): # Dependencies/requirements def requirements(self): - self.tool_requires("cmake/[>=3.19]") + self.tool_requires("cmake/[>=4.0]") self.requires("fmilibrary/[~2.3]") self.requires("libcbor/0.11.0") self.requires("libzip/[~1.11]") self.requires("ms-gsl/[>=3 <5]", transitive_headers=True) self.requires("boost/[~1.85]", transitive_headers=True, transitive_libs=True) # Required by Thrift if self.options.proxyfmu: - self.requires("proxyfmu/0.4.1@osp/stable", + self.requires("proxyfmu/0.4.2@osp/stable", transitive_headers=True, transitive_libs=True) - self.requires("yaml-cpp/[~0.8]") + self.requires("yaml-cpp/[~0.9]") self.requires("xerces-c/[~3.2]") # Exports @@ -127,3 +127,4 @@ def _is_tests_enabled(self): "true", "1", ) + diff --git a/src/cosim/observer/file_observer.cpp b/src/cosim/observer/file_observer.cpp index 73d912df..14a2224e 100644 --- a/src/cosim/observer/file_observer.cpp +++ b/src/cosim/observer/file_observer.cpp @@ -217,7 +217,7 @@ class file_observer::slave_value_writer if (fsw_.fail()) { std::stringstream error; - error << "Failed to open log file stream: " << filePath.c_str(); + error << "Failed to open log file stream: " << filePath.string(); throw std::runtime_error(error.str()); } @@ -279,7 +279,7 @@ class file_observer::slave_value_writer if (fsw_.fail()) { std::stringstream error; - error << "Failed to open log metadata file stream: " << filePath.c_str(); + error << "Failed to open log metadata file stream: " << filePath.string(); throw std::runtime_error(error.str()); }