conan-io / conan

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

[question] How to disable signing on Xcode #15597

Open Nekto89 opened 9 months ago

Nekto89 commented 9 months ago

What is your question?

Hi! I have a question regarding usage of Xcode for building conan packages. I was using default "Unix Makefiles" generator for some time on macOS but after switching to "Xcode" I'm getting errors. I would like to disable code signing. Is it possible to achieve this natively through conan like other apple-specific options (tools.apple:enable_arc, enable_bitcode, enable_visibility)? For cmake projects it can be done through "-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO" but I would prefer to use more universal way.

Have you read the CONTRIBUTING guide?

jcar87 commented 9 months ago

Hi @Nekto89

We would need more information in order to reproduce this on our end, i.e., what type of errors are you getting?

That attribute is specific to xcode projects generate by CMake - I'm not sure if there needs to be a "universal way" if the issue can only be reproduced with CMake?

Nekto89 commented 9 months ago

Hi @Nekto89

We would need more information in order to reproduce this on our end, i.e., what type of errors are you getting?

That attribute is specific to xcode projects generate by CMake - I'm not sure if there needs to be a "universal way" if the issue can only be reproduced with CMake?

I've just added fmt/*:shared=True to example in cmake-conan. But it can be reproduced without cmake-conan by just manually adding tools.cmake.cmaketoolchain:generator=Xcode to profile for cross-compilation.

git clone https://github.com/Nekto89/cmake-conan.git -b bug/reproduce_sign_xcode
cmake -GXcode -DCMAKE_CONFIGURATION_TYPES=Release -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=../conan_provider.cmake -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=13.7 -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO -B build -S cmake-conan/example
Click for full log ``` -- The C compiler identification is AppleClang 14.0.0.14000029 -- The CXX compiler identification is AppleClang 14.0.0.14000029 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- CMake-Conan: first find_package() found. Installing dependencies with Conan -- CMake-Conan: Checking if a default profile exists /Users/mklymov/.conan2/profiles/default -- CMake-Conan: cmake_system_name=iOS -- CMake-Conan: cmake_osx_sysroot=iphoneos -- CMake-Conan: cmake_osx_deployment_target=13.7 -- CMake-Conan: cmake_system_processor=armv8 -- CMake-Conan: CMake compiler=AppleClang -- CMake-Conan: CMake compiler version=14.0.0.14000029 -- CMake-Conan: [settings] compiler=apple-clang -- CMake-Conan: [settings] compiler.version=14 -- CMake-Conan: Creating profile /Users/mklymov/test/build/conan_host_profile -- CMake-Conan: Profile: [settings] arch=armv8 os=iOS os.version=13.7 os.sdk=iphoneos compiler=apple-clang compiler.version=14 compiler.cppstd=14 compiler.libcxx=libc++ [conf] tools.cmake.cmaketoolchain:generator=Xcode CMake Warning at /Users/mklymov/test/cmake-conan/conan_provider.cmake:535 (message): Cmake-conan: CMakeDeps generator was not defined in the conanfile. Please define the generator as it will be mandatory in the future Call Stack (most recent call first): CMakeLists.txt:7 (find_package) -- CMake-Conan: Installing both Debug and Release -- CMake-Conan: conan install /Users/mklymov/test/cmake-conan/example -of=/Users/mklymov/test/build/conan --profile:host=default;--profile:host=/Users/mklymov/test/build/conan_host_profile;--profile:build=default;-s;build_type=Release;--build=missing;-g;CMakeDeps ======== Input profiles ======== Profile host: [settings] arch=armv8 build_type=Release compiler=apple-clang compiler.cppstd=14 compiler.libcxx=libc++ compiler.version=14 os=iOS os.sdk=iphoneos os.version=13.7 [conf] tools.cmake.cmaketoolchain:generator=Xcode tools.files.download:verify=False Profile build: [settings] arch=armv8 build_type=Release compiler=apple-clang compiler.cppstd=gnu17 compiler.libcxx=libc++ compiler.version=14 os=Macos [conf] tools.files.download:verify=False ======== Computing dependency graph ======== Graph root conanfile.txt: /Users/mklymov/test/cmake-conan/example/conanfile.txt Requirements fmt/9.1.0#551bb6d903fc22780392707fed0efb18 - Cache ======== Computing necessary packages ======== fmt/9.1.0: Checking 9 compatible configurations fmt/9.1.0: Compatible configurations not found in cache, checking servers fmt/9.1.0: '78525c7f3393889082b570280f7691995aa1da55': compiler.cppstd=11 fmt/9.1.0: 'e964b3da4707909f0996f0e3ae28dd220c5ddc39': compiler.cppstd=gnu11 fmt/9.1.0: '578fd60c557dd16aa971372242b3ac52227d2aa9': compiler.cppstd=gnu14 fmt/9.1.0: '6aff105538e0c8b362b4538f77b72c09fe7aca87': compiler.cppstd=17 fmt/9.1.0: 'fc9acf0afe6557e24840095c2d0c4d945dbfc132': compiler.cppstd=gnu17 fmt/9.1.0: 'e5d039413d2fe37b54bf71b52cacdc7297ed4c70': compiler.cppstd=20 fmt/9.1.0: '9e16d3d002fb22b9efdfd681580bf48c155980ef': compiler.cppstd=gnu20 fmt/9.1.0: '7c201255d977668c2ad390a2e10da5bfb16ff78c': compiler.cppstd=23 fmt/9.1.0: 'e9a9b9be9758c5dfd960606c571ebfcbddab0602': compiler.cppstd=gnu23 Requirements fmt/9.1.0#551bb6d903fc22780392707fed0efb18:d938ad5b1dafec136909c10bd83704b27a2d4282 - Build ======== Installing packages ======== -------- Installing package fmt/9.1.0 (1 of 1) -------- fmt/9.1.0: Building from source fmt/9.1.0: Package fmt/9.1.0:d938ad5b1dafec136909c10bd83704b27a2d4282 fmt/9.1.0: Copying sources to build folder fmt/9.1.0: Building your package in /Users/mklymov/.conan2/p/b/fmt76255f9bc3d91/b fmt/9.1.0: Calling generate() fmt/9.1.0: Generators folder: /Users/mklymov/.conan2/p/b/fmt76255f9bc3d91/b/build/generators fmt/9.1.0: CMakeToolchain generated: conan_toolchain.cmake fmt/9.1.0: CMakeToolchain generated: CMakePresets.json fmt/9.1.0: CMakeToolchain generated: ../../src/CMakeUserPresets.json fmt/9.1.0: Generating aggregated env files fmt/9.1.0: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh'] fmt/9.1.0: Calling build() fmt/9.1.0: apply_conandata_patches(): No patches defined in conandata fmt/9.1.0: Running CMake.configure() fmt/9.1.0: RUN: cmake -G "Xcode" -DCMAKE_TOOLCHAIN_FILE="/Users/mklymov/.conan2/p/b/fmt76255f9bc3d91/b/build/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/Users/mklymov/.conan2/p/b/fmt76255f9bc3d91/p" -DFMT_DOC="OFF" -DFMT_TEST="OFF" -DFMT_INSTALL="ON" -DFMT_LIB_DIR="lib" -DFMT_OS="ON" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" "/Users/mklymov/.conan2/p/b/fmt76255f9bc3d91/b/src" -- CMake version: 3.25.1 -- Using Conan toolchain: /Users/mklymov/.conan2/p/b/fmt76255f9bc3d91/b/build/generators/conan_toolchain.cmake -- Conan toolchain: C++ Standard 14 with extensions OFF -- Conan toolchain: Setting BUILD_SHARED_LIBS = ON -- The CXX compiler identification is AppleClang 14.0.0.14000029 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Module support is disabled. -- Version: 9.1.0 -- Build type: Release -- CXX_STANDARD: 14 -- Performing Test has_std_14_flag -- Performing Test has_std_14_flag - Success -- Performing Test has_std_1y_flag -- Performing Test has_std_1y_flag - Success -- Required features: cxx_variadic_templates -- Performing Test HAS_NULLPTR_WARNING -- Performing Test HAS_NULLPTR_WARNING - Success -- Configuring done -- Generating done -- Build files have been written to: /Users/mklymov/.conan2/p/b/fmt76255f9bc3d91/b/build fmt/9.1.0: Running CMake.build() fmt/9.1.0: RUN: cmake --build "/Users/mklymov/.conan2/p/b/fmt76255f9bc3d91/b/build" --config Release Command line invocation: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project FMT.xcodeproj build -target ALL_BUILD -parallelizeTargets -configuration Release -hideShellScriptEnvironment User defaults from command line: HideShellScriptEnvironment = YES IDEPackageSupportUseBuiltinSCM = YES Computing target dependency graph and provisioning inputs Create build description Build description signature: 811e4c49ecb04d7ed131a3188b7ea925 Build description path: /Users/mklymov/.conan2/p/b/fmt76255f9bc3d91/b/build/build/XCBuildData/811e4c49ecb04d7ed131a3188b7ea925-desc.xcbuild note: Building targets in dependency order note: Run script build phase 'Generate CMakeFiles/ALL_BUILD' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'ALL_BUILD' from project 'FMT') note: Run script build phase 'Generate CMakeFiles/ZERO_CHECK' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'ZERO_CHECK' from project 'FMT') /Users/mklymov/.conan2/p/b/fmt76255f9bc3d91/b/build/FMT.xcodeproj: error: Signing for "fmt" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'fmt' from project 'FMT') note: Run script build phase 'CMake PostBuild Rules' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'fmt' from project 'FMT') ** BUILD FAILED ** fmt/9.1.0: ERROR: Package 'd938ad5b1dafec136909c10bd83704b27a2d4282' build failed fmt/9.1.0: WARN: Build folder /Users/mklymov/.conan2/p/b/fmt76255f9bc3d91/b/build ERROR: fmt/9.1.0: Error in build() method, line 95 cmake.build() ConanException: Error 65 while executing CMake Error at /Users/mklymov/test/cmake-conan/conan_provider.cmake:436 (message): Conan install failed='1' Call Stack (most recent call first): /Users/mklymov/test/cmake-conan/conan_provider.cmake:546 (conan_install) CMakeLists.txt:7 (find_package) CMake Error at CMakeLists.txt:7 (find_package): By not providing "Findfmt.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "fmt", but CMake did not find one. Could not find a package configuration file provided by "fmt" with any of the following names: fmtConfig.cmake fmt-config.cmake Add the installation prefix of "fmt" to CMAKE_PREFIX_PATH or set "fmt_DIR" to a directory containing one of the above files. If "fmt" provides a separate development package or SDK, be sure it has been installed. -- Configuring incomplete, errors occurred! ```