microsoft / vcpkg

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

[icu] Build error on arm64 macos #30532

Closed janisozaur closed 1 year ago

janisozaur commented 1 year ago

Host Environment

To Reproduce

Steps to reproduce the behavior:

./vcpkg install --overlay-triplets=. --triplet=arm64-osx-openrct2 icu

Contents of arm64-osx-openrct2.cmake:

set(VCPKG_TARGET_ARCHITECTURE arm64)
set(VCPKG_OSX_ARCHITECTURES arm64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)

set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_DEPLOYMENT_TARGET "11.0")

set(VCPKG_BUILD_TYPE release)

Failure logs

Run export VCPKG_COMMIT_HASH='23f0707b1a46bbf7fff9fb95cde2aa0c7213c31d'
  export VCPKG_COMMIT_HASH='23f0707b1a46bbf7fff9fb95cde2aa0c7213c31d'
  brew install automake autoconf-archive
  ./macos_build.sh
  shell: /bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    VCPKG_COMMIT_HASH: 23f0707b1a46bbf7fff9fb95cde2aa0c7213c31d

==> Fetching automake
==> Downloading https://ghcr.io/v2/homebrew/core/automake/manifests/1.16.5
==> Downloading https://ghcr.io/v2/homebrew/core/automake/blobs/sha256:ae77a247a13ea860236a29b02769f5327395f712413f694d8a8d20cb6c21332d
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:ae77a247a13ea860236a29b02769f5327395f712413f694d8a8d20cb6c21332d?se=2023-03-29T22%3A05%3A00Z&sig=qTO9yE3FPw%2BbKnnS5l88GUVEX51ht%2F5o8LUqjxRM%2BQ8%3D&sp=r&spr=https&sr=b&sv=2019-12-12
==> Fetching autoconf-archive
==> Downloading https://ghcr.io/v2/homebrew/core/autoconf-archive/manifests/2023.02.20
==> Downloading https://ghcr.io/v2/homebrew/core/autoconf-archive/blobs/sha256:241f7af27fa98b3cde170df669f5041e1af971fb4846890269d01df8ab26e74b
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:241f7af27fa98b3cde170df669f5041e1af971fb4846890269d01df8ab26e74b?se=2023-03-29T22%3A05%3A00Z&sig=UBX2UZ2tknjIgL5Vg0F%2FH%2Bov6yrN%2BhnFKYBbmZJCwGo%3D&sp=r&spr=https&sr=b&sv=2019-12-12
==> Pouring automake--1.16.5.monterey.bottle.tar.gz
🍺  /usr/local/Cellar/automake/1.16.5: 131 files, 3.5MB
==> Running `brew cleanup automake`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Pouring autoconf-archive--2023.02.20.monterey.bottle.tar.gz
🍺  /usr/local/Cellar/autoconf-archive/2023.02.20: 600 files, 3.6MB
==> Running `brew cleanup autoconf-archive`...
+./macos_build.sh:6> easy_install --user 'pyyaml==5.4.1'
Searching for pyyaml==5.4.1
Reading https://pypi.org/simple/pyyaml/
Downloading https://files.pythonhosted.org/packages/42/c5/440fd6200c345c3d522fbe47a52558733c4661aac3c8cf06b7de31bababd/PyYAML-5.4.1-cp27-cp27m-macosx_10_9_x86_64.whl#sha256=3b2b1824fe7112845700f815ff6a489360226a5609b96ec2190a45e62a9fc922
Best match: PyYAML 5.4.1
Processing PyYAML-5.4.1-cp27-cp27m-macosx_10_9_x86_64.whl
Installing PyYAML-5.4.1-cp27-cp27m-macosx_10_9_x86_64.whl to /Users/runner/Library/Python/2.7/lib/python/site-packages
Adding PyYAML 5.4.1 to easy-install.pth file

Installed /Users/runner/Library/Python/2.7/lib/python/site-packages/PyYAML-5.4.1-py2.7-macosx-10.9-x86_64.egg
Processing dependencies for pyyaml==5.4.1
Finished processing dependencies for pyyaml==5.4.1
+./macos_build.sh:8> git clone -q https://github.com/Microsoft/vcpkg.git
+./macos_build.sh:10> [ -v VCPKG_COMMIT_HASH ']'
Using pinned vcpkg commit: 23f0707b1a46bbf7fff9fb95cde2aa0c7213c31d
+./macos_build.sh:11> echo 'Using pinned vcpkg commit: 23f0707b1a46bbf7fff9fb95cde2aa0c7213c31d'
+./macos_build.sh:12> pushd vcpkg
+./macos_build.sh:13> git checkout -q 23f0707b1a46bbf7fff9fb95cde2aa0c7213c31d
+./macos_build.sh:14> popd
+./macos_build.sh:17> vcpkg/bootstrap-vcpkg.sh
Downloading vcpkg-macos...
+./macos_build.sh:19> ARM_TRIPLET='--overlay-triplets=. --triplet=arm64-osx-openrct2' 
Telemetry
+./macos_build.sh:20> X64_TRIPLET='--overlay-triplets=. --triplet=x64-osx-openrct2' 
---------
+./macos_build.sh:21> LIBRARIES='libpng freetype openssl icu libzip[core] nlohmann-json openal-soft sdl2 speexdsp discord-rpc gtest libflac libogg libvorbis' 
vcpkg collects usage data in order to help us improve your experience.
+./macos_build.sh:22> vcpkg/vcpkg install '--overlay-triplets=.' '--triplet=arm64-osx-openrct2' icu
The data collected by Microsoft is anonymous.
You can opt-out of telemetry by re-running the bootstrap-vcpkg script with -disableMetrics,
passing --disable-metrics to vcpkg on the command line,
or by setting the VCPKG_DISABLE_METRICS environment variable.

Read more about vcpkg telemetry at docs/about/privacy.md
Computing installation plan...
The following packages will be built and installed:
  * icu[core,tools]:x64-osx -> 72.1#3
    icu[core]:arm64-osx-openrct2 -> 72.1#3
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-osx...
Detecting compiler hash for triplet arm64-osx-openrct2...
Restored 0 package(s) from /Users/runner/.cache/vcpkg/archives in 60.629 us. Use --debug to see more details.
Installing 1/2 icu:x64-osx...
Building icu[core,tools]:x64-osx...
-- Downloading https://github.com/unicode-org/icu/releases/download/release-72-1/icu4c-72_1-src.tgz -> icu4c-72_1-src.tgz...
-- Extracting source /Users/runner/work/Dependencies/Dependencies/vcpkg/downloads/icu4c-72_1-src.tgz
-- Applying patch disable-escapestr-tool.patch
-- Applying patch remove-MD-from-configure.patch
-- Applying patch fix_parallel_build_on_windows.patch
-- Applying patch fix-extra.patch
-- Applying patch mingw-dll-install.patch
-- Applying patch disable-static-prefix.patch
-- Applying patch fix-win-build.patch
-- Using source at /Users/runner/work/Dependencies/Dependencies/vcpkg/buildtrees/icu/src/c-72_1-src-deba61ed52.clean
-- Getting CMake variables for x64-osx-dbg
-- Getting CMake variables for x64-osx-rel
-- Generating configure for x64-osx
-- Finished generating configure for x64-osx
-- Configuring x64-osx-dbg
-- Configuring x64-osx-rel
-- Building x64-osx-dbg
-- Installing x64-osx-dbg
-- Building x64-osx-rel
-- Installing x64-osx-rel
-- Installing: /Users/runner/work/Dependencies/Dependencies/vcpkg/packages/icu_x64-osx/tools/icu/config/icucross.inc
-- Installing: /Users/runner/work/Dependencies/Dependencies/vcpkg/packages/icu_x64-osx/tools/icu/config/icucross.mk
-- Fixing pkgconfig file: /Users/runner/work/Dependencies/Dependencies/vcpkg/packages/icu_x64-osx/lib/pkgconfig/icu-i18n.pc
-- Fixing pkgconfig file: /Users/runner/work/Dependencies/Dependencies/vcpkg/packages/icu_x64-osx/lib/pkgconfig/icu-io.pc
-- Fixing pkgconfig file: /Users/runner/work/Dependencies/Dependencies/vcpkg/packages/icu_x64-osx/lib/pkgconfig/icu-uc.pc
-- Fixing pkgconfig file: /Users/runner/work/Dependencies/Dependencies/vcpkg/packages/icu_x64-osx/debug/lib/pkgconfig/icu-i18n.pc
-- Fixing pkgconfig file: /Users/runner/work/Dependencies/Dependencies/vcpkg/packages/icu_x64-osx/debug/lib/pkgconfig/icu-io.pc
-- Fixing pkgconfig file: /Users/runner/work/Dependencies/Dependencies/vcpkg/packages/icu_x64-osx/debug/lib/pkgconfig/icu-uc.pc
-- Installing: /Users/runner/work/Dependencies/Dependencies/vcpkg/packages/icu_x64-osx/share/icu/vcpkg-cmake-wrapper.cmake
-- Installing: /Users/runner/work/Dependencies/Dependencies/vcpkg/packages/icu_x64-osx/share/icu/copyright
-- Performing post-build validation
Stored binary cache: "/Users/runner/.cache/vcpkg/archives/8d/8dfe3d4c9c12b9a07f0226addc9904b232aeeadcb5a3865654d1adca03ab748a.zip"
Elapsed time to handle icu:x64-osx: 7.535458184733334 min
Installing 2/2 icu:arm64-osx-openrct2...
Building icu[core]:arm64-osx-openrct2...
-- [OVERLAY] Loading triplet configuration from: /Users/runner/work/Dependencies/Dependencies/arm64-osx-openrct2.cmake
-- Using cached icu4c-72_1-src.tgz.
-- Cleaning sources at /Users/runner/work/Dependencies/Dependencies/vcpkg/buildtrees/icu/src/c-72_1-src-deba61ed52.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source /Users/runner/work/Dependencies/Dependencies/vcpkg/downloads/icu4c-72_1-src.tgz
-- Applying patch disable-escapestr-tool.patch
-- Applying patch remove-MD-from-configure.patch
-- Applying patch fix_parallel_build_on_windows.patch
-- Applying patch fix-extra.patch
-- Applying patch mingw-dll-install.patch
-- Applying patch disable-static-prefix.patch
-- Applying patch fix-win-build.patch
-- Using source at /Users/runner/work/Dependencies/Dependencies/vcpkg/buildtrees/icu/src/c-72_1-src-deba61ed52.clean
-- Getting CMake variables for arm64-osx-openrct2-rel
-- Generating configure for arm64-osx-openrct2
-- Finished generating configure for arm64-osx-openrct2
-- Configuring arm64-osx-openrct2-rel
-- Building arm64-osx-openrct2-rel
-- setting rpath prefix for macOS dynamic libraries
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
    Command failed: /usr/bin/install_name_tool -id @rpath/libicutu.72.dylib libicutu.72.1.dylib
    Working Directory: /Users/runner/work/Dependencies/Dependencies/vcpkg/buildtrees/icu/arm64-osx-openrct2-rel/lib
    See logs for more information:
      /Users/runner/work/Dependencies/Dependencies/vcpkg/buildtrees/icu/make-build-fix-rpath-arm64-osx-openrct2-rel-err.log

Call Stack (most recent call first):
  ports/icu/portfile.cmake:90 (vcpkg_execute_build_process)
  scripts/ports.cmake:147 (include)

error: building icu:arm64-osx-openrct2 failed with: BUILD_FAILED
error: Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
    https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+icu
You can submit a new issue at:
    https://github.com/microsoft/vcpkg/issues/new?template=report-package-build-failure.md&title=[icu]+Build+error
Include '[icu] Build error' in your bug report title, the following version information in your bug description, and attach any relevant failure logs from above.
    vcpkg-tool version: 2023-03-14-105f7f7e8a5ea10dfac9874ff9d1a6bacba5f454
    vcpkg-scripts version: 23f0707b1 2023-03-29 (5 hours ago)

Please use the prefilled template from /Users/runner/work/Dependencies/Dependencies/vcpkg/installed/vcpkg/issue_body.md when reporting your issue.
+./macos_build.sh:22> true
+./macos_build.sh:23> cat /Users/runner/work/Dependencies/Dependencies/vcpkg/buildtrees/icu/make-build-fix-rpath-arm64-osx-openrct2-rel-err.log
error: /Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: libicutu.72.1.dylib (No such file or directory)

Note the last line contains the logs produced by cmake/vcpkg in /Users/runner/work/Dependencies/Dependencies/vcpkg/buildtrees/icu/make-build-fix-rpath-arm64-osx-openrct2-rel-err.log file:

error: /Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: libicutu.72.1.dylib (No such file or directory)
janisozaur commented 1 year ago

After running vcpkg, following dylibs are found:

$ find /Users/runner/work/Dependencies/Dependencies/vcpkg/ -name '*icu*.dylib'
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/arm64-osx-openrct2-rel/stubdata/libicudata.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/arm64-osx-openrct2-rel/stubdata/libicudata.72.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/arm64-osx-openrct2-rel/stubdata/libicudata.72.1.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/arm64-osx-openrct2-rel/lib/libicui18n.72.1.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/arm64-osx-openrct2-rel/lib/libicui18n.72.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/arm64-osx-openrct2-rel/lib/libicuio.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/arm64-osx-openrct2-rel/lib/libicudata.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/arm64-osx-openrct2-rel/lib/libicuuc.72.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/arm64-osx-openrct2-rel/lib/libicudata.72.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/arm64-osx-openrct2-rel/lib/libicuio.72.1.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/arm64-osx-openrct2-rel/lib/libicuuc.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/arm64-osx-openrct2-rel/lib/libicuuc.72.1.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/arm64-osx-openrct2-rel/lib/libicui18n.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/arm64-osx-openrct2-rel/lib/libicudata.72.1.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/arm64-osx-openrct2-rel/lib/libicuio.72.dylib
janisozaur commented 1 year ago

Similar issue is present when using x64-osx-openrct2.cmake:

set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)

set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_DEPLOYMENT_TARGET "10.13")

set(VCPKG_BUILD_TYPE release)
…
 -- setting rpath prefix for macOS dynamic libraries
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
    Command failed: /usr/bin/install_name_tool -id @rpath/libicudata.72.dylib libicudata.72.1.dylib
    Working Directory: /Users/runner/work/Dependencies/Dependencies/vcpkg/buildtrees/icu/x64-osx-openrct2-rel/lib
    See logs for more information:
      /Users/runner/work/Dependencies/Dependencies/vcpkg/buildtrees/icu/make-build-fix-rpath-x64-osx-openrct2-rel-err.log

Call Stack (most recent call first):
  ports/icu/portfile.cmake:90 (vcpkg_execute_build_process)
  scripts/ports.cmake:147 (include)

error: building icu:x64-osx-openrct2 failed with: BUILD_FAILED
error: Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
    https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+icu
You can submit a new issue at:
    https://github.com/microsoft/vcpkg/issues/new?template=report-package-build-failure.md&title=[icu]+Build+error
Include '[icu] Build error' in your bug report title, the following version information in your bug description, and attach any relevant failure logs from above.
    vcpkg-tool version: 2023-03-14-105f7f7e8a5ea10dfac9874ff9d1a6bacba5f454
    vcpkg-scripts version: 23f0707b1 2023-03-29 (15 hours ago)

Please use the prefilled template from /Users/runner/work/Dependencies/Dependencies/vcpkg/installed/vcpkg/issue_body.md when reporting your issue.
+./macos_build.sh:22> true
+./macos_build.sh:24> find /Users/runner/work/Dependencies/Dependencies/vcpkg/ -name '*icu*.dylib'
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/x64-osx-openrct2-rel/stubdata/libicudata.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/x64-osx-openrct2-rel/stubdata/libicudata.72.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/x64-osx-openrct2-rel/stubdata/libicudata.72.1.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/x64-osx-openrct2-rel/lib/libicui18n.72.1.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/x64-osx-openrct2-rel/lib/libicui18n.72.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/x64-osx-openrct2-rel/lib/libicuio.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/x64-osx-openrct2-rel/lib/libicuuc.72.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/x64-osx-openrct2-rel/lib/libicuio.72.1.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/x64-osx-openrct2-rel/lib/libicuuc.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/x64-osx-openrct2-rel/lib/libicuuc.72.1.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/x64-osx-openrct2-rel/lib/libicui18n.dylib
/Users/runner/work/Dependencies/Dependencies/vcpkg//buildtrees/icu/x64-osx-openrct2-rel/lib/libicuio.72.dylib
janisozaur commented 1 year ago

I can also confirm libicutu.71.1.dylib was present with the same triplet on vcpkg version 5e7cbdceacd2b3cb85e057963fdb605136805bd3

janisozaur commented 1 year ago
$ git lol 5e7cbdceacd2b3cb85e057963fdb605136805bd3..23f0707b1a46bbf7fff9fb95cde2aa0c7213c31d ports/icu
* f67d9135a - [icu] Fix x86 MinGW build (#29532) (7 weeks ago)      <Todor Prokopov>
* 261f5b1fc - Fix https://github.com/microsoft/vcpkg/issues/29322 (#29329) (7 weeks ago)      <Matthias Kuhn>
* cdbcc0321 - [icu] Add tools, fix building for ios (#29196) (9 weeks ago)      <Matthias Kuhn>
* cd08228e4 - [icu] Update to 72.1 (#28794) (3 months ago)      <Kai Pastor>

f67d9135a - fails 261f5b1fcc106428df91d2f44f2bec9e50e11868 - fails cdbcc0321216fe46e4b20941f76ad21429d2a90c - fails cd08228e4a081ab5a2ee1756bf846ee24520615e - works


cdbcc0321216fe46e4b20941f76ad21429d2a90c (https://github.com/microsoft/vcpkg/pull/29196) is the regression

janisozaur commented 1 year ago

I submitted a fix: https://github.com/microsoft/vcpkg/pull/30544

Until this is fixed, installing icu[core,tools] instead of just icu addresses my immediate needs.