Since the Conan CMake Installer packages are deprecated I wanted to switch to the new cmake packages on conan-center.
Unfortunately its not working under windows, because only Linux binaries are downloaded when the package is used as a build_require.
I reckon all package recipes for cmake will have this issue, because there is no distinction between Linux and Windows inside the source() method.
conan_data.yml does also only contain urls to the the linux archives.
The old CMake Recipes work fine, by the way.
Configuration for profile x86_64_MinGW:
[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=4.7
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
[env]
The source() method is fine. We are downloading source code there which is the same on all platforms
Unfortunately its not working under windows, because only Linux binaries are downloaded when the package is used as a build_require.
What leads you to this conclusion?
I reckon all package recipes for cmake will have this issue, because there is no distinction between Linux and Windows inside the source() method.
conan_data.yml does also only contain urls to the the linux archives.
The cmake recipe at cci builds from source, so settings.os is not used in the source() method. The conandata.yml contains only source archives.
Can you please remove your current cmake package and download it again?
If the problem persists, can you share the output of conan install cmake/3.16.3@ -pr default?
The
source()method is fine. We are downloading source code there which is the same on all platformsUnfortunately its not working under windows, because only Linux binaries are downloaded when the package is used as a build_require.
What leads you to this conclusion?
Because I only see *.tar.gz archives instead of *.zip files.
The package I used before did download pre built binaries, either for Linux, or Windows.
I just thought the new package would behave the same way.
Actualy the recipe is downloading something and I even have a cmake.exe in my conan cache. But when running it, I get an error telling me a dll is missing. So I assume its downloading the correct files for my platform and my assumptions were not correct. But somehow something is missing. Maybe I have to add something to my system path, but I would assume the package would take care of all its dependencies.
I reckon all package recipes for cmake will have this issue, because there is no distinction between Linux and Windows inside the source() method.
conan_data.yml does also only contain urls to the the linux archives.The cmake recipe at cci builds from source, so
settings.osis not used in thesource()method. Theconandata.ymlcontains only source archives.Can you please remove your current cmake package and download it again?
If the problem persists, can you share the output ofconan install cmake/3.16.3@ -pr default?
This is the output:
conan install cmake/3.16.3@ -pr default
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.cstd=c99
compiler.exception=sjlj
compiler.libcxx=libstdc++11
compiler.threads=win32
compiler.version=5
os=Windows
os_build=Windows
[options]
[build_requires]
[env]
cmake/3.16.3: Not found in local cache, looking in remotes...
cmake/3.16.3: Trying with 'me-common-conan'...
cmake/3.16.3: Trying with 'conan-center'...
Downloading conanmanifest.txt completed [0.17k]
Downloading conanfile.py completed [3.10k]
Downloading conan_export.tgz completed [0.24k]
Decompressing conan_export.tgz completed [0.00k]
cmake/3.16.3: Downloaded recipe revision 0
Installing package: cmake/3.16.3
Requirements
cmake/3.16.3 from 'conan-center' - Downloaded
Packages
cmake/3.16.3:456f15897172eef340fcbac8a70811f2beb26a93 - Download
Installing (downloading, building) binaries...
cmake/3.16.3: Retrieving package 456f15897172eef340fcbac8a70811f2beb26a93 from remote 'conan-center'
Downloading conanmanifest.txt completed [230.17k]
Downloading conaninfo.txt completed [0.32k]
Downloading conan_package.tgz completed [21608.52k]
Decompressing conan_package.tgz completed [0.00k]
cmake/3.16.3: Package installed 456f15897172eef340fcbac8a70811f2beb26a93
cmake/3.16.3: Downloaded package revision 0
cmake/3.16.3: Appending PATH environment variable: D:\.conan\c2c86c\1\bin
But running cmake.exe straight out of the package gives me an error which tells me that MSVCP140D.dll is missing.
And using it as a build_requires I get:
ERROR: DpyTools/2.0.0@me/dev_test: Error in build() method, line 35
cmake.configure(source_folder=".")
ConanException: Error 3221225781 while executing cd D:\.conan\032bef\1 && cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_SYSTEM_NAME="Generic" -DCONAN_IN_LOCAL_CACHE="ON" -DCONAN_COMPILER="arm-none-eabi-gcc" -DCONAN_COMPILER_VERSION="9.2" -DCMAKE_INSTALL_PREFIX="D:\.conan\ca3b86\1" -DCMAKE_INSTALL_BINDIR="bin" -DCMAKE_INSTALL_SBINDIR="bin" -DCMAKE_INSTALL_LIBEXECDIR="bin" -DCMAKE_INSTALL_LIBDIR="lib" -DCMAKE_INSTALL_INCLUDEDIR="include" -DCMAKE_INSTALL_OLDINCLUDEDIR="include" -DCMAKE_INSTALL_DATAROOTDIR="share" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -DCONAN_EXPORTED="1" -Wno-dev D:\.conan\032bef\1\.
It looks like cmake is built in debug mode and you're missing the debug msvc runtimes.
You're building with mingw, so is it correct that visual studio is not installed on your pc?
2 ways to fix this:
Actually visual studio is installed.

Google tells me that msvcp140d.dll belongs to visual studio 2015.
@sanko-oz Are these installed and if they don't, does installing them fix your problem?
Anyways, I believe it is a bug that this package is available in debug configuration.
I installed visual studio 2015, but unfortunately the problem persists.
With the old package recipe everything works as expected.
That's what I expected.
These redistributables do not contain debug version of the runtime libraries.
I think my comment at https://github.com/conan-io/conan-center-index/pull/1761#issuecomment-635425562 should fix this
@sanko-oz
Can you try again in a day or so when these packages are available for sure?
The problem is still potentially present, because the compiler is not included in the package_id, the possibility exists that a debug runtime is used to build the package.
The 3221225781 error indicates a missing library. These binaries have picked up a dependency on "VCRUNTIME140_1D.dll"
Old:

New:

I should also note that those dependency lists are for the "Release" build_type, but are still using the debug runtime.
@robert-shade
Thanks for checking.
I opened https://github.com/conan-io/conan-center-index/pull/1783 . Let's hope that one fixes this.
@robert-shade
Both lists in your screenshots have a dependency on a debug msvc runtime (there is a D suffix on the MSVCP dlls).
Related to the _1 (and _2) suffix: this stackoverflow answer was interesting to me: https://stackoverflow.com/a/62002028/829782
These contain extra functions.
So the newer cmake packages might have been built with a newer visual studio release.
@madebr yeah, I think that's the root of the trouble. The debug dlls aren't in the normal runtime installer. - I still don't understand why the debug runtime is being linked for the "Release" build_type.
Oh! I think I found it. The cmake is being run in the source_subfolder , so it's skipping the CMakeLists.txt in the root that calls conan_basic_setup()
Wow nice find!
But this still leaves the possibility that the ci uses a debug runtime.
So my pr is still required.
I also just found out that it doesn't build on Linux without an openssl package.
Are there any update regarding this issue?
We are facing the exact error number:
ConanException: Error 3221225781 while executing...
on a Microsoft Azure CI agent (Windows 2016, the problem is not appearing on Windows 2019 agents for some reason), and it is preventing us to move our whole infra away from the deprecated cmake_installer/... recipes.
Thank you for reading!
There were several changes in the CMake recipe and, probably more important, in the way CCI builds packages.
Could you please re-try? For the ones of you who tested locally, please make sure to actual use the latest revision