Open kwsp opened 4 weeks ago
Copied issue_body.md
below:
Package: mbedtls:arm64-osx@2.28.7
Host Environment
To Reproduce
vcpkg install
Failure logs
-- Using cached ARMmbed-mbedtls-v2.28.7.tar.gz.
-- Cleaning sources at /Users/tnie/vcpkg/buildtrees/mbedtls/src/v2.28.7-a14e236f0b.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source /Users/tnie/vcpkg/downloads/ARMmbed-mbedtls-v2.28.7.tar.gz
-- Applying patch enable-pthread.patch
-- Using source at /Users/tnie/vcpkg/buildtrees/mbedtls/src/v2.28.7-a14e236f0b.clean
-- Found external ninja('1.12.1').
-- Configuring arm64-osx
-- Building arm64-osx-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
Command failed: /opt/homebrew/Cellar/cmake/3.29.2/bin/cmake --build . --config Debug --target install -- -v -j9
Working Directory: /Users/tnie/vcpkg/buildtrees/mbedtls/arm64-osx-dbg
See logs for more information:
/Users/tnie/vcpkg/buildtrees/mbedtls/install-arm64-osx-dbg-out.log
Call Stack (most recent call first):
/Users/tnie/code/cpp/vcpkg-ninja-issue/build_vcpkg/vcpkg_installed/arm64-osx/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
/Users/tnie/code/cpp/vcpkg-ninja-issue/build_vcpkg/vcpkg_installed/arm64-osx/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build)
ports/mbedtls/portfile.cmake:28 (vcpkg_cmake_install)
scripts/ports.cmake:191 (include)
Additional context
This issue can't repro on the latest vcpkg.
Installing 3/3 mbedtls:arm64-osx@2.28.7...
Building mbedtls:arm64-osx@2.28.7...
-- Downloading https://github.com/ARMmbed/mbedtls/archive/v2.28.7.tar.gz -> ARMmbed-mbedtls-v2.28.7.tar.gz...
-- Extracting source /Users/vcpkg/lily/0619/downloads/ARMmbed-mbedtls-v2.28.7.tar.gz
-- Applying patch enable-pthread.patch
-- Using source at /Users/vcpkg/lily/0619/buildtrees/mbedtls/src/v2.28.7-a14e236f0b.clean
-- Found external ninja('1.12.1').
-- Configuring arm64-osx
-- Building arm64-osx-dbg
-- Building arm64-osx-rel
-- Installing: /Users/vcpkg/lily/0619/packages/mbedtls_arm64-osx/share/mbedtls/copyright
-- Performing post-build validation
./vcpkg --version
vcpkg package management program version 2024-06-10-02590c430e4ed9215d27870138c2e579cc338772
You could refer to this issue: https://github.com/telegramdesktop/tdesktop/issues/25058, the error is same with yours.
Ok. Is there a way for VCPKG to document what packages need what tools to build? For example, how would a user know that a package wouldn't compile with LLVM from Homebrew and would only work with the XCode tools?
What about the first issue where CMake implies Ninja wasn't found while it was found?
I've been getting this error often where CMake fails to find Ninja when using the VCPKG toolchain. When I invoke CMake without the VCPKG toolchain (e.g.
cmake -Bbuild -S. -GNinja
), CMake finds Ninja fine. However, when CMake is invoked with the VCPKG toolchain (e.g.cmake -Bbuild_vcpkg -S. -GNinja -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
), it cannot find Ninja. Then, I realised Ninja was in fact found by CMake (duh), but a Ninja build command failed, and somehow CMake reported that as Ninja not found.MRE here: https://github.com/kwsp/vcpkg-ninja-issue. Just run reproduce.sh. On an Apple Silicon mac with the Homebrew LLVM@18 toolchain installed and in path.
The output I get from my MRE is here:
Two issues here
1. The issue isn't that Ninja isn't found, but rather a Ninja call failed inside CMake and somehow this was reported as Ninja not found. This was erronously reported as Ninja not found. I'm not too familiar with CMake and I don't know if the root cause if this misreporting is in the VCPKG toolchain or in CMake itself.
Look down into the build logs - this is the line that actually failed:
2.
mbedtls
currently doesn't build with the Homebrew LLVM@18 on mac.I don't know enough about
mbedtls
andllvm-ranlib
to know why this error is thrown here