Skip to content

Commit 328b63c

Browse files
leoparenteclaude
andcommitted
fix: address PR review comments and fix remaining CI failures
- Replace broken patch file with replace_in_file() in conanfile.py for the musl strerror_r fix — patch-ng context lines were at wrong offset; replace_in_file does an exact string search and is more robust - Add #include <Corrade/Containers/StringStl.h> to AbstractPlugin.cpp and Policies.cpp — both use std::string(plugin()) / std::string(StringView) but were missing the header that provides the STL interop conversion Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 1b7698c commit 328b63c

5 files changed

Lines changed: 12 additions & 19 deletions

File tree

conan/corrade/conandata.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,3 @@ sources:
22
"cci.20260327":
33
sha256: d8f30e9a857172003b6b02304783f40e8038c36e4127a0cfec7fe14f41c13fd4
44
url: https://github.com/mosra/corrade/archive/22e7ffc6fcdeaa0df96e0d8b3d482ad6abe7dc36.tar.gz
5-
6-
patches:
7-
"cci.20260327":
8-
- patch_file: "patches/0001-fix-strerror_r-musl-compat.patch"
9-
patch_description: "Fix strerror_r usage for non-glibc Linux (musl): always use POSIX XSI variant"
10-
patch_type: "portability"

conan/corrade/conanfile.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from conan.errors import ConanInvalidConfiguration
55
from conan.tools.build import cross_building
66
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
7+
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir
88
from conan.tools.microsoft import is_msvc, check_min_vs
99

1010
required_conan_version = ">=2.0"
@@ -71,6 +71,15 @@ def build_requirements(self):
7171

7272
def source(self):
7373
get(self, **self.conan_data["sources"][self.version], strip_root=True)
74+
# Fix strerror_r for non-glibc Linux (e.g. musl): always use POSIX XSI variant.
75+
# GCC defines _GNU_SOURCE on Linux even for musl targets, so Corrade's preprocessor
76+
# condition falls into the GNU branch (char* strerror_r) which musl doesn't provide.
77+
replace_in_file(
78+
self,
79+
os.path.join(self.source_folder, "src/Corrade/Utility/Implementation/ErrorString.cpp"),
80+
"#if ((_POSIX_C_SOURCE >= 200112L) && !_GNU_SOURCE) || defined(CORRADE_TARGET_EMSCRIPTEN) || defined(CORRADE_TARGET_APPLE) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)",
81+
"#if ((_POSIX_C_SOURCE >= 200112L) && !_GNU_SOURCE) || defined(CORRADE_TARGET_EMSCRIPTEN) || defined(CORRADE_TARGET_APPLE) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || (defined(__linux__) && !defined(__GLIBC__))",
82+
)
7483

7584
def generate(self):
7685
tc = CMakeToolchain(self)

conan/corrade/patches/0001-fix-strerror_r-musl-compat.patch

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/AbstractPlugin.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
44

55
#include "AbstractPlugin.h"
6+
#include <Corrade/Containers/StringStl.h>
67
#include <fmt/format.h>
78
#include <regex>
89

src/Policies.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
44

55
#include "Policies.h"
6+
#include <Corrade/Containers/StringStl.h>
67
#include "CoreRegistry.h"
78
#include "HandlerManager.h"
89
#include "InputStreamManager.h"

0 commit comments

Comments
 (0)