Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[develop2] append_compiler_executables_configuration() breaks libiconv package build #596

Open
ssrobins opened this issue Nov 23, 2023 · 0 comments

Comments

@ssrobins
Copy link
Contributor

When I updated to the latest version of conan_provider.cmake, I started getting this error in a build that depends on the sdl conan package (which, in turn, depends on libiconv):

In file included from /Users/runner/.conan2/p/b/libicef1b3214fbc2a/b/src/srclib/binary-io.c:20:
In file included from /Users/runner/.conan2/p/b/libicef1b3214fbc2a/b/src/srclib/binary-io.h:22:
In file included from ./fcntl.h:56:
In file included from ./sys/types.h:39:
In file included from /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/sys/types.h:128:
/Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/sys/_types/_uid_t.h:31:31: error: cannot combine with previous 'type-name' declaration specifier

I was able to reproduce it with this minimal code:

CMakeLists.txt

cmake_minimum_required(VERSION 3.24)

project(BugRepro)

find_package(Iconv REQUIRED)

conanfile.txt

[requires]
libiconv/1.17

Then run the following commands on macOS (Intel macbook, Monterey 12.6.7) in a directory with the above files:

  1. conan remove libiconv -c
  2. cmake -B build -S . -G Xcode -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=conan_provider.cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_OSX_DEPLOYMENT_TARGET=11.0 -D CMAKE_OSX_ARCHITECTURES=arm64 -D CMAKE_SYSTEM_NAME=iOS

If you repeat the above steps with the call to append_compiler_executables_configuration() in conan_provider.cmake commented out, it works fine.

It'll also work fine if you omit -G Xcode and let the generator default to Makefile.

The presence of this in the generated conf seems to be the root of the problem:

tools.build:compiler_executables={"c":"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang","cpp":"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"}

Without that, the libiconv build was finding the gcc compiler rather than clang. I think the proper thing here would be to fix libiconv to work with clang and I do plan at looking at that. But even if it's fixed, I'm wondering if this feature should not be enabled by default until the conan-center-index continuous integration is actually enforcing that it works?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant