conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
966 stars 1.78k forks source link

[package] boost/1.80.0: Python version check bug #14224

Open xahon opened 2 years ago

xahon commented 2 years ago

Description

When configuring boost it prints a misleading error message

ERROR: boost/1.80.0: Invalid configuration: detected python version Logging command output to file 'C:.conan\4bef32\1\conan_run.log' 3.10 doesn't match conan option Logging command output to file 'D:\dev\cmake-build-debug\conan_run.log' 3.10

The contents of _C:.conan\4bef32\1\conanrun.log (line breaks are kept):

3.10

The contents of _D:\dev\cmake-build-debug\conanrun.log (line breaks are kept):

3.10

3.10

It clearly looks to me like a bug with comparison Output is written to the file incorrectly and it fails to compare files with version to each other

Package and Environment Details

Conan profile

[settings] os=Windows os_build=Windows arch=x86_64 arch_build=x86_64 compiler=Visual Studio compiler.version=17 build_type=Debug [options] [build_requires] [env]

``` class Project(ConanFile): settings = "os", "compiler", "build_type", "arch" generator = "cmake_find_package_multi" def requirements(self): self.requires("boost/1.80.0") def configure(self): self.options["boost"].python_version = "3.10" self.options["boost"].without_atomic = True self.options["boost"].without_chrono = True self.options["boost"].without_container = True self.options["boost"].without_context = True self.options["boost"].without_contract = True self.options["boost"].without_coroutine = True self.options["boost"].without_date_time = True self.options["boost"].without_exception = True self.options["boost"].without_fiber = True self.options["boost"].without_filesystem = True self.options["boost"].without_graph = True self.options["boost"].without_graph_parallel = True self.options["boost"].without_iostreams = True self.options["boost"].without_json = True self.options["boost"].without_locale = True self.options["boost"].without_log = True self.options["boost"].without_math = True self.options["boost"].without_mpi = True self.options["boost"].without_nowide = True self.options["boost"].without_program_options = False # self.options["boost"].without_python = False # self.options["boost"].without_random = True self.options["boost"].without_regex = True self.options["boost"].without_serialization = True self.options["boost"].without_stacktrace = True self.options["boost"].without_system = True self.options["boost"].without_test = True self.options["boost"].without_thread = True self.options["boost"].without_timer = True self.options["boost"].without_type_erasure = True self.options["boost"].without_wave = True ``` ### Steps to reproduce include(cmake/conan.cmake) # https://github.com/conan-io/cmake-conan/blob/develop/conan.cmake conan_cmake_autodetect(settings) conan_cmake_run( BASIC_SETUP CMAKE_TARGETS BUILD missing CONANFILE ${CMAKE_SOURCE_DIR}/conanfile.py SETTINGS ${settings} ) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) ---- then configure cmake ### Logs
Click to expand log ``` -- The C compiler identification is MSVC 19.29.30146.0 -- The CXX compiler identification is MSVC 19.29.30146.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - 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: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Conan: Detected VS runtime: MDd -- Conan: Automatic detection of conan settings from cmake -- Conan: Detected VS runtime: MDd -- Conan: arch was added as an argument. Not using the autodetected one. -- Conan: build_type was added as an argument. Not using the autodetected one. -- Conan: compiler was added as an argument. Not using the autodetected one. -- Conan: compiler.version was added as an argument. Not using the autodetected one. -- Conan: compiler.runtime was added as an argument. Not using the autodetected one. -- Conan: Settings= -s;arch=x86_64;-s;build_type=Debug;-s;compiler=Visual Studio;-s;compiler.version=16;-s;compiler.runtime=MDd -- Conan: checking conan executable -- Conan: Found program C:/Program Files/Python310/Scripts/conan.exe -- Conan: Version found Conan version 1.54.0 -- Conan executing: C:/Program Files/Python310/Scripts/conan.exe install D:/dev/conanfile.py -s arch=x86_64 -s build_type=Debug -s compiler=Visual Studio -s compiler.version=16 -s compiler.runtime=MDd -g=cmake --build=missing DEBUG :conan_api.py [176]: INIT: Using config 'C:\Users\MY_USER\.conan\conan.conf' [2022-11-16 16:48:19,858] DEBUG :tracer.py [156]: CONAN_API: install(path=D:/dev/conanfile.py,name=None,version=None,user=None,channel=None,settings=['arch=x86_64', 'build_type=Debug', 'compiler=Visual Studio', 'compiler.version=16', 'compiler.runtime=MDd'],options=None,env=None,profile_names=None,conf=None,profile_build=ProfileData(profiles=None, settings=None, options=None, env=None, conf=None),remote_name=None,verify=None,manifests=None,manifests_interactive=None,build=['missing'],update=False,generators=['cmake'],no_imports=False,install_folder=None,output_folder=None,lockfile=None,lockfile_out=None,require_overrides=None) [2022-11-16 16:48:19,861] DEBUG :profile_loader.py[120]: PROFILE LOAD: C:\Users\MY_USER\.conan\profiles\default [2022-11-16 16:48:19,864] DEBUG :profile_loader.py[120]: PROFILE LOAD: C:\Users\MY_USER\.conan\profiles\default [2022-11-16 16:48:19,924] Configuration: [settings] arch=x86_64 arch_build=x86_64 build_type=Debug compiler=Visual Studio compiler.runtime=MDd compiler.version=16 os=Windows os_build=Windows [options] [build_requires] [env] DEBUG :graph_builder.py[462]: GRAPH: new_node: boost/1.80.0 [2022-11-16 16:48:19,957] boost/1.80.0: running "C:/Program Files/Python310/python.exe" -c "from __future__ import print_function; import sys; print('{}.{}'.format(sys.version_info[0], sys.version_info[1]))" DEBUG :graph_builder.py[69]: GRAPH: Time to load deps 0.13899827003479004 [2022-11-16 16:48:20,067] boost/1.80.0: running "C:/Program Files/Python310/python.exe" -c "from __future__ import print_function; import sys; print('{}.{}'.format(sys.version_info[0], sys.version_info[1]))" DEBUG :rest_client_common.py[160]: REST: ping: https://center.conan.io/v1/ping [2022-11-16 16:48:20,170] DEBUG :rest_client.py [58]: REST: Cached capabilities for the remote: ['complex_search', 'checksum_deploy', 'revisions', 'matrix_params'] [2022-11-16 16:48:20,496] DEBUG :rest_client_common.py[188]: REST: get: https://center.conan.io/v1/conans/boost/1.80.0/_/_/packages/47119abdd6a89725943a638087aa72f2784de6f6/download_urls [2022-11-16 16:48:20,498] DEBUG :rest_client_common.py[30]: REST ERROR: [2022-11-16 16:48:20,681] DEBUG :graph_builder.py[462]: GRAPH: new_node: b2/4.9.2 [2022-11-16 16:48:20,690] conanfile.py: Installing package Requirements boost/1.80.0 from 'c' - Cache Packages boost/1.80.0:47119abdd6a89725943a638087aa72f2784de6f6 - Build Build requirements b2/4.9.2 from 'c' - Cache Build requirements packages b2/4.9.2:ca33edce272a279b24f87dc0d4cf5bbdcffbc187 - Cache Installing (downloading, building) binaries... b2/4.9.2: Already installed! boost/1.80.0: Applying build-requirement: b2/4.9.2 DEBUG :rest_client_common.py[188]: REST: get: https://center.conan.io/v1/conans/boost/1.80.0/_/_/download_urls [2022-11-16 16:48:20,782] Downloading conan_sources.tgz DEBUG :file_downloader.py[130]: DOWNLOAD: https://center.conan.io/artifactory/api/conan/conan-center/v1/files/_/boost/1.80.0/_/57d50d5c3d4becbffa5eb2fcb718894e/export/conan_sources.tgz [2022-11-16 16:48:21,025] boost/1.80.0: Configuring sources in C:\.conan\93f999\1 DEBUG :file_downloader.py[130]: DOWNLOAD: https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.bz2 [2022-11-16 16:48:23,088] boost/1.80.0: .boost/1.80.0: boost/1.80.0: Apply patch (conan): Fails the build when there is no iconv backend boost/1.80.0: Apply patch (conan): Fails the build when mpi is not configured boost/1.80.0: Apply patch (official): Directory iterators may fail to construct for a network share on Windows prior to 10 boost/1.80.0: Apply patch (official): On Windows, weakly_canonical fails to process paths that start with the "\\?\" prefix boost/1.80.0: Apply patch (official): Containers are not in a valid state after moving boost/1.80.0: Apply patch (official): On POSIX systems that don't support *at APIs, compilation fails due to a missing include boost/1.80.0: Building your package in C:\.conan\4bef32\1 INFO :installer.py [133]: GENERATORS: Writing generators [2022-11-16 16:50:58,801] boost/1.80.0: Generator txt created conanbuildinfo.txt INFO :installer.py [137]: TOOLCHAIN: Writing toolchain [2022-11-16 16:50:58,803] boost/1.80.0: Aggregating env generators DEBUG :build.py [11]: Call conanfile.build() with files in build folder: ['conanbuildinfo.txt'] [2022-11-16 16:50:58,803] boost/1.80.0: Calling build() boost/1.80.0: WARN: replace_in_file didn't find pattern '/* thread_local */' in 'C:\.conan\93f999\1\source_subfolder\boost\stacktrace\detail\libbacktrace_impls.hpp' file. boost/1.80.0: WARN: replace_in_file didn't find pattern '/* static __thread */' in 'C:\.conan\93f999\1\source_subfolder\boost\stacktrace\detail\libbacktrace_impls.hpp' file. boost/1.80.0: WARN: replace_in_file didn't find pattern 'local generic-os = [ set.difference $(all-os) : aix darwin vxworks solaris osf hpux ] ;' in 'C:\.conan\93f999\1\source_subfolder\tools\build\src\tools\gcc.jam' file. boost/1.80.0: WARN: replace_in_file didn't find pattern 'local no-threading = android beos haiku sgi darwin vxworks ;' in 'C:\.conan\93f999\1\source_subfolder\tools\build\src\tools\gcc.jam' file. boost/1.80.0: WARN: Patching user-config.jam boost/1.80.0: running "C:/Program Files/Python310/python.exe" -c "from __future__ import print_function; import sys; print('{}.{}'.format(sys.version_info[0], sys.version_info[1]))" boost/1.80.0: boost/1.80.0: ERROR: Package '47119abdd6a89725943a638087aa72f2784de6f6' build failed boost/1.80.0: WARN: Build folder C:\.conan\4bef32\1 ERROR: boost/1.80.0: Invalid configuration: detected python version Logging command output to file 'C:\.conan\4bef32\1\conan_run.log' 3.10 doesn't match conan option Logging command output to file 'D:\dev\cmake-build-debug\conan_run.log' 3.10 CMake Error at cmake/conan.cmake:529 (message): Conan install failed='6' Call Stack (most recent call first): cmake/conan.cmake:766 (old_conan_cmake_install) CMakeLists.txt:9 (conan_cmake_run) -- Configuring incomplete, errors occurred! See also "D:/dev/cmake-build-debug/CMakeFiles/CMakeOutput.log". ```
jcar87 commented 1 year ago

Hi @xahon - thanks for reporting this issue.

I believe this is cause by Conan being directed to log the output of self.run to a file (either via the config or an environment variable)

Any chance you could try with that setting disabled to see if it fixes the issue? This part of the boost recipe is not frequently tested as the default option is to build it without Python, apologies for this.