conan-io / conan-center-index

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

[package] onnx/1.15.0: Can not be built if conan was installed via Windows installer #22636

Open Vobraz opened 8 months ago

Vobraz commented 8 months ago

Description

Package can not be built if conan was installed via Windows installer The reason is that the recipe use the python executable, and it's path obtained like: tc.variables["PYTHON_EXECUTABLE"] = sys.executable.replace("\\", "/") "sys.executable" will be ".../python.exe" only if conan was installed via pip, but with Windows installer it is ".../conan.exe" Line: https://github.com/conan-io/conan-center-index/blob/f26e57ef872d654653b4ae612fffb05fb753b645/recipes/onnx/all/conanfile.py#L106 Commit: https://github.com/conan-io/conan-center-index/commit/d0fc51d52a40650a2376437935e1d353003ebfc4

Package and Environment Details

Conan profile

[settings] arch=x86_64 build_type=Debug compiler=msvc compiler.cppstd=20 compiler.runtime=dynamic compiler.runtime_type=Debug compiler.version=193 os=Windows

Steps to reproduce

conan install --require onnx/1.15.0 -s build_type=Debug --build missing

Logs

Click to expand log ``` ======== Input profiles ======== Profile host: [settings] arch=x86_64 build_type=Debug compiler=msvc compiler.cppstd=20 compiler.runtime=dynamic compiler.runtime_type=Debug compiler.version=193 os=Windows Profile build: [settings] arch=x86_64 build_type=Release compiler=msvc compiler.cppstd=20 compiler.runtime=dynamic compiler.runtime_type=Release compiler.version=193 os=Windows ======== Computing dependency graph ======== Graph root cli Requirements onnx/1.15.0#0f668bd44c6ab5e08b17ab4af13203f6 - Cache protobuf/3.21.12#ed2404ae366627005beb2173eab68174 - Cache zlib/1.3#06023034579559bb64357db3a53f88a4 - Cache Build requirements protobuf/3.21.12#ed2404ae366627005beb2173eab68174 - Cache zlib/1.3#06023034579559bb64357db3a53f88a4 - Cache Resolved version ranges zlib/[>=1.2.11 <2]: zlib/1.3 ======== Computing necessary packages ======== protobuf/3.21.12: Checking 3 compatible configurations protobuf/3.21.12: Main binary package 'e762180897c5c92d4655e2dd7b54c4d4225df5e4' missing. Using compatible package '9a546d3c2c7b2b02ebec30698e8536173849d86f': compiler.cppstd=14 onnx/1.15.0: Checking 2 compatible configurations onnx/1.15.0: Compatible configurations not found in cache, checking servers onnx/1.15.0: 'b2433750cef6f375a867309e8ddab0bbe9b1a0d1': compiler.cppstd=17 onnx/1.15.0: 'c6278a2ee25e2868c4a09c12773030cd4f555262': compiler.cppstd=23 Requirements onnx/1.15.0#0f668bd44c6ab5e08b17ab4af13203f6:1200420ad74a74cba8f5b76599dab41735b18892 - Build protobuf/3.21.12#ed2404ae366627005beb2173eab68174:9e59c2e778d65e6e544dd6e21cb49680f810c33a#e854697bbe73f95067173c3e85bf54f7 - Cache zlib/1.3#06023034579559bb64357db3a53f88a4:ed44dacde2751b398e4bf9441ff992a70c913c00#7b093339b8c54a731db48cb39e249fcd - Cache Build requirements protobuf/3.21.12#ed2404ae366627005beb2173eab68174:9a546d3c2c7b2b02ebec30698e8536173849d86f#588af8873e534fedec73b03cc8736218 - Cache Skipped binaries zlib/1.3 ======== Installing packages ======== zlib/1.3: Already installed! (1 of 4) protobuf/3.21.12: Already installed! (2 of 4) protobuf/3.21.12: Already installed! (3 of 4) -------- Installing package onnx/1.15.0 (4 of 4) -------- onnx/1.15.0: Building from source onnx/1.15.0: Package onnx/1.15.0:1200420ad74a74cba8f5b76599dab41735b18892 onnx/1.15.0: Copying sources to build folder onnx/1.15.0: Building your package in C:\Users\user\.conan2\p\b\onnx35363824559f2\b onnx/1.15.0: Calling generate() onnx/1.15.0: Generators folder: C:\Users\user\.conan2\p\b\onnx35363824559f2\b\build\generators onnx/1.15.0: CMakeToolchain generated: conan_toolchain.cmake onnx/1.15.0: CMakeToolchain generated: CMakePresets.json onnx/1.15.0: CMakeToolchain generated: ..\..\src\CMakeUserPresets.json onnx/1.15.0: CMakeDeps necessary find_package() and targets for your CMakeLists.txt find_package(protobuf) target_link_libraries(... protobuf::protobuf) onnx/1.15.0: Generating aggregated env files onnx/1.15.0: Generated aggregated env files: ['conanbuild.bat', 'conanrun.bat'] onnx/1.15.0: Calling build() onnx/1.15.0: apply_conandata_patches(): No patches defined in conandata onnx/1.15.0: Running CMake.configure() onnx/1.15.0: RUN: cmake -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE="C:/Users/user/.conan2/p/b/onnx35363824559f2/b/build/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="C:/Users/user/.conan2/p/b/onnx35363824559f2/p" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" "C:\Users\user\.conan2\p\b\onnx35363824559f2\b\src" CMake Deprecation Warning at CMakeLists.txt:2 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake. Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions. -- Build type not set - defaulting to Release -- Using Conan toolchain: C:/Users/user/.conan2/p/b/onnx35363824559f2/b/build/generators/conan_toolchain.cmake -- Conan toolchain: CMAKE_GENERATOR_TOOLSET=v143 -- Conan toolchain: C++ Standard 20 with extensions OFF -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045. -- The C compiler identification is MSVC 19.37.32825.0 -- The CXX compiler identification is MSVC 19.37.32825.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/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/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Warning (dev) at CMakeLists.txt:112 (find_package): Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules are removed. Run "cmake --help-policy CMP0148" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. -- Found PythonInterp: C:/Program Files/Conan/conan/conan.exe -- Conan: Component target declared 'protobuf::libprotobuf' -- Conan: Component target declared 'protobuf::libprotoc' -- Conan: Target declared 'protobuf::protobuf' -- Conan: Target declared 'ZLIB::ZLIB' -- Conan: Including build module from 'C:/Users/user/.conan2/p/b/proto14a63dc8a0668/p/lib/cmake/protobuf/protobuf-generate.cmake' -- Conan: Including build module from 'C:/Users/user/.conan2/p/b/proto14a63dc8a0668/p/lib/cmake/protobuf/protobuf-module.cmake' -- Conan: Including build module from 'C:/Users/user/.conan2/p/b/proto14a63dc8a0668/p/lib/cmake/protobuf/protobuf-options.cmake' -- ONNX_PROTOC_EXECUTABLE: C:/Users/user/.conan2/p/proto947e54966ee5e/p/bin/protoc.exe -- Protobuf_VERSION: 3.21.12 Generated: C:/Users/user/.conan2/p/b/onnx35363824559f2/b/build/onnx/onnx-ml.proto Generated: C:/Users/user/.conan2/p/b/onnx35363824559f2/b/build/onnx/onnx-operators-ml.proto Generated: C:/Users/user/.conan2/p/b/onnx35363824559f2/b/build/onnx/onnx-data.proto -- -- ******** Summary ******** -- CMake version : 3.27.4 -- CMake command : C:/Program Files/CMake/bin/cmake.exe -- System : Windows -- C++ compiler : C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe -- C++ compiler version : 19.37.32825.0 -- CXX flags : /MP8 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /EHsc /wd26812 -- Build type : Release -- Compile definitions : __STDC_FORMAT_MACROS -- CMAKE_PREFIX_PATH : C:/Users/user/.conan2/p/b/onnx35363824559f2/b/build/generators;C:/Users/user/.conan2/p/b/proto14a63dc8a0668/p/lib/cmake/protobuf;C:/Users/user/.conan2/p/proto947e54966ee5e/p/lib/cmake/protobuf -- CMAKE_INSTALL_PREFIX : C:/Users/user/.conan2/p/b/onnx35363824559f2/p -- CMAKE_MODULE_PATH : C:/Users/user/.conan2/p/b/proto14a63dc8a0668/p/lib/cmake/protobuf;C:/Users/user/.conan2/p/b/onnx35363824559f2/b/build/generators;C:/Users/user/.conan2/p/b/proto14a63dc8a0668/p/lib/cmake/protobuf;C:/Users/user/.conan2/p/proto947e54966ee5e/p/lib/cmake/protobuf -- -- ONNX version : 1.15.0 -- ONNX NAMESPACE : onnx -- ONNX_USE_LITE_PROTO : False -- USE_PROTOBUF_SHARED_LIBS : False -- Protobuf_USE_STATIC_LIBS : ON -- ONNX_DISABLE_EXCEPTIONS : OFF -- ONNX_DISABLE_STATIC_REGISTRATION : False -- ONNX_WERROR : OFF -- ONNX_BUILD_TESTS : OFF -- ONNX_BUILD_BENCHMARKS : OFF -- ONNX_BUILD_SHARED_LIBS : -- BUILD_SHARED_LIBS : -- -- Protobuf compiler : C:/Users/user/.conan2/p/proto947e54966ee5e/p/bin/protoc.exe -- Protobuf includes : -- Protobuf libraries : -- BUILD_ONNX_PYTHON : OFF -- Configuring done (7.7s) -- Generating done (0.2s) -- Build files have been written to: C:/Users/user/.conan2/p/b/onnx35363824559f2/b/build onnx/1.15.0: Running CMake.build() onnx/1.15.0: RUN: cmake --build "C:\Users\user\.conan2\p\b\onnx35363824559f2\b\build" --config Debug Версия MSBuild 17.7.2+d6990bcfa для .NET Framework 1>Checking Build System Running gen_proto.py on onnx/onnx.in.proto 'C:/Users/user/.conan2/p/b/onnx35363824559f2/b/src/onnx/gen_proto.py' is not a Conan command. See 'conan --help'. CUSTOMBUILD : error : Unknown command 'C:/Users/user/.conan2/p/b/onnx35363824559f2/b/src/onnx/gen_proto.py' [C:\Users\user\.conan2\p\b\onnx35363824559f2\b\build\gen_onnx_proto.vcxproj] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(249,5): error MSB8066: Custom build for 'C:\Users\user\.conan2\p\b\onnx3536382455 9f2\b\build\CMakeFiles\f11b898305996e973daf7248067bdfe8\onnx-ml.proto.rule;C:\Users\user\.conan2\p\b\onnx35363824559f2\b\build\CMakeFiles\f11b898305996e973daf7248067bdfe8\onnx-ml.pb.cc.rule;C :\Users\user\.conan2\p\b\onnx35363824559f2\b\build\CMakeFiles\9b0701b3f8764bc9354923c0250431e3\gen_onnx_proto.rule;C:\Users\user\.conan2\p\b\onnx35363824559f2\b\src\CMakeLists.txt' exited with code 1. [C:\Users\user\.conan2\p\b\onnx35363824559f2\b\build\gen_onnx_proto.vcxproj] onnx/1.15.0: ERROR: Package '1200420ad74a74cba8f5b76599dab41735b18892' build failed onnx/1.15.0: WARN: Build folder C:\Users\user\.conan2\p\b\onnx35363824559f2\b\build ERROR: onnx/1.15.0: Error in build() method, line 131 cmake.build() ConanException: Error 1 while executing ```
Vobraz commented 8 months ago

Also mentioned here https://github.com/conan-io/conan-center-index/issues/21790#issuecomment-1859147337