From f9d5f416eceab8a74947c826a8d6a6211780a874 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Thu, 12 Dec 2024 16:08:22 +0100 Subject: [PATCH 1/5] fmt does not support c++20 emscripten Signed-off-by: Uilian Ries --- recipes/fmt/all/conanfile.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/recipes/fmt/all/conanfile.py b/recipes/fmt/all/conanfile.py index 86da321d03862..20749a88e66f9 100644 --- a/recipes/fmt/all/conanfile.py +++ b/recipes/fmt/all/conanfile.py @@ -7,6 +7,7 @@ from conan.tools.build import check_min_cppstd from conan.tools.scm import Version from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration required_conan_version = ">=1.53.0" @@ -81,6 +82,11 @@ def package_id(self): def validate(self): if self.settings.get_safe("compiler.cppstd"): check_min_cppstd(self, 11) + if self.settings.os == "Emscripten" and "20" in str(self.settings.compiler.cppstd): + # INFO: https://github.com/conan-io/conan-center-index/issues/26169 + # Confirmed by upstream: https://github.com/fmtlib/fmt/issues/4177 + # TODO: Revisit after be fixed in the upstream. There is no milestone for this hotfix. + raise ConanInvalidConfiguration(f"Emscripten with C++20 is not supported by fmt, please use C++17 instead. See https://github.com/fmtlib/fmt/issues/4177") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) From 4e8e33310631277167cc166ebe54045577360e0a Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 13 Dec 2024 08:40:55 +0100 Subject: [PATCH 2/5] Do not support clang 20 for now Signed-off-by: Uilian Ries --- recipes/fmt/all/conanfile.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/recipes/fmt/all/conanfile.py b/recipes/fmt/all/conanfile.py index 20749a88e66f9..261949634d729 100644 --- a/recipes/fmt/all/conanfile.py +++ b/recipes/fmt/all/conanfile.py @@ -82,11 +82,12 @@ def package_id(self): def validate(self): if self.settings.get_safe("compiler.cppstd"): check_min_cppstd(self, 11) - if self.settings.os == "Emscripten" and "20" in str(self.settings.compiler.cppstd): - # INFO: https://github.com/conan-io/conan-center-index/issues/26169 - # Confirmed by upstream: https://github.com/fmtlib/fmt/issues/4177 - # TODO: Revisit after be fixed in the upstream. There is no milestone for this hotfix. - raise ConanInvalidConfiguration(f"Emscripten with C++20 is not supported by fmt, please use C++17 instead. See https://github.com/fmtlib/fmt/issues/4177") + if Version(self.version) <= "11.0.2" and self.settings.compiler == "clang" and Version(self.settings.compiler.version) >= "20": + # INFO: https://github.com/fmtlib/fmt/issues/4177 + # Partially fixed by: https://github.com/fmtlib/fmt/commit/cacc3108c5b74020dba7bf3c6d3a7e58cdc085b2 + # Completely fixed by: https://github.com/fmtlib/fmt/pull/4187 + # TODO: Revisit after be released a new version of fmt + raise ConanInvalidConfiguration(f"FMT does not support Clang 20 for now, please use Clang 19 or earlier. See https://github.com/fmtlib/fmt/issues/4177") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) From 88ad94325d9d689a9c216f7d9b25d0f60a0e5a25 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 13 Dec 2024 08:51:33 +0100 Subject: [PATCH 3/5] Target only specific major versions Signed-off-by: Uilian Ries --- recipes/fmt/all/conanfile.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/recipes/fmt/all/conanfile.py b/recipes/fmt/all/conanfile.py index 261949634d729..f2b075bc28051 100644 --- a/recipes/fmt/all/conanfile.py +++ b/recipes/fmt/all/conanfile.py @@ -82,12 +82,13 @@ def package_id(self): def validate(self): if self.settings.get_safe("compiler.cppstd"): check_min_cppstd(self, 11) - if Version(self.version) <= "11.0.2" and self.settings.compiler == "clang" and Version(self.settings.compiler.version) >= "20": + if Version(self.version).major in (8, 10, 11) and \ + self.settings.compiler == "clang" and Version(self.settings.compiler.version) >= "20": # INFO: https://github.com/fmtlib/fmt/issues/4177 # Partially fixed by: https://github.com/fmtlib/fmt/commit/cacc3108c5b74020dba7bf3c6d3a7e58cdc085b2 # Completely fixed by: https://github.com/fmtlib/fmt/pull/4187 # TODO: Revisit after be released a new version of fmt - raise ConanInvalidConfiguration(f"FMT does not support Clang 20 for now, please use Clang 19 or earlier. See https://github.com/fmtlib/fmt/issues/4177") + raise ConanInvalidConfiguration(f"This version of FMT does not currently support Clang 20; please use Clang 19 or an earlier version. See https://github.com/fmtlib/fmt/issues/4177") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) From 456cf69cd09c71894c5500766757b9dbfad70a29 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 13 Dec 2024 09:38:54 +0100 Subject: [PATCH 4/5] Restrict support only for cppstd >=20 Signed-off-by: Uilian Ries --- recipes/fmt/all/conanfile.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/recipes/fmt/all/conanfile.py b/recipes/fmt/all/conanfile.py index f2b075bc28051..0f2b9a6c82962 100644 --- a/recipes/fmt/all/conanfile.py +++ b/recipes/fmt/all/conanfile.py @@ -83,12 +83,13 @@ def validate(self): if self.settings.get_safe("compiler.cppstd"): check_min_cppstd(self, 11) if Version(self.version).major in (8, 10, 11) and \ - self.settings.compiler == "clang" and Version(self.settings.compiler.version) >= "20": + self.settings.compiler == "clang" and Version(self.settings.compiler.version) >= "20" and \ + Version(str(self.settings.compiler.cppstd).replace("gnu", "")) >= "20": # INFO: https://github.com/fmtlib/fmt/issues/4177 # Partially fixed by: https://github.com/fmtlib/fmt/commit/cacc3108c5b74020dba7bf3c6d3a7e58cdc085b2 # Completely fixed by: https://github.com/fmtlib/fmt/pull/4187 # TODO: Revisit after be released a new version of fmt - raise ConanInvalidConfiguration(f"This version of FMT does not currently support Clang 20; please use Clang 19 or an earlier version. See https://github.com/fmtlib/fmt/issues/4177") + raise ConanInvalidConfiguration(f"This version of FMT does not currently support Clang 20 with C++20; please use -s compiler.cppstd=17. See https://github.com/fmtlib/fmt/issues/4177") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) From dd53efb50d6568695c1b8be6235445a150bbb8c5 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Sun, 15 Dec 2024 10:15:54 +0100 Subject: [PATCH 5/5] Use valid_max_cppstd Signed-off-by: Uilian Ries --- recipes/fmt/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/fmt/all/conanfile.py b/recipes/fmt/all/conanfile.py index 0f2b9a6c82962..80324996850fd 100644 --- a/recipes/fmt/all/conanfile.py +++ b/recipes/fmt/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.layout import basic_layout -from conan.tools.build import check_min_cppstd +from conan.tools.build import check_min_cppstd, valid_max_cppstd from conan.tools.scm import Version from conan.tools.microsoft import is_msvc from conan.errors import ConanInvalidConfiguration @@ -84,7 +84,7 @@ def validate(self): check_min_cppstd(self, 11) if Version(self.version).major in (8, 10, 11) and \ self.settings.compiler == "clang" and Version(self.settings.compiler.version) >= "20" and \ - Version(str(self.settings.compiler.cppstd).replace("gnu", "")) >= "20": + not valid_max_cppstd(self, 20): # INFO: https://github.com/fmtlib/fmt/issues/4177 # Partially fixed by: https://github.com/fmtlib/fmt/commit/cacc3108c5b74020dba7bf3c6d3a7e58cdc085b2 # Completely fixed by: https://github.com/fmtlib/fmt/pull/4187