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

[package] cmake/3.16.3: not working for Windows #1705

Closed
sanko-oz opened this issue May 22, 2020 · 22 comments
Closed

[package] cmake/3.16.3: not working for Windows #1705

sanko-oz opened this issue May 22, 2020 · 22 comments
Labels
bug Something isn't working

Comments

@sanko-oz
Copy link

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.

Package and Environment Details

  • Package Name/Version: cmake/3.16.3
  • Operating System+version: Windows 7
  • Compiler+version: GCC 4.7
  • Conan version: conan 1.25.0
  • Python version: Python 3.7.1

Conan profile

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]
@sanko-oz sanko-oz added the bug Something isn't working label May 22, 2020
@Croydon
Copy link
Contributor

Croydon commented May 23, 2020

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?

@madebr
Copy link
Contributor

madebr commented May 23, 2020

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?

@sanko-oz
Copy link
Author

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?

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.

@sanko-oz
Copy link
Author

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?

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\.

@madebr
Copy link
Contributor

madebr commented May 25, 2020

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:

@sanko-oz
Copy link
Author

Actually visual studio is installed.

image

@madebr
Copy link
Contributor

madebr commented May 25, 2020

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.

@madebr madebr mentioned this issue May 25, 2020
4 tasks
@sanko-oz
Copy link
Author

I installed visual studio 2015, but unfortunately the problem persists.
With the old package recipe everything works as expected.

@madebr
Copy link
Contributor

madebr commented May 28, 2020

That's what I expected.
These redistributables do not contain debug version of the runtime libraries.
I think my comment at #1761 (comment) should fix this

@madebr
Copy link
Contributor

madebr commented May 29, 2020

@sanko-oz
#1761 just got merged.
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.

@robert-shade
Copy link
Contributor

The 3221225781 error indicates a missing library. These binaries have picked up a dependency on "VCRUNTIME140_1D.dll"

Old:
image

New:
image

@robert-shade
Copy link
Contributor

I should also note that those dependency lists are for the "Release" build_type, but are still using the debug runtime.

@madebr
Copy link
Contributor

madebr commented May 29, 2020

@robert-shade
Thanks for checking.
I opened #1783 . Let's hope that one fixes this.

@madebr
Copy link
Contributor

madebr commented May 30, 2020

@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.

@robert-shade
Copy link
Contributor

robert-shade commented May 30, 2020

@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.

@robert-shade
Copy link
Contributor

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()

@madebr
Copy link
Contributor

madebr commented May 30, 2020

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.

@Adnn
Copy link
Contributor

Adnn commented Jun 10, 2020

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!

@Croydon
Copy link
Contributor

Croydon commented Oct 27, 2020

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

@Croydon
Copy link
Contributor

Croydon commented Jan 9, 2021

Friendly reminder to re-try, otherwise I think we should close this issue

@sanko-oz
Copy link
Author

sanko-oz commented Jan 11, 2021

Sorry... I totally forgot this issue and just saw a notification mail in my mailbox...
I believe I already tried it a couple of months ago and the first try was unsuccessful and I stopped due to other priorities.

But I retried it and now it seems to work as expected for me. Thank you very much!

@Croydon
Copy link
Contributor

Croydon commented Jan 11, 2021

Thank you for the feedback. Please close the issue then 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants