From 37b6b6c5146b594306223e5376035997a9b9a78e Mon Sep 17 00:00:00 2001 From: as-ascii <62467072+as-ascii@users.noreply.github.com> Date: Tue, 23 Jan 2024 14:23:28 +0100 Subject: [PATCH 1/8] Add arm64-osx-dynamic triplet to continuous integration to support Apple Silicon platforms (M1, M2, M3 etc) --- .github/workflows/build.yml | 22 ++++++++++++++++++++-- doc/ChangeLog | 1 + 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae00bfaa..fb12cbdf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,22 +5,40 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, windows-2019, macos-12] - triplet: [x64-linux-dynamic, x64-windows, x64-osx-dynamic] + os: [ubuntu-22.04, windows-2019, macos-12, flyci-macos-large-latest-m1] + triplet: [x64-linux-dynamic, x64-windows, x64-osx-dynamic, arm64-osx-dynamic] sanitizer: ["", "address", "thread"] exclude: - os: ubuntu-22.04 triplet: x64-windows - os: ubuntu-22.04 triplet: x64-osx-dynamic + - os: ubuntu-22.04 + triplet: arm64-osx-dynamic - os: windows-2019 triplet: x64-linux-dynamic - os: windows-2019 triplet: x64-osx-dynamic + - os: windows-2019 + triplet: arm64-osx-dynamic - os: macos-12 triplet: x64-linux-dynamic - os: macos-12 triplet: x64-windows + - os: macos-12 + triplet: arm64-osx-dynamic + - os: flyci-macos-large-latest-m1 + triplet: x64-linux-dynamic + - os: flyci-macos-large-latest-m1 + triplet: x64-windows + - os: flyci-macos-large-latest-m1 + triplet: x64-osx-dynamic + - os: flyci-macos-large-latest-m1 + triplet: amd64-osx-dynamic + sanitizer: address + - os: flyci-macos-large-latest-m1 + triplet: amd64-osx-dynamic + sanitizer: thread name: ${{ matrix.triplet }}${{ matrix.sanitizer != '' && format('-{0}-sanitizer', matrix.sanitizer) || '' }} runs-on: ${{ matrix.os }} timeout-minutes: 150 diff --git a/doc/ChangeLog b/doc/ChangeLog index fdeddd6b..530d4259 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -11,6 +11,7 @@ - Introduce github actions strategy matrix for CI jobs - Enable Address and Thread sanitizers on all platforms - Enable Address and Thread sanitizers in release builds when vcpkg port sanitizers feature flags are enabled +- Add arm64-osx-dynamic triplet to continuous integration to support Apple Silicon platforms (M1, M2, M3 etc) ## Version 2024.01.05 From 22b3d1410490095f85a64a1ddd0c29e1a42cbc42 Mon Sep 17 00:00:00 2001 From: as-ascii <62467072+as-ascii@users.noreply.github.com> Date: Tue, 23 Jan 2024 14:38:25 +0100 Subject: [PATCH 2/8] Add architecture detection and update triplet on OSX platform --- build.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 2517217e..f6b2e386 100755 --- a/build.sh +++ b/build.sh @@ -26,7 +26,10 @@ fi cd .. if [[ "$OSTYPE" == "darwin"* ]]; then - VCPKG_TRIPLET=x64-osx-dynamic + if [[ $(arch) == 'arm64' ]]; + VCPKG_TRIPLET=amd64-osx-dynamic + else + VCPKG_TRIPLET=x64-osx-dynamic else VCPKG_TRIPLET=x64-linux-dynamic fi From 3c9e3490e08c32b88de9c3c5aa990b301feee5ae Mon Sep 17 00:00:00 2001 From: as-ascii <62467072+as-ascii@users.noreply.github.com> Date: Tue, 23 Jan 2024 14:48:32 +0100 Subject: [PATCH 3/8] Fix temporary sanitizers exclusion for arm64-osx-dynamic in github CI --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb12cbdf..22b08b12 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,10 +34,10 @@ jobs: - os: flyci-macos-large-latest-m1 triplet: x64-osx-dynamic - os: flyci-macos-large-latest-m1 - triplet: amd64-osx-dynamic + triplet: arm64-osx-dynamic sanitizer: address - os: flyci-macos-large-latest-m1 - triplet: amd64-osx-dynamic + triplet: arm64-osx-dynamic sanitizer: thread name: ${{ matrix.triplet }}${{ matrix.sanitizer != '' && format('-{0}-sanitizer', matrix.sanitizer) || '' }} runs-on: ${{ matrix.os }} From 954f42ce847193d674a110f921659067c46e3bf4 Mon Sep 17 00:00:00 2001 From: as-ascii <62467072+as-ascii@users.noreply.github.com> Date: Tue, 23 Jan 2024 14:55:41 +0100 Subject: [PATCH 4/8] Fix syntax errors in build.sh --- build.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index f6b2e386..ab0e7873 100755 --- a/build.sh +++ b/build.sh @@ -26,10 +26,11 @@ fi cd .. if [[ "$OSTYPE" == "darwin"* ]]; then - if [[ $(arch) == 'arm64' ]]; - VCPKG_TRIPLET=amd64-osx-dynamic + if [[ $(arch) == 'arm64' ]]; then + VCPKG_TRIPLET=arm64-osx-dynamic else VCPKG_TRIPLET=x64-osx-dynamic + fi else VCPKG_TRIPLET=x64-linux-dynamic fi From 8ed0411cba9233040743cfa59d360253461c2a59 Mon Sep 17 00:00:00 2001 From: as-ascii <62467072+as-ascii@users.noreply.github.com> Date: Wed, 24 Jan 2024 00:36:30 +0100 Subject: [PATCH 5/8] Add normalization of end of nested template symbol logging --- src/log.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/log.cpp b/src/log.cpp index e986130c..ec1da714 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -86,6 +86,7 @@ namespace boost::algorithm::erase_all(normalized, "struct "); boost::algorithm::replace_all(normalized, "(void)", "()"); boost::algorithm::replace_all(normalized, ", ", ","); + boost::algorithm::replace_all(normalized, "> >", ">>"); return normalized; } } // anonymous namespace From 81571c6904c4b6f789434f08f04e45dd1868f087 Mon Sep 17 00:00:00 2001 From: as-ascii <62467072+as-ascii@users.noreply.github.com> Date: Wed, 24 Jan 2024 01:22:16 +0100 Subject: [PATCH 6/8] Fix end of nested template symbol in logging automatic test --- tests/logging_dereferenceable.out.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/logging_dereferenceable.out.json b/tests/logging_dereferenceable.out.json index 04e2b119..f5585ca4 100644 --- a/tests/logging_dereferenceable.out.json +++ b/tests/logging_dereferenceable.out.json @@ -1,7 +1,7 @@ [ {"timestamp":"","severity":"debug","file":"api_tests.cpp","line":"","function":"void Logging_Dereferenceable_Test::TestBody()","thread_id":"","log":{"typeid":"std::optional","dereferenced":1}}, {"timestamp":"","severity":"debug","file":"api_tests.cpp","line":"","function":"void Logging_Dereferenceable_Test::TestBody()","thread_id":"","log":null}, -{"timestamp":"","severity":"debug","file":"api_tests.cpp","line":"","function":"void Logging_Dereferenceable_Test::TestBody()","thread_id":"","log":{"typeid":"std::unique_ptr >","dereferenced":1}}, +{"timestamp":"","severity":"debug","file":"api_tests.cpp","line":"","function":"void Logging_Dereferenceable_Test::TestBody()","thread_id":"","log":{"typeid":"std::unique_ptr>","dereferenced":1}}, {"timestamp":"","severity":"debug","file":"api_tests.cpp","line":"","function":"void Logging_Dereferenceable_Test::TestBody()","thread_id":"","log":null}, {"timestamp":"","severity":"debug","file":"api_tests.cpp","line":"","function":"void Logging_Dereferenceable_Test::TestBody()","thread_id":"","log":{"typeid":"std::shared_ptr","dereferenced":1}}, {"timestamp":"","severity":"debug","file":"api_tests.cpp","line":"","function":"void Logging_Dereferenceable_Test::TestBody()","thread_id":"","log":null} From fbff08cb263f0d53f9b37b0b03d658504a8e81f8 Mon Sep 17 00:00:00 2001 From: as-ascii <62467072+as-ascii@users.noreply.github.com> Date: Thu, 25 Jan 2024 01:39:11 +0100 Subject: [PATCH 7/8] Reenable sanitizers in arm64-osx-dynamic CI --- .github/workflows/build.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 22b08b12..45dd0101 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,12 +33,6 @@ jobs: triplet: x64-windows - os: flyci-macos-large-latest-m1 triplet: x64-osx-dynamic - - os: flyci-macos-large-latest-m1 - triplet: arm64-osx-dynamic - sanitizer: address - - os: flyci-macos-large-latest-m1 - triplet: arm64-osx-dynamic - sanitizer: thread name: ${{ matrix.triplet }}${{ matrix.sanitizer != '' && format('-{0}-sanitizer', matrix.sanitizer) || '' }} runs-on: ${{ matrix.os }} timeout-minutes: 150 From 96c4dac036232b4d09dd00d3e02404d67acc2d9b Mon Sep 17 00:00:00 2001 From: as-ascii <62467072+as-ascii@users.noreply.github.com> Date: Thu, 25 Jan 2024 01:49:34 +0100 Subject: [PATCH 8/8] Update documentation - add arm64-osx-dynamic triplet --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5247dea4..71ece6aa 100644 --- a/README.md +++ b/README.md @@ -482,9 +482,9 @@ vcpkg overlay add docwire/ports This command ensures that vcpkg adds the DocWire overlay for subsequent installations. 5. **Install DocWire:** -Now that the overlay is set up, you can use vcpkg to install the DocWire library: +Now that the overlay is set up, you can use vcpkg to install the DocWire library (see compatibility note for supported platforms/triplets): ``` -vcpkg install docwire +vcpkg install docwire:x64-linux-dynamic ``` 6. **Download Binary Archives (Alternative):** As an alternative to building from source, users can also download pre-built binary archives that contain the results of the vcpkg export command for DocWire. These archives can be found in the "Releases" section of the DocWire GitHub repository. @@ -503,7 +503,7 @@ cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake .. You're all set! You've successfully installed the DocWire library using vcpkg. You can now use the DocWire library in your code to perform text extraction from documents. ### Compatibility Note -Please note that DocWire is currently compatible with vcpkg tagged as version 2023.11.20. While this version is recommended for use, be aware that updates may become available in the near future. Supported triplets are: x64-linux-dynamic, x64-windows and x64-osx-dynamic. +Please note that DocWire is currently compatible with vcpkg tagged as version 2023.11.20. While this version is recommended for use, be aware that updates may become available in the near future. Supported triplets are: x64-linux-dynamic, x64-windows, x64-osx-dynamic and arm64-osx-dynamic. ## Versioning