Skip to content

Commit fcd624b

Browse files
leoparenteclaude
andcommitted
chore: upgrade corrade to cci.20260327 to fix macOS build
Pin corrade to commit 22e7ffc6 (2026-03-27) via a local conan recipe, replacing the old 2020.06 release which fails to compile on modern macOS. Update PluginManager API usage across all plugin headers to match the new corrade API (StringView constructor params, Array<String> search paths, StringView pluginInterface). Update CoreRegistry.cpp to handle StringView/StringIterable return types from pluginList() and provides(). Remove the -include vector macOS workaround from CI and add a conan export step for the local recipe to all build workflows. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9e0d410 commit fcd624b

28 files changed

Lines changed: 329 additions & 46 deletions

.github/workflows/build-develop.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,19 @@ jobs:
4343
uses: actions/cache@v5
4444
with:
4545
path: ${{github.workspace}}/build/p/
46-
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
46+
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py', 'conan/corrade/conanfile.py') }}
4747
restore-keys: conan-${{ runner.os }}-
48-
48+
4949
- name: Detect Conan Profile
5050
run: conan profile detect -f
5151

52+
- name: Export local Corrade recipe
53+
run: conan export ${{github.workspace}}/conan/corrade/ --name=corrade --version=cci.20260327
54+
5255
- name: Configure CMake
5356
shell: bash
5457
working-directory: ${{github.workspace}}/build
55-
run: PKG_CONFIG_PATH=${{github.workspace}}/local/lib/pkgconfig cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake -DCONAN_INSTALL_ARGS="--build=missing;-c=corrade/*:tools.build:cxxflags=['-include','vector']"
58+
run: PKG_CONFIG_PATH=${{github.workspace}}/local/lib/pkgconfig cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake -DCONAN_INSTALL_ARGS="--build=missing"
5659

5760
- name: Build
5861
working-directory: ${{github.workspace}}/build
@@ -83,9 +86,12 @@ jobs:
8386
uses: actions/cache@v5
8487
with:
8588
path: ${{github.workspace}}/build/p/
86-
key: conan-${{ runner.os }}-amd64-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
89+
key: conan-${{ runner.os }}-amd64-${{ hashFiles('conanfile.py', '*/conanfile.py', 'conan/corrade/conanfile.py') }}
8790
restore-keys: conan-${{ runner.os }}-amd64-
8891

92+
- name: Export local Corrade recipe
93+
run: conan export ${{github.workspace}}/conan/corrade/ --name=corrade --version=cci.20260327
94+
8995
- name: Configure CMake
9096
shell: bash
9197
working-directory: ${{github.workspace}}/build
@@ -131,9 +137,13 @@ jobs:
131137
uses: actions/cache@v5
132138
with:
133139
path: ${{github.workspace}}/build/p/
134-
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
140+
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py', 'conan/corrade/conanfile.py') }}
135141
restore-keys: conan-${{ runner.os }}-
136142

143+
- name: Export local Corrade recipe
144+
shell: bash
145+
run: conan export $GITHUB_WORKSPACE/conan/corrade/ --name=corrade --version=cci.20260327
146+
137147
- name: Configure CMake
138148
shell: bash
139149
working-directory: ${{github.workspace}}\build

.github/workflows/build-release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,12 @@ jobs:
3636
uses: actions/cache@v5
3737
with:
3838
path: ${{github.workspace}}/build/p/
39-
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
39+
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py', 'conan/corrade/conanfile.py') }}
4040
restore-keys: conan-${{ runner.os }}-
4141

42+
- name: Export local Corrade recipe
43+
run: conan export ${{github.workspace}}/conan/corrade/ --name=corrade --version=cci.20260327
44+
4245
- name: Configure CMake
4346
shell: bash
4447
working-directory: ${{github.workspace}}/build

.github/workflows/build_cross.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ jobs:
122122
key: conan-${{ runner.os }}-${{matrix.arch}}-${{ hashFiles('**/conanfile.py') }}
123123
restore-keys: conan-${{ runner.os }}-${{matrix.arch}}-
124124

125+
- name: Export local Corrade recipe
126+
run: conan export ${{github.workspace}}/src/conan/corrade/ --name=corrade --version=cci.20260327
127+
125128
- name: Install dependencies
126129
working-directory: ${{github.workspace}}/src
127130
run: |

.github/workflows/build_debug.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,17 @@ jobs:
2828
uses: actions/cache@v5
2929
with:
3030
path: ${{github.workspace}}/build/p/
31-
key: conan-${{ runner.os }}-amd64-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
31+
key: conan-${{ runner.os }}-amd64-${{ hashFiles('conanfile.py', '*/conanfile.py', 'conan/corrade/conanfile.py') }}
3232
restore-keys: conan-${{ runner.os }}-amd64-
3333

3434
- name: linux package install
3535
run: |
3636
sudo apt-get update
3737
sudo apt-get install --yes --no-install-recommends jq lcov
3838
39+
- name: Export local Corrade recipe
40+
run: conan export ${{github.workspace}}/conan/corrade/ --name=corrade --version=cci.20260327
41+
3942
- name: Configure CMake
4043
shell: bash
4144
working-directory: ${{github.workspace}}/build
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Here we are reproducing the variables and call performed by the FindCorrade.cmake provided by the library
2+
3+
# Read flags from configuration
4+
file(READ "${CMAKE_CURRENT_LIST_DIR}/../../include/Corrade/configure.h" _corradeConfigure)
5+
string(REGEX REPLACE ";" "\\\\;" _corradeConfigure "${_corradeConfigure}")
6+
string(REGEX REPLACE "\n" ";" _corradeConfigure "${_corradeConfigure}")
7+
set(_corradeFlags
8+
MSVC2015_COMPATIBILITY
9+
MSVC2017_COMPATIBILITY
10+
MSVC2019_COMPATIBILITY
11+
BUILD_DEPRECATED
12+
BUILD_STATIC
13+
BUILD_STATIC_UNIQUE_GLOBALS
14+
BUILD_MULTITHREADED
15+
TARGET_UNIX
16+
TARGET_APPLE
17+
TARGET_IOS
18+
TARGET_IOS_SIMULATOR
19+
TARGET_WINDOWS
20+
TARGET_WINDOWS_RT
21+
TARGET_EMSCRIPTEN
22+
TARGET_ANDROID
23+
# TARGET_X86 etc and TARGET_LIBCXX are not exposed to CMake as the meaning
24+
# is unclear on platforms with multi-arch binaries or when mixing different
25+
# STL implementations. TARGET_GCC etc are figured out via UseCorrade.cmake,
26+
# as the compiler can be different when compiling the lib & when using it.
27+
PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT
28+
TESTSUITE_TARGET_XCTEST
29+
UTILITY_USE_ANSI_COLORS)
30+
foreach(_corradeFlag ${_corradeFlags})
31+
list(FIND _corradeConfigure "#define CORRADE_${_corradeFlag}" _corrade_${_corradeFlag})
32+
if(NOT _corrade_${_corradeFlag} EQUAL -1)
33+
set(CORRADE_${_corradeFlag} 1)
34+
endif()
35+
endforeach()
36+
37+
38+
# Corrade::rc, a target with just an executable
39+
if(NOT TARGET Corrade::rc)
40+
if(CMAKE_CROSSCOMPILING)
41+
find_program(CORRADE_RC_PROGRAM
42+
NAMES corrade-rc
43+
PATHS ENV
44+
PATH NO_DEFAULT_PATH)
45+
else()
46+
find_program(CORRADE_RC_PROGRAM
47+
NAMES corrade-rc
48+
PATHS "${CMAKE_CURRENT_LIST_DIR}/../../bin/"
49+
NO_DEFAULT_PATH)
50+
endif()
51+
52+
get_filename_component(CORRADE_RC_PROGRAM "${CORRADE_RC_PROGRAM}" ABSOLUTE)
53+
54+
add_executable(Corrade::rc IMPORTED)
55+
set_property(TARGET Corrade::rc PROPERTY IMPORTED_LOCATION ${CORRADE_RC_PROGRAM})
56+
endif()
57+
58+
# Include and declare other build modules
59+
include("${CMAKE_CURRENT_LIST_DIR}/UseCorrade.cmake")
60+
set(CORRADE_LIB_SUFFIX_MODULE "${CMAKE_CURRENT_LIST_DIR}/CorradeLibSuffix.cmake")

conan/corrade/conandata.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
sources:
2+
"cci.20260327":
3+
sha256: d8f30e9a857172003b6b02304783f40e8038c36e4127a0cfec7fe14f41c13fd4
4+
url: https://github.com/mosra/corrade/archive/22e7ffc6fcdeaa0df96e0d8b3d482ad6abe7dc36.tar.gz

conan/corrade/conanfile.py

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
import os
2+
3+
from conan import ConanFile
4+
from conan.errors import ConanInvalidConfiguration
5+
from conan.tools.build import cross_building
6+
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
7+
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir
8+
from conan.tools.microsoft import is_msvc, check_min_vs
9+
10+
required_conan_version = ">=1.52.0"
11+
12+
13+
class CorradeConan(ConanFile):
14+
name = "corrade"
15+
description = "Corrade is a multiplatform utility library written in C++11/C++14."
16+
license = "MIT"
17+
url = "https://github.com/conan-io/conan-center-index"
18+
homepage = "https://magnum.graphics/corrade"
19+
topics = ("magnum", "filesystem", "console", "environment", "os")
20+
21+
package_type = "library"
22+
settings = "os", "arch", "compiler", "build_type"
23+
options = {
24+
"shared": [True, False],
25+
"fPIC": [True, False],
26+
"build_deprecated": [True, False],
27+
"with_interconnect": [True, False],
28+
"with_main": [True, False],
29+
"with_pluginmanager": [True, False],
30+
"with_testsuite": [True, False],
31+
"with_utility": [True, False],
32+
}
33+
default_options = {
34+
"shared": False,
35+
"fPIC": True,
36+
"build_deprecated": True,
37+
"with_interconnect": True,
38+
"with_main": True,
39+
"with_pluginmanager": True,
40+
"with_testsuite": True,
41+
"with_utility": True,
42+
}
43+
44+
def export_sources(self):
45+
copy(self, "cmake/*", src=self.recipe_folder, dst=self.export_sources_folder)
46+
export_conandata_patches(self)
47+
48+
def config_options(self):
49+
if self.settings.os == "Windows":
50+
del self.options.fPIC
51+
52+
def configure(self):
53+
if self.options.shared:
54+
self.options.rm_safe("fPIC")
55+
56+
def layout(self):
57+
cmake_layout(self, src_folder="src")
58+
59+
def validate(self):
60+
check_min_vs(self, 190)
61+
if not self.options.with_utility and (
62+
self.options.with_testsuite or self.options.with_interconnect or self.options.with_pluginmanager
63+
):
64+
raise ConanInvalidConfiguration(
65+
"Component 'utility' is required for 'test_suite', 'interconnect' and 'plugin_manager'"
66+
)
67+
68+
def build_requirements(self):
69+
if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True):
70+
self.tool_requires(f"corrade/{self.version}")
71+
72+
def source(self):
73+
get(self, **self.conan_data["sources"][self.version], strip_root=True)
74+
75+
def generate(self):
76+
tc = CMakeToolchain(self)
77+
tc.variables["BUILD_STATIC"] = not self.options.shared
78+
tc.variables["BUILD_STATIC_PIC"] = self.options.get_safe("fPIC", False)
79+
80+
tc.variables["BUILD_DEPRECATED"] = self.options.build_deprecated
81+
tc.variables["WITH_INTERCONNECT"] = self.options.with_interconnect
82+
tc.variables["WITH_MAIN"] = self.options.with_main
83+
tc.variables["WITH_PLUGINMANAGER"] = self.options.with_pluginmanager
84+
tc.variables["WITH_TESTSUITE"] = self.options.with_testsuite
85+
tc.variables["WITH_UTILITY"] = self.options.with_utility
86+
tc.variables["WITH_RC"] = self.options.with_utility
87+
88+
# Corrade uses suffix on the resulting "lib"-folder when running cmake.install()
89+
# Set it explicitly to empty, else Corrade might set it implicitly (eg. to "64")
90+
tc.variables["LIB_SUFFIX"] = ""
91+
92+
if is_msvc(self):
93+
if check_min_vs(self, 193, raise_invalid=False):
94+
tc.variables["MSVC2019_COMPATIBILITY"] = True
95+
elif check_min_vs(self, 192, raise_invalid=False):
96+
tc.variables["MSVC2017_COMPATIBILITY"] = True
97+
elif check_min_vs(self, 191, raise_invalid=False):
98+
tc.variables["MSVC2015_COMPATIBILITY"] = True
99+
100+
tc.generate()
101+
tc = CMakeDeps(self)
102+
tc.generate()
103+
104+
def build(self):
105+
apply_conandata_patches(self)
106+
cmake = CMake(self)
107+
cmake.configure()
108+
cmake.build()
109+
110+
def package(self):
111+
copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder)
112+
cmake = CMake(self)
113+
cmake.install()
114+
share_cmake = os.path.join(self.package_folder, "share", "cmake", "Corrade")
115+
copy(self, "UseCorrade.cmake",
116+
src=share_cmake,
117+
dst=os.path.join(self.package_folder, "lib", "cmake"))
118+
copy(self, "CorradeLibSuffix.cmake",
119+
src=share_cmake,
120+
dst=os.path.join(self.package_folder, "lib", "cmake"))
121+
copy(self, "*.cmake",
122+
src=os.path.join(self.export_sources_folder, "cmake"),
123+
dst=os.path.join(self.package_folder, "lib", "cmake"))
124+
rmdir(self, os.path.join(self.package_folder, "share"))
125+
126+
def package_info(self):
127+
self.cpp_info.set_property("cmake_find_mode", "both")
128+
self.cpp_info.set_property("cmake_file_name", "Corrade")
129+
self.cpp_info.set_property("cmake_target_name", "Corrade::Corrade")
130+
131+
suffix = "-d" if self.settings.build_type == "Debug" else ""
132+
133+
cmake_modules = [
134+
# Reproduces the variables and calls performed by the FindCorrade.cmake provided by the library
135+
os.path.join("lib", "cmake", "conan-corrade-vars.cmake"),
136+
# Autodetects LIB_SUFFIX (either "64" or "")
137+
os.path.join("lib", "cmake", "CorradeLibSuffix.cmake"),
138+
# Exports build flags and macros
139+
os.path.join("lib", "cmake", "UseCorrade.cmake"),
140+
]
141+
self.cpp_info.set_property("cmake_build_modules", cmake_modules)
142+
self.cpp_info.components["_corrade"].build_modules["cmake_find_package"] = cmake_modules
143+
self.cpp_info.components["_corrade"].build_modules["cmake_find_package_multi"] = cmake_modules
144+
145+
if self.options.with_main:
146+
self.cpp_info.components["main"].set_property("cmake_target_name", "Corrade::Main")
147+
self.cpp_info.components["main"].names["cmake_find_package"] = "Main"
148+
self.cpp_info.components["main"].names["cmake_find_package_multi"] = "Main"
149+
if self.settings.os == "Windows":
150+
self.cpp_info.components["main"].libs = ["CorradeMain" + suffix]
151+
self.cpp_info.components["main"].requires = ["_corrade"]
152+
153+
if self.options.with_utility:
154+
self.cpp_info.components["utility"].set_property("cmake_target_name", "Corrade::Utility")
155+
self.cpp_info.components["utility"].names["cmake_find_package"] = "Utility"
156+
self.cpp_info.components["utility"].names["cmake_find_package_multi"] = "Utility"
157+
self.cpp_info.components["utility"].libs = ["CorradeUtility" + suffix]
158+
if self.settings.os in ["Linux", "FreeBSD"]:
159+
self.cpp_info.components["utility"].system_libs = ["m", "dl"]
160+
self.cpp_info.components["utility"].requires = ["_corrade"]
161+
162+
if self.options.with_interconnect:
163+
self.cpp_info.components["interconnect"].set_property("cmake_target_name", "Corrade::Interconnect")
164+
self.cpp_info.components["interconnect"].names["cmake_find_package"] = "Interconnect"
165+
self.cpp_info.components["interconnect"].names["cmake_find_package_multi"] = "Interconnect"
166+
self.cpp_info.components["interconnect"].libs = ["CorradeInterconnect" + suffix]
167+
self.cpp_info.components["interconnect"].requires = ["utility"]
168+
169+
if self.options.with_pluginmanager:
170+
self.cpp_info.components["plugin_manager"].set_property("cmake_target_name", "Corrade::PluginManager")
171+
self.cpp_info.components["plugin_manager"].names["cmake_find_package"] = "PluginManager"
172+
self.cpp_info.components["plugin_manager"].names["cmake_find_package_multi"] = "PluginManager"
173+
self.cpp_info.components["plugin_manager"].libs = ["CorradePluginManager" + suffix]
174+
self.cpp_info.components["plugin_manager"].requires = ["utility"]
175+
176+
if self.options.with_testsuite:
177+
self.cpp_info.components["test_suite"].set_property("cmake_target_name", "Corrade::TestSuite")
178+
self.cpp_info.components["test_suite"].names["cmake_find_package"] = "TestSuite"
179+
self.cpp_info.components["test_suite"].names["cmake_find_package_multi"] = "TestSuite"
180+
self.cpp_info.components["test_suite"].libs = ["CorradeTestSuite" + suffix]
181+
self.cpp_info.components["test_suite"].requires = ["utility"]
182+
183+
if self.options.with_utility:
184+
bindir = os.path.join(self.package_folder, "bin")
185+
self.output.info(f"Appending PATH environment variable: {bindir}")
186+
self.env_info.PATH.append(bindir)
187+
188+
# pkg_config: Add more explicit naming to generated files (avoid filesystem collision).
189+
for key, component in self.cpp_info.components.items():
190+
component.set_property("pkg_config_name", f"{self.name}_{key}")
191+
192+
self.cpp_info.names["cmake_find_package"] = "Corrade"
193+
self.cpp_info.names["cmake_find_package_multi"] = "Corrade"

conanfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Pktvisor(ConanFile):
88

99
def requirements(self):
1010
self.requires("catch2/3.14.0")
11-
self.requires("corrade/2020.06")
11+
self.requires("corrade/cci.20260327")
1212
self.requires("cpp-httplib/0.18.3")
1313
self.requires("docopt.cpp/0.6.3")
1414
self.requires("fast-cpp-csv-parser/cci.20240102")
@@ -37,7 +37,7 @@ def requirements(self):
3737
self.requires("sentry-crashpad/0.6.5")
3838

3939
def build_requirements(self):
40-
self.tool_requires("corrade/2020.06")
40+
self.tool_requires("corrade/cci.20260327")
4141
self.tool_requires("protobuf/6.33.5")
4242

4343
def layout(self):

src/AbstractPlugin.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#pragma once
66

7+
#include <Corrade/Containers/Array.h>
8+
#include <Corrade/Containers/String.h>
79
#include <Corrade/PluginManager/AbstractPlugin.h>
810
#include <exception>
911
#include <nlohmann/json.hpp>
@@ -69,12 +71,12 @@ class AbstractPlugin : public Corrade::PluginManager::AbstractPlugin
6971
}
7072

7173
public:
72-
static std::vector<std::string> pluginSearchPaths()
74+
static Corrade::Containers::Array<Corrade::Containers::String> pluginSearchPaths()
7375
{
74-
return {""};
76+
return {Corrade::Containers::InPlaceInit, {""}};
7577
}
7678

77-
explicit AbstractPlugin(Corrade::PluginManager::AbstractManager &manager, const std::string &plugin)
79+
explicit AbstractPlugin(Corrade::PluginManager::AbstractManager &manager, const Corrade::Containers::StringView plugin)
7880
: Corrade::PluginManager::AbstractPlugin{manager, plugin}
7981
{
8082
}

0 commit comments

Comments
 (0)