microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.47k stars 6.2k forks source link

[skia] Build error on arm64-linux #39468

Open ADKaster opened 1 month ago

ADKaster commented 1 month ago

Package: skia[core,fontconfig,freetype,gl,harfbuzz,icu]:arm64-linux@124

Host Environment

To Reproduce

vcpkg install --no-print-usage

Failure logs

-- Downloading https://github.com/google/skia/archive/e7bf161ff959268a2a2f37530a6ea61c27019d33.tar.gz -> google-skia-e7bf161ff959268a2a2f37530a6ea61c27019d33.tar.gz...
-- Extracting source /home/andrew/Source/ladybird/Toolchain/Tarballs/vcpkg/downloads/google-skia-e7bf161ff959268a2a2f37530a6ea61c27019d33.tar.gz
-- Applying patch disable-msvc-env-setup.patch
-- Applying patch disable-dev-test.patch
-- Applying patch skia-include-string.patch
-- Applying patch bentleyottmann-build.patch
-- Applying patch graphite.patch
-- Applying patch vulkan-headers.patch
-- Using source at /home/andrew/Source/ladybird/Toolchain/Tarballs/vcpkg/buildtrees/skia/src/1c27019d33-728a6df320.clean
-- Creating third_party/externals/dng_sdk
-- Fetching https://android.googlesource.com/platform/external/dng_sdk.git c8d0c9b1d16bfda56f15165d39e0ffa360a11123...
-- Extracting source /home/andrew/Source/ladybird/Toolchain/Tarballs/vcpkg/downloads/skia-c8d0c9b1d16bfda56f15165d39e0ffa360a11123.tar.gz
-- Using source at /home/andrew/Source/ladybird/Toolchain/Tarballs/vcpkg/buildtrees/skia/src/a360a11123-010babe785.clean
-- Creating third_party/externals/piex
-- Fetching https://android.googlesource.com/platform/external/piex.git bb217acdca1cc0c16b704669dd6f91a1b509c406...
-- Extracting source /home/andrew/Source/ladybird/Toolchain/Tarballs/vcpkg/downloads/skia-bb217acdca1cc0c16b704669dd6f91a1b509c406.tar.gz
-- Using source at /home/andrew/Source/ladybird/Toolchain/Tarballs/vcpkg/buildtrees/skia/src/a1b509c406-cff081c451.clean
-- Creating third_party/externals/wuffs
-- Fetching https://github.com/google/wuffs-mirror-release-c.git e3f919ccfe3ef542cfc983a82146070258fb57f8...
-- Extracting source /home/andrew/Source/ladybird/Toolchain/Tarballs/vcpkg/downloads/skia-e3f919ccfe3ef542cfc983a82146070258fb57f8.tar.gz
-- Using source at /home/andrew/Source/ladybird/Toolchain/Tarballs/vcpkg/buildtrees/skia/src/0258fb57f8-420ead2447.clean
-- Getting CMake variables for arm64-linux
-- Generating build (arm64-linux-dbg)...
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:112 (message):
    Command failed: /home/andrew/Source/ladybird/Build/ladybird/vcpkg_installed/arm64-linux/tools/gn/gn gen /home/andrew/Source/ladybird/Toolchain/Tarballs/vcpkg/buildtrees/skia/arm64-linux-dbg "--args=target_cpu=\"arm64\" skia_enable_android_utils=false skia_enable_spirv_validation=false skia_enable_tools=false skia_enable_gpu_debug_layers=false skia_use_jpeg_gainmaps=false skia_use_libheif=false skia_use_lua=false is_component_build=false skia_use_fontconfig=true skia_use_freetype=true skia_use_harfbuzz=true skia_use_icu=true skia_use_gl=true         cc=\"/usr/lib64/ccache/cc\"         cxx=\"/usr/lib64/ccache/c++\" is_debug=true     extra_cflags_c=[\"-fPIC\",\"-g\"]     extra_cflags_cc=[\"-fPIC\",\"-g\"]"
    Working Directory: /home/andrew/Source/ladybird/Toolchain/Tarballs/vcpkg/buildtrees/skia/src/1c27019d33-728a6df320.clean
    Error code: Subprocess aborted
    See logs for more information:
      /home/andrew/Source/ladybird/Toolchain/Tarballs/vcpkg/buildtrees/skia/generate-arm64-linux-dbg-err.log

Call Stack (most recent call first):
  /home/andrew/Source/ladybird/Build/ladybird/vcpkg_installed/arm64-linux/share/vcpkg-gn/vcpkg_gn_configure.cmake:10 (vcpkg_execute_required_process)
  /home/andrew/Source/ladybird/Build/ladybird/vcpkg_installed/arm64-linux/share/vcpkg-gn/vcpkg_gn_configure.cmake:34 (z_vcpkg_gn_configure_generate)
  buildtrees/versioning_/versions/skia/b993a94ad57f5f651ac7dfa08cf20f17134a1b0d/portfile.cmake:282 (vcpkg_gn_configure)
  scripts/ports.cmake:191 (include)
/home/andrew/Source/ladybird/Toolchain/Tarballs/vcpkg/buildtrees/skia/generate-arm64-linux-dbg-err.log ``` : Unsupported system page size : Unsupported system page size : Unsupported system page size : Unsupported system page size : Unsupported system page size ```

Additional context

vcpkg.json ``` { "builtin-baseline": "f7423ee180c4b7f40d43402c2feb3859161ef625", "dependencies": [ { "name": "fontconfig", "platform": "linux | freebsd | openbsd" }, "icu", "libjpeg-turbo", { "name": "libpng", "features": [ "apng" ] }, "skia", "sqlite3", "woff2" ], "overrides": [ { "name": "fontconfig", "version": "2.14.2#1" }, { "name": "icu", "version": "74.2#2" }, { "name": "libjpeg-turbo", "version": "3.0.2" }, { "name": "libpng", "version": "1.6.43#1" }, { "name": "skia", "version": "124#0" }, { "name": "sqlite3", "version": "3.45.3" }, { "name": "woff2", "version": "1.0.2#4" } ] } ```

Additional Information:

This is on Asahi Fedora Remix 40, with 16 KiB Pages.

The failure talking about jemalloc seems to be talking about the host tool gn, used to create the build for skia.

Presumably jemalloc as used by gn needs to be told to do the usual Asahi workarounds when building on such a platform.

ADKaster commented 1 month ago

Further evidence that the issue is actually in the host tool gn:

andrew@fedora:~/Source/ladybird$ /home/andrew/Source/ladybird/Build/ladybird/vcpkg_installed/arm64-linux/tools/gn/gn --help
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
Aborted (core dumped)
ADKaster commented 1 month ago

It looks like gn is simply downloaded from chromium's infra servers?

https://github.com/microsoft/vcpkg/blob/c4467cb686f92671f0172aa8299a77d908175b4e/ports/vcpkg-tool-gn/portfile.cmake#L7-L13

Is the solution then for vcpkg to bug chromium to ship a 16 KiB Page-aware version of gn, or to build gn from source?

@nico :pray:

dg0yt commented 1 month ago

You can try to build gn yourself, and add it to the PATH.

ADKaster commented 1 month ago

Even with gn in $PATH, it still uses vcpkg-gn:arm64-linux@2024-02-22 and vcpkg-tool-gn:arm64-linux@2024-02-22 to build.

https://gist.github.com/ADKaster/a67e9ddbac746d7333364a5aa39ceead

ADKaster commented 1 month ago

If I do this it works, but I'm guessing that's not exactly... the right way to do such things.

sudo cp $(which gn) vcpkg/installed/arm64-linux/tools/gn/gn

Are there docs on how to replace/override host tools that I missed in my search?

dg0yt commented 1 month ago

I see, vcpkg-tool-gn is bias towards the main platforms, with binaries from Google.

One thing to try is to pre-set the GN cmake variable, either in a custom triplet file, or via vcpkg's --cmake-args=-DGN=/your/path/to/GN.

There is no exact documentation for the next recommendation: to make an overlay port which builds gn from source and put it into ${CURRENT_PACKAGES_DIR}/tools/gn/. (We might integrate such a recipe into the regular port for the platforms not supplied with binaries from Google.)