conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
8.22k stars 980 forks source link

[bug] Harfbuzz/7.1.0 build fails #14960

Open FieryFlames opened 1 year ago

FieryFlames commented 1 year ago

Environment details

Steps to reproduce

  1. Have a AS Mac
  2. Run npm i node-imagemagick
  3. Encounter build issue with harfbuzz

Logs

❯ npm install node-magickwand
npm ERR! code 1
npm ERR! path /Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build && node scripts/gen-es6.js lib/index.mjs
npm ERR! Failed to execute '/opt/homebrew/Cellar/node@18/18.17.1/bin/node /opt/homebrew/Cellar/node@18/18.17.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand/lib/binding/darwin-arm64/node-magickwand.node --module_name=node-magickwand --module_path=/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand/lib/binding/darwin-arm64 --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@1.0.11
npm ERR! node-pre-gyp info using node@18.17.1 | darwin | arm64
npm ERR! node-pre-gyp info check checked for "/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand/lib/binding/darwin-arm64/node-magickwand.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/mmomtchev/node-magickwand/releases/download/v0.9.7/darwin-arm64.tar.gz
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/mmomtchev/node-magickwand/releases/download/v0.9.7/darwin-arm64.tar.gz 
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for node-magickwand@0.9.7 and node@18.17.1 (node-v108 ABI, unknown) (falling back to source compile with node-gyp) 
npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/mmomtchev/node-magickwand/releases/download/v0.9.7/darwin-arm64.tar.gz 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.3.1
npm ERR! gyp info using node@18.17.1 | darwin | arm64
npm ERR! gyp info ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.3.1
npm ERR! gyp info using node@18.17.1 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.11.6 found at "/opt/homebrew/opt/python@3.11/bin/python3.11"
npm ERR! gyp info spawn /opt/homebrew/opt/python@3.11/bin/python3.11
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/opt/homebrew/Cellar/node@18/18.17.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/opt/homebrew/Cellar/node@18/18.17.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/jackmatthews/Library/Caches/node-gyp/18.17.1/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/jackmatthews/Library/Caches/node-gyp/18.17.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/opt/homebrew/Cellar/node@18/18.17.1/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/jackmatthews/Library/Caches/node-gyp/18.17.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/pycparser-2.21.dist-info due to invalid metadata entry 'name'
npm ERR! WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/cffi-1.16.0.dist-info due to invalid metadata entry 'name'
npm ERR! DEPRECATION: Loading egg at /opt/homebrew/lib/python3.11/site-packages/mtkclient-1.6.3-py3.11.egg is deprecated. pip 23.3 will enforce this behaviour change. A possible replacement is to use pip for package installation..
npm ERR! WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/pycparser-2.21.dist-info due to invalid metadata entry 'name'
npm ERR! WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/cffi-1.16.0.dist-info due to invalid metadata entry 'name'
npm ERR! WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/pycparser-2.21.dist-info due to invalid metadata entry 'name'
npm ERR! WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/cffi-1.16.0.dist-info due to invalid metadata entry 'name'
npm ERR! WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/pycparser-2.21.dist-info due to invalid metadata entry 'name'
npm ERR! WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/cffi-1.16.0.dist-info due to invalid metadata entry 'name'
npm ERR! 
npm ERR! [notice] A new release of pip is available: 23.2.1 -> 23.3
npm ERR! [notice] To update, run: python3.11 -m pip install --upgrade pip
npm ERR! WARN: openexr/3.1.5: requirement zlib/[>=1.2.11 <2] overridden by your conanfile to zlib/1.2.13 
npm ERR! WARN: freetype/2.13.0: requirement libpng/1.6.40 overridden by fontconfig/2.14.2 to libpng/1.6.39 
npm ERR! WARN: freetype/2.13.0: requirement zlib/[>=1.2.10 <2] overridden by fontconfig/2.14.2 to zlib/1.2.13 
npm ERR! WARN: freetype/2.13.0: requirement brotli/1.1.0 overridden by fontconfig/2.14.2 to brotli/1.0.9 
npm ERR! WARN: libpng/1.6.39: requirement zlib/[>=1.2.11 <2] overridden by freetype/2.13.0 to zlib/1.2.13 
npm ERR! WARN: glib/2.78.0: requirement zlib/[>=1.2.11 <2] overridden by your conanfile to zlib/1.2.13 
npm ERR! WARN: pcre2/10.42: requirement zlib/[>=1.2.11 <2] overridden by glib/2.78.0 to zlib/1.2.13 
npm ERR! WARN: harfbuzz/7.1.0: requirement glib/2.77.0 overridden by your conanfile to glib/2.78.0 
npm ERR! WARN: libheif/1.13.0: requirement libde265/1.0.12 overridden by your conanfile to libde265/1.0.11 
npm ERR! WARN: libraw/0.21.1: requirement libjpeg-turbo/2.1.5 overridden by your conanfile to libjpeg-turbo/3.0.0 
npm ERR! WARN: libtiff/4.6.0: requirement zlib/[>=1.2.11 <2] overridden by your conanfile to zlib/1.2.13 
npm ERR! WARN: libxml2/2.10.4: requirement zlib/[>=1.2.11 <2] overridden by your conanfile to zlib/1.2.13 
npm ERR! WARN: libzip/1.9.2: requirement zlib/[>=1.2.11 <2] overridden by your conanfile to zlib/1.2.13 
npm ERR! WARN: libzip/1.9.2: requirement xz_utils/5.4.2 overridden by your conanfile to xz_utils/5.4.4 
npm ERR! WARN: openssl/3.1.3: requirement zlib/[>=1.2.11 <2] overridden by libzip/1.9.2 to zlib/1.2.13 
npm ERR! harfbuzz/7.1.0: WARN: Package binary is corrupted, removing: 4b6a6193d24485c01c73fda8ce1844d971a9fd4b
npm ERR! WARN: pcre2/10.42: requirement zlib/[>=1.2.11 <2] overridden by glib/2.78.0 to zlib/1.2.13 
npm ERR! CMake Deprecation Warning at CMakeLists.txt:10 (cmake_minimum_required):
npm ERR!   Compatibility with CMake < 3.5 will be removed from a future version of
npm ERR!   CMake.
npm ERR! 
npm ERR!   Update the VERSION argument <min> value or use a ...<max> suffix to tell
npm ERR!   CMake that the project does not need compatibility with older versions.
npm ERR! 
npm ERR! 
npm ERR! harfbuzz/7.1.0: WARN: Build folder is dirty, removing it: /Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b
npm ERR! harfbuzz/7.1.0: ERROR: Package '4b6a6193d24485c01c73fda8ce1844d971a9fd4b' build failed
npm ERR! harfbuzz/7.1.0: WARN: Build folder /Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b/build-release
npm ERR! ERROR: harfbuzz/7.1.0: Error in build() method, line 161
npm ERR!        meson.configure()
npm ERR!        ConanException: Error 1 while executing meson setup --native-file "/Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b/build-release/conan/conan_meson_native.ini" "/Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b/build-release" "/Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b/src" -Dprefix="/Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/package/4b6a6193d24485c01c73fda8ce1844d971a9fd4b"
npm ERR! gyp: Call to '(pip3 install --user "conan<2.0.0" && cd build && python3 -m conans.conan install .. -pr:b=default -of build --build=missing --build=openjpeg) > /dev/null' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/opt/homebrew/Cellar/node@18/18.17.1/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:325:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 23.0.0
npm ERR! gyp ERR! command "/opt/homebrew/Cellar/node@18/18.17.1/bin/node" "/opt/homebrew/Cellar/node@18/18.17.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand/lib/binding/darwin-arm64/node-magickwand.node" "--module_name=node-magickwand" "--module_path=/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand/lib/binding/darwin-arm64" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v108"
npm ERR! gyp ERR! cwd /Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand
npm ERR! gyp ERR! node -v v18.17.1
npm ERR! gyp ERR! node-gyp -v v9.3.1
npm ERR! gyp ERR! not ok 
npm ERR! node-pre-gyp ERR! build error 
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/opt/homebrew/Cellar/node@18/18.17.1/bin/node /opt/homebrew/Cellar/node@18/18.17.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand/lib/binding/darwin-arm64/node-magickwand.node --module_name=node-magickwand --module_path=/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand/lib/binding/darwin-arm64 --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! node-pre-gyp ERR! System Darwin 23.0.0
npm ERR! node-pre-gyp ERR! command "/opt/homebrew/Cellar/node@18/18.17.1/bin/node" "/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand
npm ERR! node-pre-gyp ERR! node -v v18.17.1
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.11
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in: /Users/jackmatthews/.npm/_logs/2023-10-18T04_48_25_721Z-debug-0.log
FieryFlames commented 1 year ago

Originally posted at https://github.com/mmomtchev/node-magickwand/issues/51#issue-1948826621

memsharded commented 1 year ago

Thanks for the report @FieryFlames

In order to debug this, we would need a bit more of context and isolation. If the build of some recipe from ConanCenter is failing we should be able to reproduce it. I would suggest:

Some things that could be failing:

FieryFlames commented 1 year ago

I couldn't determine the Conan version, I've never used Conan before. I will continue debugging and try to reproduce outside of node-imagemagick later today.

FieryFlames commented 1 year ago

Okay, I believe I have Conan 1.61. The following is the end of the result of conan install harfbuzz/7.1.0@ --build=harfbuzz --build=brotli --build=glib --build=libpng (the original suggested I add those as there was no prebuilts). I was unable to copy the full output out of my terminal.

harfbuzz/7.1.0: Applying build-requirement: meson/1.1.0
harfbuzz/7.1.0: Applying build-requirement: pkgconf/1.9.3
harfbuzz/7.1.0: Applying build-requirement: gettext/0.21
harfbuzz/7.1.0: Applying build-requirement: ninja/1.11.1
harfbuzz/7.1.0: WARN: Build folder is dirty, removing it: /Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b
harfbuzz/7.1.0: Copying sources to build folder
harfbuzz/7.1.0: Building your package in /Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b
harfbuzz/7.1.0: Generator txt created conanbuildinfo.txt
harfbuzz/7.1.0: Calling generate()
harfbuzz/7.1.0: WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
harfbuzz/7.1.0: Aggregating env generators
harfbuzz/7.1.0: Calling build()
harfbuzz/7.1.0: apply_conandata_patches(): No patches defined in conandata
harfbuzz/7.1.0: Meson configure cmd: meson setup --native-file "/Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b/build-release/conan/conan_meson_native.ini" "/Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b/build-release" "/Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b/src" -Dprefix="/Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/package/4b6a6193d24485c01c73fda8ce1844d971a9fd4b"
The Meson build system
Version: 1.1.0
Source dir: /Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b/src
Build dir: /Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b/build-release
Build type: native build
Project name: harfbuzz
Project version: 7.1.0

../src/meson.build:1:0: ERROR: Unable to detect linker for compiler `clang -Wl,--version -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -arch arm64`
stdout:
stderr: ld: unknown options: --version
clang: error: linker command failed with exit code 1 (use -v to see invocation)

A full log can be found at /Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b/build-release/meson-logs/meson-log.txt
harfbuzz/7.1.0:
harfbuzz/7.1.0: ERROR: Package '4b6a6193d24485c01c73fda8ce1844d971a9fd4b' build failed
harfbuzz/7.1.0: WARN: Build folder /Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b/build-release
ERROR: harfbuzz/7.1.0: Error in build() method, line 161
    meson.configure()
    ConanException: Error 1 while executing meson setup --native-file "/Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b/build-release/conan/conan_meson_native.ini" "/Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b/build-release" "/Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b/src" -Dprefix="/Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/package/4b6a6193d24485c01c73fda8ce1844d971a9fd4b"
franramirez688 commented 1 year ago

Hi @FieryFlames,

I faced the same problem, which seems related to meson < 1.2.x and the latest version of macOS Sonoma + Clang 15. I just opened an issue in the meson repository: https://github.com/mesonbuild/meson/issues/12399

As a workaround, you can override the meson/1.1.0 version by adding another profile or changing your default one. Let's create a little wrapper of your default profile in your current working directory. Create an empty file named using_meson_1_2_2 and add this content:

using_meson_1_2_2

include(default)

[tool_requires]
meson/1.2.2

Now, run your latest command, but adding this param -pr using_meson_1_2_2 at the end of it:

conan install harfbuzz/7.1.0@ --build=harfbuzz --build=brotli --build=glib --build=libpng -pr using_meson_1_2_2

It should work now:

....

a4346565c0645d6abe24f/lib/cmake/harfbuzz
Installing /Users/franchuti/.conan/data/harfbuzz/7.1.0/_/_/build/fb058d56e1d5c473125a4346565c0645d6abe24f/build-release/meson-private/harfbuzz-gobject.pc to /Users/franchuti/.conan/data/harfbuzz/7.1.0/_/_/package/fb058d56e1d5c473125a4346565c0645d6abe24f/lib/pkgconfig
harfbuzz/7.1.0 package(): Packaged 1 file: COPYING
harfbuzz/7.1.0 package(): Packaged 37 '.h' files
harfbuzz/7.1.0 package(): Packaged 1 '.hh' file: hb-cplusplus.hh
harfbuzz/7.1.0 package(): Packaged 3 '.a' files: libharfbuzz-gobject.a, libharfbuzz.a, libharfbuzz-subset.a
harfbuzz/7.1.0: Package 'fb058d56e1d5c473125a4346565c0645d6abe24f' created
harfbuzz/7.1.0: Created package revision c5a5afcfb71fec20efde11c72c95f85d
Aggregating env generators