From 018cc0a1d0b5eaaff06cd1b28c553c4b72a6498f Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Fri, 19 Jun 2026 16:45:06 -0400 Subject: [PATCH 1/2] Upgrade Core to `1b3ab73db3f0a4dfe0e1ee1e59601a81bfe100fe` Signed-off-by: Juan Cruz Viotti --- DEPENDENCIES | 2 +- vendor/core/src/core/crypto/crypto_crc32.cc | 34 ++++++++++++++-- .../src/lang/io/include/sourcemeta/core/io.h | 15 +++++++ vendor/core/src/lang/io/io.cc | 39 +++++++++++-------- 4 files changed, 70 insertions(+), 20 deletions(-) diff --git a/DEPENDENCIES b/DEPENDENCIES index 7947a872..5cf6e298 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -1,4 +1,4 @@ vendorpull https://github.com/sourcemeta/vendorpull 1dcbac42809cf87cb5b045106b863e17ad84ba02 -core https://github.com/sourcemeta/core bb1c78e8fa148a2ece951bb776798a43fe328821 +core https://github.com/sourcemeta/core 1b3ab73db3f0a4dfe0e1ee1e59601a81bfe100fe blaze https://github.com/sourcemeta/blaze 04832d45bf4327d4ec874fa67f339797cd49b375 bootstrap https://github.com/twbs/bootstrap 1a6fdfae6be09b09eaced8f0e442ca6f7680a61e diff --git a/vendor/core/src/core/crypto/crypto_crc32.cc b/vendor/core/src/core/crypto/crypto_crc32.cc index d2861560..d6c57040 100644 --- a/vendor/core/src/core/crypto/crypto_crc32.cc +++ b/vendor/core/src/core/crypto/crypto_crc32.cc @@ -11,10 +11,38 @@ // feature macro that the compiler sets when the right -march or -mcpu is in // effect #if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) -#include // __crc32b, __crc32d #define SOURCEMETA_CORE_CRYPTO_CRC32_ARM 1 #endif +// The CRC32 operations are reached through compiler builtins rather than the +// intrinsics. On aarch64-apple-darwin, GCC's header fails to +// compile under warnings-as-errors because of unrelated random number +// intrinsics whose inline bodies pass a pointer of the wrong width, and merely +// including the header type-checks those bodies even though we never call them +#ifdef SOURCEMETA_CORE_CRYPTO_CRC32_ARM +namespace { + +auto crc32_hardware_word(const std::uint32_t checksum, + const std::uint64_t value) noexcept -> std::uint32_t { +#if defined(__clang__) + return __builtin_arm_crc32d(checksum, value); +#else + return __builtin_aarch64_crc32x(checksum, value); +#endif +} + +auto crc32_hardware_byte(const std::uint32_t checksum, + const std::uint8_t value) noexcept -> std::uint32_t { +#if defined(__clang__) + return __builtin_arm_crc32b(checksum, value); +#else + return __builtin_aarch64_crc32b(checksum, value); +#endif +} + +} // namespace +#endif + #ifndef SOURCEMETA_CORE_CRYPTO_CRC32_ARM namespace { @@ -68,12 +96,12 @@ auto crc32_update(const std::uint32_t previous, const std::string_view input) while (remaining >= 8) { std::uint64_t chunk{0}; std::memcpy(&chunk, data, sizeof(chunk)); - checksum = __crc32d(checksum, chunk); + checksum = crc32_hardware_word(checksum, chunk); data += 8; remaining -= 8; } while (remaining > 0) { - checksum = __crc32b(checksum, *data++); + checksum = crc32_hardware_byte(checksum, *data++); --remaining; } return checksum ^ 0xFFFFFFFFu; diff --git a/vendor/core/src/lang/io/include/sourcemeta/core/io.h b/vendor/core/src/lang/io/include/sourcemeta/core/io.h index 771b4d0b..fb2736f7 100644 --- a/vendor/core/src/lang/io/include/sourcemeta/core/io.h +++ b/vendor/core/src/lang/io/include/sourcemeta/core/io.h @@ -85,6 +85,21 @@ SOURCEMETA_CORE_IO_EXPORT auto is_under_path(const std::filesystem::path &path, const std::filesystem::path &prefix) -> bool; +/// @ingroup io +/// +/// Check whether a path lies under another path lexically, comparing component +/// by component without resolving against the filesystem. For example: +/// +/// ```cpp +/// #include +/// #include +/// +/// assert(sourcemeta::core::is_lexically_under_path("foo/bar/baz", "foo")); +/// ``` +SOURCEMETA_CORE_IO_EXPORT +auto is_lexically_under_path(const std::filesystem::path &path, + const std::filesystem::path &prefix) -> bool; + /// @ingroup io /// /// Return the portion of a path that follows a given prefix, or the path diff --git a/vendor/core/src/lang/io/io.cc b/vendor/core/src/lang/io/io.cc index 6bf742ea..322e7967 100644 --- a/vendor/core/src/lang/io/io.cc +++ b/vendor/core/src/lang/io/io.cc @@ -84,6 +84,23 @@ auto normalize(const std::filesystem::path &canonical_path) return normalized; } +auto path_components_cover(const std::filesystem::path &path, + const std::filesystem::path &prefix) -> bool { + auto path_iterator{path.begin()}; + auto prefix_iterator{prefix.begin()}; + + while (prefix_iterator != prefix.end()) { + if (path_iterator == path.end() || *path_iterator != *prefix_iterator) { + return false; + } + + ++path_iterator; + ++prefix_iterator; + } + + return true; +} + } // namespace namespace sourcemeta::core { @@ -133,23 +150,13 @@ auto weakly_canonical(const std::filesystem::path &path) auto is_under_path(const std::filesystem::path &path, const std::filesystem::path &prefix) -> bool { - const auto canonical_path{sourcemeta::core::weakly_canonical(path)}; - const auto canonical_prefix{sourcemeta::core::weakly_canonical(prefix)}; - - auto path_iterator{canonical_path.begin()}; - auto prefix_iterator{canonical_prefix.begin()}; - - while (prefix_iterator != canonical_prefix.end()) { - if (path_iterator == canonical_path.end() || - *path_iterator != *prefix_iterator) { - return false; - } - - ++path_iterator; - ++prefix_iterator; - } + return path_components_cover(sourcemeta::core::weakly_canonical(path), + sourcemeta::core::weakly_canonical(prefix)); +} - return true; +auto is_lexically_under_path(const std::filesystem::path &path, + const std::filesystem::path &prefix) -> bool { + return path_components_cover(normalize(path), normalize(prefix)); } auto strip_path_prefix(const std::filesystem::path &path, From 5934292eb76f47aad5139651e6d4854057b75c97 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Fri, 19 Jun 2026 16:56:54 -0400 Subject: [PATCH 2/2] No CI Signed-off-by: Juan Cruz Viotti --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5f15cdc..92b38532 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,10 +23,6 @@ jobs: cc: clang cxx: clang++ type: shared - - os: macos-latest - cc: gcc-13 - cxx: g++-13 - type: static - os: ubuntu-latest cc: clang cxx: clang++