From cd5ee3b773e59d26a2d0dad6130c98f11d95d11c Mon Sep 17 00:00:00 2001 From: Roth Michaels Date: Mon, 21 Apr 2025 16:30:33 -0400 Subject: [PATCH 1/3] Revert "build: disable apple-clang-15 builds until the crash is fixed" This reverts commit c2672c069bf3757a3deef7e7157bdbac4e595836. --- .github/generate-job-matrix.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/generate-job-matrix.py b/.github/generate-job-matrix.py index 83e4f362..4c387a14 100644 --- a/.github/generate-job-matrix.py +++ b/.github/generate-job-matrix.py @@ -97,11 +97,10 @@ configs = { # arm64 runners are expensive; only consider one version if ver == 18 or platform != "arm64" ] - # TODO uncomment the below when apple-clang-15 crash is fixed - # + [ - # make_apple_clang_config("macos-13", ver, std_format_support=False) - # for ver in ["15.2"] - # ] + + [ + make_apple_clang_config("macos-13", ver, std_format_support=False) + for ver in ["15.2"] + ] # std::format is available in Xcode 16.1 or later + [ make_apple_clang_config("macos-14", ver, std_format_support=True) From 2e7f25a7822723f6f8d38d4851dc5538643fa5e6 Mon Sep 17 00:00:00 2001 From: Roth Michaels Date: Mon, 21 Apr 2025 16:31:23 -0400 Subject: [PATCH 2/3] Revert "fix: appleclang-15 timeout on compilation workaround" This reverts commit 7d340d90988c60f72034e8afdb457bb6529d0636. This fix was causing the following error: ``` fatal error: error in backend: SmallVector unable to grow. ``` --- .../framework/representation_concepts.h | 47 +++++++++++-------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/src/core/include/mp-units/framework/representation_concepts.h b/src/core/include/mp-units/framework/representation_concepts.h index 3d2cfbf5..69668c74 100644 --- a/src/core/include/mp-units/framework/representation_concepts.h +++ b/src/core/include/mp-units/framework/representation_concepts.h @@ -44,12 +44,7 @@ namespace mp_units { namespace detail { template -concept WeaklyRegular = -#ifndef MP_UNITS_XCODE15_HACKS - true; -#else - std::copyable && std::equality_comparable; -#endif +concept WeaklyRegular = std::copyable && std::equality_comparable; template concept ScalableWith = requires(const T v, const S s) { @@ -175,13 +170,18 @@ template concept ComplexScalar = // TODO should the below be provided? // (!disable_complex) && - Addable && ScalableWith && requires(const T v, const T& ref) { + Addable && ScalableWith && + requires(const T v, const T& ref) { ::mp_units::real(v); ::mp_units::imag(v); ::mp_units::modulus(v); requires ScalableWith; requires std::constructible_from; - } && WeaklyRegular; + } +#ifndef MP_UNITS_XCODE15_HACKS + && WeaklyRegular +#endif + ; } // namespace detail @@ -197,8 +197,12 @@ MP_UNITS_INLINE constexpr bool disable_real = true; namespace detail { template -concept RealScalar = (!disable_real) && Addable && ScalableWith && std::totally_ordered && - (!ComplexScalar) && WeaklyRegular; +concept RealScalar = + (!disable_real) && Addable && ScalableWith && std::totally_ordered && (!ComplexScalar) +#if MP_UNITS_COMP_GCC != 12 && !defined(MP_UNITS_XCODE15_HACKS) + && WeaklyRegular +#endif + ; template concept Scalar = RealScalar || ComplexScalar; @@ -250,15 +254,20 @@ MP_UNITS_EXPORT inline constexpr ::mp_units::detail::magnitude_impl::magnitude_t namespace detail { template -concept Vector = Addable && requires(const T v) { - ::mp_units::magnitude(v); - requires ScalableWith; - // TODO should we also check for the below (e.g., when `size() > 1` or `2`) - // ::mp_units::zero_vector(); - // ::mp_units::scalar_product(a, b); - // ::mp_units::vector_product(a, b); - // ::mp_units::tensor_product(a, b); -} && WeaklyRegular; +concept Vector = Addable && + requires(const T v) { + ::mp_units::magnitude(v); + requires ScalableWith; + // TODO should we also check for the below (e.g., when `size() > 1` or `2`) + // ::mp_units::zero_vector(); + // ::mp_units::scalar_product(a, b); + // ::mp_units::vector_product(a, b); + // ::mp_units::tensor_product(a, b); + } +#ifndef MP_UNITS_XCODE15_HACKS + && WeaklyRegular +#endif + ; } // namespace detail From dc47ac32df9d9509579e7909d4d966d435a88dd9 Mon Sep 17 00:00:00 2001 From: Roth Michaels Date: Mon, 21 Apr 2025 16:31:52 -0400 Subject: [PATCH 3/3] Fix for long Xcode 15 build time after removing Representation concept For some reason this new implementation of `RepresentationOf` was causing long build times again in the Kalman fiter examples. I'm not sure why this is and if we should keep the old implemention only for Xcode 15 or if we should revert this implementation change in general. --- .../mp-units/framework/representation_concepts.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/core/include/mp-units/framework/representation_concepts.h b/src/core/include/mp-units/framework/representation_concepts.h index 69668c74..44cbf4a3 100644 --- a/src/core/include/mp-units/framework/representation_concepts.h +++ b/src/core/include/mp-units/framework/representation_concepts.h @@ -340,11 +340,22 @@ concept SomeRepresentation = } // namespace detail +#ifdef MP_UNITS_XCODE15_HACKS +MP_UNITS_EXPORT template +concept RepresentationOf = + detail::SomeRepresentation && + ((QuantitySpec && + (detail::QuantityKindSpec || detail::IsOfCharacter)) || + (std::same_as && detail::IsOfCharacter)); + +#else + MP_UNITS_EXPORT template concept RepresentationOf = ((QuantitySpec && ((detail::QuantityKindSpec && detail::SomeRepresentation) || detail::IsOfCharacter)) || (std::same_as && detail::IsOfCharacter)); +#endif } // namespace mp_units