-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Description
When libiconv is present in the dependancy graph, running bison on macos fails with:
Command "/Users/runner/.conan2/p/b/bison9608c4a2e0fa9/p/bin/bison
--version" failed with output:
dyld[27434]: Symbol not found: _iconv
Referenced from: <A6201986-6E4F-34B9-AE19-E895FA317793> /Users/runner/.conan2/p/b/bison9608c4a2e0fa9/p/bin/bison
Expected in: <1506F455-FFDA-35C5-BA78-A12712735965> /Users/runner/.conan2/p/b/libic1c62f36c0e7f8/p/lib/libiconv.2.dylib
This happens for example when building qt with qtwebengine enabled https://github.com/eirikb/proof-of-conan/actions/runs/20364740552/job/58517146213#step:11:27680
This is most likely caused by https://stackoverflow.com/questions/57734434/libiconv-or-iconv-undefined-symbol-on-mac-osx
In few words; when building bison binary, libiconv is not in the dependency graph, so the macos system libiconv is used, as can be seen in https://c3i.jfrog.io/artifactory/cci-build-logs/cci/prod/PR-28215/1/package_build_logs/build_log_bison_3_8_2_c3490cbe0078b6fd3eb4cf5ed64144dc_9a523dd17a4da54882f7a1e363b21c4a141d314f.success.txt
When running this compiled bison in an environment where conan package libiconv/* is present, it takes over the system ones, and the function names mismatch between conan and system iconv triggers this crash.
see also #17065 (comment)
Naive solututions could be either to remove libiconv from all package dependencies in macos, or to add it to all packages which actually use it (starting with bison)
Package and Environment Details
- Package Name/Version: bison/*
- Operating System+version: macOS 15.7.2
- Compiler+version: apple-clang 17
- Conan version: conan 2.23.0
- Python version: python 3.11.9
Conan profile
Profile host:
[settings]
arch=armv8
build_type=Release
compiler=apple-clang
compiler.cppstd=17
compiler.libcxx=libc++
compiler.version=17
os=Macos
[options]
*/*:shared=True
qt/*:qtdeclarative=True
qt/*:qtshadertools=True
qt/*:qtwebchannel=True
qt/*:qtwebengine=True
qt/*:qtwebsockets=True
qt/*:with_dbus=True
qt/*:with_odbc=False
qt/*:with_pq=False
Profile build:
[settings]
arch=armv8
build_type=Release
compiler=apple-clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=17
os=Macos
Steps to reproduce
conan create --name qt --version 6.8.3 --build=missing -s compiler.cppstd=17 -o qt/*:with_pq=False -o qt/*:qtwebengine=True -o qt/*:qtshadertools=True -o qt/*:qtdeclarative=True -o qt/*:qtwebchannel=True -o qt/*:with_dbus=True -o qt/*:with_odbc=False -o qt/*:qtwebsockets=True -o */*:shared=True .
I reduced the problem so that it happens in bison test_package
It then fails by calling conan create --name bison --version 3.8.2 --build=missing -o */*:shared=True .
Logs
https://github.com/eirikb/proof-of-conan/actions/runs/20368112128/job/58528115012
Click to expand log
======== Testing the package ========
Removing previously existing 'test_package' build folder: /Users/runner/work/proof-of-conan/proof-of-conan/test_package/build/apple-clang-17-armv8-gnu17-release
bison/3.8.2 (test package): Test package build: build/apple-clang-17-armv8-gnu17-release
bison/3.8.2 (test package): Test package build folder: /Users/runner/work/proof-of-conan/proof-of-conan/test_package/build/apple-clang-17-armv8-gnu17-release
bison/3.8.2 (test package): Writing generators to /Users/runner/work/proof-of-conan/proof-of-conan/test_package/build/apple-clang-17-armv8-gnu17-release/generators
bison/3.8.2 (test package): Generator 'CMakeToolchain' calling 'generate()'
bison/3.8.2 (test package): CMakeToolchain generated: conan_toolchain.cmake
bison/3.8.2 (test package): CMakeToolchain generated: /Users/runner/work/proof-of-conan/proof-of-conan/test_package/build/apple-clang-17-armv8-gnu17-release/generators/CMakePresets.json
bison/3.8.2 (test package): CMakeToolchain generated: /Users/runner/work/proof-of-conan/proof-of-conan/test_package/CMakeUserPresets.json
bison/3.8.2 (test package): Calling generate()
bison/3.8.2 (test package): Generators folder: /Users/runner/work/proof-of-conan/proof-of-conan/test_package/build/apple-clang-17-armv8-gnu17-release/generators
bison/3.8.2 (test package): Generating aggregated env files
bison/3.8.2 (test package): Generated aggregated env files: ['conanbuild.sh']
======== Testing the package: Building ========
bison/3.8.2 (test package): Calling build()
bison/3.8.2 (test package): Running CMake.configure()
bison/3.8.2 (test package): RUN: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/Users/runner/work/proof-of-conan/proof-of-conan/test_package" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/Users/runner/work/proof-of-conan/proof-of-conan/test_package"
-- Using Conan toolchain: /Users/runner/work/proof-of-conan/proof-of-conan/test_package/build/apple-clang-17-armv8-gnu17-release/generators/conan_toolchain.cmake
-- Conan toolchain: Defining libcxx as C++ flags: -stdlib=libc++
-- Conan toolchain: C++ Standard 17 with extensions ON
-- The CXX compiler identification is AppleClang 17.0.0.17000013
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /opt/homebrew/share/cmake/Modules/FindBISON.cmake:245 (message):
Command "/Users/runner/.conan2/p/b/bison0e4e362ff34dd/p/bin/bison
--version" failed with output:
dyld[21392]: Symbol not found: _iconv
Referenced from: <A6201986-6E4F-34B9-AE19-E895FA317793> /Users/runner/.conan2/p/b/bison0e4e362ff34dd/p/bin/bison
Expected in: <1506F455-FFDA-35C5-BA78-A12712735965> /Users/runner/.conan2/p/b/libic07a02da37e1ee/p/lib/libiconv.2.dylib
Call Stack (most recent call first):
CMakeLists.txt:4 (find_package)
-- Found BISON: /Users/runner/.conan2/p/b/bison0e4e362ff34dd/p/bin/bison
BISON_FOUND: TRUE
BISON_EXECUTABLE: /Users/runner/.conan2/p/b/bison0e4e362ff34dd/p/bin/bison
BISON_VERSION:
CMake Error at CMakeLists.txt:15 (message):
BISON_VERSION NOT FOUND
-- Configuring incomplete, errors occurred!
ERROR: bison/3.8.2 (test package): Error in build() method, line 60
cmake.configure()
ConanException: Error 1 while executing