diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index f4e5685a4..dfaa9be28 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -11,9 +11,9 @@ on: jobs: windows: name: Windows memory mapped - uses: mapnik/mapnik/.github/workflows/windows.yml@master + uses: ./.github/workflows/windows.yml with: - VCPKG_SHA: 2e34a79a814551424d9b1a981b3b110e0a8fbdfd + VCPKG_SHA: f6af75acc923c833a5620943e3fc7d5e4930f0df NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json NUGET_USERNAME: mapnik USE_MEMORY_MAPPED_FILE: 'ON' @@ -22,9 +22,9 @@ jobs: windows-mmf-off: name: Windows file based - uses: mapnik/mapnik/.github/workflows/windows.yml@master + uses: ./.github/workflows/windows.yml with: - VCPKG_SHA: 2e34a79a814551424d9b1a981b3b110e0a8fbdfd + VCPKG_SHA: f6af75acc923c833a5620943e3fc7d5e4930f0df NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json NUGET_USERNAME: mapnik USE_MEMORY_MAPPED_FILE: 'OFF' @@ -33,9 +33,9 @@ jobs: ubuntu: name: Linux memory mapped - uses: mapnik/mapnik/.github/workflows/ubuntu.yml@master + uses: ./.github/workflows/ubuntu.yml with: - VCPKG_SHA: 2e34a79a814551424d9b1a981b3b110e0a8fbdfd + VCPKG_SHA: f6af75acc923c833a5620943e3fc7d5e4930f0df NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json NUGET_USERNAME: mapnik USE_MEMORY_MAPPED_FILE: 'ON' @@ -44,9 +44,9 @@ jobs: ubuntu-mmf-off: name: Linux file based - uses: mapnik/mapnik/.github/workflows/ubuntu.yml@master + uses: ./.github/workflows/ubuntu.yml with: - VCPKG_SHA: 2e34a79a814551424d9b1a981b3b110e0a8fbdfd + VCPKG_SHA: f6af75acc923c833a5620943e3fc7d5e4930f0df NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json NUGET_USERNAME: mapnik USE_MEMORY_MAPPED_FILE: 'OFF' @@ -55,9 +55,9 @@ jobs: macos: name: MacOS memory mapped - uses: mapnik/mapnik/.github/workflows/macos.yml@master + uses: ./.github/workflows/macos.yml with: - VCPKG_SHA: 2e34a79a814551424d9b1a981b3b110e0a8fbdfd + VCPKG_SHA: f6af75acc923c833a5620943e3fc7d5e4930f0df NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json NUGET_USERNAME: mapnik USE_MEMORY_MAPPED_FILE: 'ON' @@ -66,9 +66,9 @@ jobs: macos-mmf-off: name: MacOS file based - uses: mapnik/mapnik/.github/workflows/macos.yml@master + uses: ./.github/workflows/macos.yml with: - VCPKG_SHA: 2e34a79a814551424d9b1a981b3b110e0a8fbdfd + VCPKG_SHA: f6af75acc923c833a5620943e3fc7d5e4930f0df NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json NUGET_USERNAME: mapnik USE_MEMORY_MAPPED_FILE: 'OFF' diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index a9dbd5fb1..092d10c45 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -35,12 +35,12 @@ jobs: brew install automake ninja lcov - name: checkout mapnik - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: "recursive" - name: checkout vcpkg - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: "microsoft/vcpkg" ref: ${{ inputs.VCPKG_SHA }} @@ -89,7 +89,7 @@ jobs: setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "${{ inputs.NUGET_REGISTRY }}" - name: Configure CMake - run: cmake -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake -DUSE_MEMORY_MAPPED_FILE=${{ inputs.USE_MEMORY_MAPPED_FILE }} --preset=${{ env.preset }} + run: cmake -DUSE_MEMORY_MAPPED_FILE=${{ inputs.USE_MEMORY_MAPPED_FILE }} --preset=${{ env.preset }} - name: Build run: cmake --build --preset ${{ env.preset }} @@ -101,7 +101,7 @@ jobs: continue-on-error: true working-directory: build/${{ env.preset }}/out env: - PROJ_LIB: ${{ github.workspace }}/build/${{ env.preset }}/vcpkg_installed/x64-osx/share/proj4 + PROJ_LIB: ${{ github.workspace }}/build/${{ env.preset }}/vcpkg_installed/x64-osx/share/proj/data run: ./mapnik-test-visual -j $(sysctl -n hw.logicalcpu) --output-dir ./visual-test-result - name: Pack visual test results @@ -111,7 +111,7 @@ jobs: - name: Run Benchmark working-directory: build/${{ env.preset }}/out env: - PROJ_LIB: ${{ github.workspace }}/build/${{ env.preset }}/vcpkg_installed/x64-osx/share/proj4 + PROJ_LIB: ${{ github.workspace }}/build/${{ env.preset }}/vcpkg_installed/x64-osx/share/proj/data run: ./run_benchmarks - name: Coverage @@ -131,7 +131,7 @@ jobs: run: cmake --build --preset ${{ env.preset }} --target package - name: Upload mapnik build artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 if: failure() with: name: ${{ env.preset }}-mmio-${{ inputs.USE_MEMORY_MAPPED_FILE }} @@ -139,7 +139,7 @@ jobs: retention-days: 2 - name: Upload visual test results - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: ${{ env.preset }}-visual-tests-mmio-${{ inputs.USE_MEMORY_MAPPED_FILE }} path: build/${{ env.preset }}/out/visual-test-results.tar.gz diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 6f17ccdfb..7035afda7 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -51,12 +51,12 @@ jobs: sudo apt-get install -y gperf libxxf86vm-dev ninja-build postgresql-client lcov - name: checkout mapnik - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: "recursive" - name: checkout vcpkg - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: "microsoft/vcpkg" ref: ${{ inputs.VCPKG_SHA }} @@ -105,7 +105,7 @@ jobs: setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "${{ inputs.NUGET_REGISTRY }}" - name: Configure CMake - run: cmake -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake -DUSE_MEMORY_MAPPED_FILE=${{ inputs.USE_MEMORY_MAPPED_FILE }} --preset=${{ env.preset }} + run: cmake -DUSE_MEMORY_MAPPED_FILE=${{ inputs.USE_MEMORY_MAPPED_FILE }} --preset=${{ env.preset }} - name: Build run: cmake --build --preset ${{ env.preset }} @@ -117,7 +117,7 @@ jobs: continue-on-error: true working-directory: build/${{ env.preset }}/out env: - PROJ_LIB: ${{ github.workspace }}/build/${{ env.preset }}/vcpkg_installed/x64-linux/share/proj4 + PROJ_LIB: ${{ github.workspace }}/build/${{ env.preset }}/vcpkg_installed/x64-linux/share/proj/data run: ./mapnik-test-visual -j $(nproc) --output-dir ./visual-test-result - name: Pack visual test results @@ -127,7 +127,7 @@ jobs: - name: Run Benchmarks working-directory: build/${{ env.preset }}/out env: - PROJ_LIB: ${{ github.workspace }}/build/${{ env.preset }}/vcpkg_installed/x64-linux/share/proj4 + PROJ_LIB: ${{ github.workspace }}/build/${{ env.preset }}/vcpkg_installed/x64-linux/share/proj/data run: ./run_benchmarks - name: Coverage @@ -147,7 +147,7 @@ jobs: run: cmake --build --preset ${{ env.preset }} --target package - name: Upload mapnik build artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 if: failure() with: name: ${{ env.preset }}-artifact-mmio-${{ inputs.USE_MEMORY_MAPPED_FILE }} @@ -155,7 +155,7 @@ jobs: retention-days: 2 - name: Upload visual test results - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: ${{ env.preset }}-visual-tests-mmio-${{ inputs.USE_MEMORY_MAPPED_FILE }} path: build/${{ env.preset }}/out/visual-test-results.tar.gz diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 20a63565c..2ad229ddf 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -38,12 +38,12 @@ jobs: - uses: ilammy/msvc-dev-cmd@v1 - name: checkout mapnik - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: "recursive" - name: checkout vcpkg - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: "microsoft/vcpkg" ref: ${{ inputs.VCPKG_SHA }} @@ -91,7 +91,7 @@ jobs: setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "${{ inputs.NUGET_REGISTRY }}" - name: Configure CMake - run: cmake -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake -DUSE_MEMORY_MAPPED_FILE=${{ inputs.USE_MEMORY_MAPPED_FILE }} --preset ${{env.preset}} + run: cmake -DUSE_MEMORY_MAPPED_FILE=${{ inputs.USE_MEMORY_MAPPED_FILE }} --preset ${{env.preset}} - name: Build run: cmake --build --preset ${{env.preset}} @@ -104,7 +104,7 @@ jobs: continue-on-error: true working-directory: build/${{ env.preset }}/out env: - PROJ_LIB: ${{ github.workspace }}/build/${{ env.preset }}/vcpkg_installed/x64-windows/share/proj4 + PROJ_LIB: ${{ github.workspace }}/build/${{ env.preset }}/vcpkg_installed/x64-windows/share/proj/data run: OpenCppCoverage --modules *libmapnik* --modules mapnik*.exe --modules *.input --sources ${{ github.workspace }} --export_type binary --input_coverage=${{ github.workspace }}/ctest.cov --cover_children -- .\mapnik-test-visual.exe -j (Get-CimInstance -ClassName Win32_ComputerSystem).NumberOfLogicalProcessors --output-dir ./visual-test-result - name: Pack visual test results @@ -120,7 +120,7 @@ jobs: if: failure() run: cmake --build --preset ${{env.preset}} --target package - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 if: failure() with: name: ${{ env.preset }}-artifact-mmio-${{ inputs.USE_MEMORY_MAPPED_FILE }} @@ -128,7 +128,7 @@ jobs: retention-days: 2 - name: Upload visual test results - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: ${{ env.preset }}-visual-tests-mmio-${{ inputs.USE_MEMORY_MAPPED_FILE }} path: build/${{ env.preset }}/out/visual-test-results.tar.gz diff --git a/CMakePresets.json b/CMakePresets.json index 46720854c..61a84d330 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -179,7 +179,8 @@ "hidden": true, "cacheVariables": { "BUILD_TESTING": "ON", - "BUILD_DEMO_VIEWER": "OFF" + "BUILD_DEMO_VIEWER": "OFF", + "CMAKE_TOOLCHAIN_FILE": "vcpkg/scripts/buildsystems/vcpkg.cmake" } }, { @@ -194,7 +195,7 @@ "ADDITIONAL_LIBARIES_PATHS": "${sourceDir}/build/${presetName}/vcpkg_installed/x64-windows/bin" }, "environment": { - "PROJ_LIB": "${sourceDir}/build/${presetName}/vcpkg_installed/x64-windows/share/proj4" + "PROJ_LIB": "${sourceDir}/build/${presetName}/vcpkg_installed/x64-windows/share/proj/data" } }, { @@ -209,7 +210,7 @@ "CMAKE_CXX_FLAGS": "--coverage" }, "environment": { - "PROJ_LIB": "${sourceDir}/build/${presetName}/vcpkg_installed/x64-linux/share/proj4" + "PROJ_LIB": "${sourceDir}/build/${presetName}/vcpkg_installed/x64-linux/share/proj/data" } }, { @@ -225,7 +226,7 @@ "CMAKE_CXX_FLAGS": "-fprofile-arcs -ftest-coverage" }, "environment": { - "PROJ_LIB": "${sourceDir}/build/${presetName}/vcpkg_installed/x64-osx/share/proj4" + "PROJ_LIB": "${sourceDir}/build/${presetName}/vcpkg_installed/x64-osx/share/proj/data" } } ], diff --git a/src/proj_transform.cpp b/src/proj_transform.cpp index 51ef2032c..624e9147a 100644 --- a/src/proj_transform.cpp +++ b/src/proj_transform.cpp @@ -124,17 +124,28 @@ proj_transform::proj_transform(projection const& source, projection const& dest) { #ifdef MAPNIK_USE_PROJ ctx_ = proj_context_create(); + proj_log_level(ctx_, PJ_LOG_ERROR); transform_ = proj_create_crs_to_crs(ctx_, source.params().c_str(), dest.params().c_str(), nullptr); if (transform_ == nullptr) { - throw std::runtime_error(std::string("Cannot initialize proj_transform for given projections: '") + - source.params() + "'->'" + dest.params() + "'"); + throw std::runtime_error(std::string("Cannot initialize proj_transform (crs_to_crs) for given projections: '") + + source.params() + "'->'" + dest.params() + +#if MAPNIK_PROJ_VERSION >= 80000 + "' because of " + std::string(proj_context_errno_string(ctx_, proj_context_errno(ctx_)))); +#else + "'"); +#endif } PJ* transform_gis = proj_normalize_for_visualization(ctx_, transform_); if (transform_gis == nullptr) { - throw std::runtime_error(std::string("Cannot initialize proj_transform for given projections: '") + - source.params() + "'->'" + dest.params() + "'"); + throw std::runtime_error(std::string("Cannot initialize proj_transform (normalize) for given projections: '") + + source.params() + "'->'" + dest.params() + +#if MAPNIK_PROJ_VERSION >= 80000 + "' because of " + std::string(proj_context_errno_string(ctx_, proj_context_errno(ctx_)))); +#else + "'"); +#endif } proj_destroy(transform_); transform_ = transform_gis; diff --git a/test/unit/renderer/cairo_io.cpp b/test/unit/renderer/cairo_io.cpp index c3b739404..4f95f0d49 100644 --- a/test/unit/renderer/cairo_io.cpp +++ b/test/unit/renderer/cairo_io.cpp @@ -12,6 +12,11 @@ MAPNIK_DISABLE_WARNING_POP #include #if defined(HAVE_CAIRO) +#include + +// see https://gitlab.freedesktop.org/cairo/cairo/-/issues/553 +// TLDR: cairo has removed the writing of the svg version in cairo 1.17.6 +#if (CAIRO_VERSION_MAJOR <= 1) && (CAIRO_VERSION_MINOR <= 17) && (CAIRO_VERSION_MICRO < 6) TEST_CASE("cairo_io") { SECTION("save_to_cairo_file - SVG") @@ -33,3 +38,4 @@ TEST_CASE("cairo_io") } } #endif +#endif diff --git a/vcpkg.json b/vcpkg.json index 3f5afdbc7..1bc58e8c3 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -60,7 +60,7 @@ "mapbox-geometry", "mapbox-polylabel", "mapbox-variant", - "proj4", + "proj", "protozero", { "name": "sqlite3",