microsoft / vcpkg

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

[python3] Build error on arm64-osx #41055

Open ClementToni opened 2 months ago

ClementToni commented 2 months ago

Package: python3:arm64-osx@3.11.8#4

Host Environment

To Reproduce

vcpkg install python3

Failure logs

CMake Warning at ports/python3/portfile.cmake:7 (message):
  python3 currently requires the following programs from the system package
  manager:

      autoconf automake autoconf-archive

  On Debian and Ubuntu derivatives:

      sudo apt-get install autoconf automake autoconf-archive

  On recent Red Hat and Fedora derivatives:

      sudo dnf install autoconf automake autoconf-archive

  On Arch Linux and derivatives:

      sudo pacman -S autoconf automake autoconf-archive

  On Alpine:

      apk add autoconf automake autoconf-archive

  On macOS:

      brew install autoconf automake autoconf-archive

Call Stack (most recent call first):
  scripts/ports.cmake:192 (include)

-- Using cached python-cpython-v3.11.8.tar.gz.
-- Cleaning sources at /Users/clement_t/vcpkg/buildtrees/python3/src/v3.11.8-31d17ab840.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source /Users/clement_t/vcpkg/downloads/python-cpython-v3.11.8.tar.gz
-- Applying patch 0001-only-build-required-projects.patch
-- Applying patch 0003-use-vcpkg-zlib.patch
-- Applying patch 0004-devendor-external-dependencies.patch
-- Applying patch 0005-dont-copy-vcruntime.patch
-- Applying patch 0008-python.pc.patch
-- Applying patch 0010-dont-skip-rpath.patch
-- Applying patch 0012-force-disable-modules.patch
-- Applying patch 0014-fix-get-python-inc-output.patch
-- Applying patch 0015-dont-use-WINDOWS-def.patch
-- Applying patch 0016-undup-ffi-symbols.patch
-- Applying patch 0018-fix-sysconfig-include.patch
-- Applying patch 0002-static-library.patch
-- Using source at /Users/clement_t/vcpkg/buildtrees/python3/src/v3.11.8-31d17ab840.clean
-- Found external ninja('1.12.1').
-- Getting CMake variables for arm64-osx-dbg
-- Getting CMake variables for arm64-osx-rel
-- Generating configure for arm64-osx
-- Finished generating configure for arm64-osx
-- Configuring arm64-osx-dbg
-- Configuring arm64-osx-rel
-- Building arm64-osx-dbg
-- Installing arm64-osx-dbg
-- Building arm64-osx-rel
-- Installing arm64-osx-rel
-- Fixing pkgconfig file: /Users/clement_t/vcpkg/packages/python3_arm64-osx/lib/pkgconfig/python-3.11-embed.pc
-- Fixing pkgconfig file: /Users/clement_t/vcpkg/packages/python3_arm64-osx/lib/pkgconfig/python-3.11.pc
-- Fixing pkgconfig file: /Users/clement_t/vcpkg/packages/python3_arm64-osx/debug/lib/pkgconfig/python-3.11-embed.pc
-- Fixing pkgconfig file: /Users/clement_t/vcpkg/packages/python3_arm64-osx/debug/lib/pkgconfig/python-3.11.pc
CMake Error at ports/python3/portfile.cmake:317 (message):
  There should be no modules with "_failed" suffix:

  /Users/clement_t/vcpkg/packages/python3_arm64-osx/debug/lib/python3.11/lib-dynload/_blake2.cpython-311d-darwin_failed.so

  /Users/clement_t/vcpkg/packages/python3_arm64-osx/lib/python3.11/lib-dynload/_blake2.cpython-311-darwin_failed.so
Call Stack (most recent call first):
  scripts/ports.cmake:192 (include)
LilyWangLL commented 2 months ago

Duplicate of https://github.com/microsoft/vcpkg/issues/30136, please try the solution from PR https://github.com/microsoft/vcpkg/pull/31621.

ClementToni commented 2 months ago

Hi,

I tried the solution (cloning the repository, checking out the appropriate branch, and compiling), and then I ran./vcpkg install python3 again. Unfortunately, this did not fix the error.

SpiritDogstar commented 1 month ago

Issue is still going on for OSX. Here's a reference to another of this: #39950

dg0yt commented 1 month ago

Issue is still going on for OSX. Here's a reference to another of this: #39950

No, this is a different issue.

ClementToni commented 1 month ago

I am still unable to run ./vcpkg install python3:arm64-osx Do you have any suggestions on what I should do?

SpiritDogstar commented 4 weeks ago

I am also having the same issue still.

ClementToni commented 3 weeks ago

This is a quick update on my issue. I found that in the config-arm64-osx-dbg-config.log, the uname -m command was returning x86_64 instead of arm64. However, I still haven’t been able to fix this bug.

The config-arm64-osx-dbg-config.log file:

`This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake.

It was created by python configure 3.11, which was generated by GNU Autoconf 2.72. Invocation command line was

$ ./../src/v3.11.8-31d17ab840.clean/configure --host=aarch64-apple-darwin --with-openssl=/Users/clement_t/Epitech/celte/celte_vm/build/vcpkg_installed/arm64-osx --without-ensurepip --with-suffix= --with-system-expat --without-readline --disable-test-modules 'LIBS=-liconv -lintl' --disable-silent-rules --verbose --disable-shared --enable-static --with-pydebug vcpkg_rpath=/Users/clement_t/Epitech/celte/celte_vm/build/vcpkg_installed/arm64-osx/debug/lib --prefix=/Users/clement_t/Epitech/celte/celte_vm/build/vcpkg_installed/arm64-osx/debug '--bindir=${prefix}/../tools/python3/debug/bin' '--sbindir=${prefix}/../tools/python3/debug/sbin' '--libdir=${prefix}/lib' '--includedir=${prefix}/../include' '--datarootdir=${prefix}/share/python3'

---------

Platform.

---------

hostname = Clements-MacBook-Pro-2.local uname -m = x86_64 uname -r = 24.0.0 uname -s = Darwin uname -v = Darwin Kernel Version 24.0.0: Tue Sep 24 23:39:07 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T6000

/usr/bin/uname -p = i386 /bin/uname -X = unknown

/bin/arch = unknown /usr/bin/arch -k = unknown /usr/convex/getsysinfo = unknown /usr/bin/hostinfo = Mach kernel version: Darwin Kernel Version 24.0.0: Tue Sep 24 23:39:07 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T6000 Kernel configured for up to 10 processors. 10 processors are physically available. 10 processors are logically available. Processor type: i486 (Intel 80486) Processors active: 0 1 2 3 4 5 6 7 8 9 Primary memory available: 32.00 gigabytes Default processor set: 938 tasks, 5228 threads, 10 processors Load average: 38.38, Mach factor: 0.25 /bin/machine = unknown /usr/bin/oslevel = unknown /bin/universe = unknown ` config-arm64-osx-dbg-config.log

dg0yt commented 3 weeks ago

I found that in the config-arm64-osx-dbg-config.log, the uname -m command was returning x86_64 instead of arm64.

Does the whole process already run in the wrong environment? config.log reports this PATH:

PATH: /usr/local/sbin/
PATH: /Users/clement_t/projet/email/google-cloud-sdk/bin/
PATH: /Users/clement_t/miniconda3/bin/
PATH: /Users/clement_t/development/flutter/bin/
PATH: /Users/clement_t/bin/
PATH: /usr/local/bin/
PATH: /opt/local/bin/
PATH: /opt/local/sbin/
PATH: /opt/homebrew/bin/
PATH: /opt/homebrew/sbin/
PATH: /usr/local/bin/
PATH: /System/Cryptexes/App/usr/bin/
PATH: /usr/bin/
PATH: /bin/
PATH: /usr/sbin/
PATH: /sbin/
PATH: /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/
PATH: /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/
PATH: /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/
PATH: /opt/X11/bin/
PATH: /Library/Apple/usr/bin/
PATH: /Applications/VMware Fusion.app/Contents/Public/
PATH: /usr/local/go/bin/
PATH: /Library/Frameworks/Mono.framework/Versions/Current/Commands/
PATH: /Users/clement_t/.local/bin/
PATH: /Users/clement_t/.dotnet/tools/
PATH: /Users/clement_t/Library/Android/sdk/tools/
PATH: /Users/clement_t/Library/Android/sdk/platform-tools/
PATH: /Users/clement_t/.local/bin/
PATH: /Users/clement_t/Epitech/celte/celte_vm/build/vcpkg_installed/arm64-osx/tools/gettext/bin/
PATH: /Users/clement_t/vcpkg/downloads/tools/ninja/1.10.2-osx/

Brew uses /usr/local for x64, /opt/homebrew for arm64. So that PATH could be a problem. I don't know which part is contributed by the port, and which is from the environment.

ClementToni commented 3 weeks ago

You were right! The issue was in my environment: export PATH="/usr/local/bin:$PATH" So, CMake or another package was using the x86 version instead of the ARM version.