vector-of-bool / pitchfork

Pitchfork is a Set of C++ Project Conventions
MIT License
1.08k stars 56 forks source link

Configure fails on windows at zlib2 step #35

Closed MartyLake closed 4 years ago

MartyLake commented 4 years ago

Hello,

I would like to evaluate pitchfork tool. Unfortunately, I can't configure it.

I use cmake 3.14.4 and conan 1.11.1

The configure step fails at zlib. When inspecting my folders, I see a file C:\\Users\\MartyLake\\.conan\\data\\zlib\\1.2.11\\conan\\stable\\package\\46fecbf5b55c9a04d9e1ce376246b1f9e619c3b7.dirty of size 0 instead of (I suppose?) a folder that would contain the zlib lib.

Here is the end of cmake log:

zlib/1.2.11@conan/stable: 
Calling package()

ERROR: zlib/1.2.11@conan/stable: Error in package() method, line 185
    self._rename_libraries()
while calling '_rename_libraries', line 133
    os.rename(current_lib, os.path.join(lib_path, "zlib.lib"))
    FileNotFoundError: [WinError 2] Le fichier spécifié est introuvable: 'C:\\Users\\MartyLake\\.conan\\data\\zlib\\1.2.11\\conan\\stable\\package\\46fecbf5b55c9a04d9e1ce376246b1f9e619c3b7\\lib\\zlibstatic.lib' -> 'C:\\Users\\MartyLake\\.conan\\data\\zlib\\1.2.11\\conan\\stable\\package\\46fecbf5b55c9a04d9e1ce376246b1f9e619c3b7\\lib\\zlib.lib'

CMake Error at build/_pmm/1.3.1/conan.cmake:470 (message):
  Conan install failed [1]:

Call Stack (most recent call first):
  build/_pmm/1.3.1/conan.cmake:495 (_pmm_conan_install_1)
  build/_pmm/1.3.1/conan.cmake:643 (_pmm_conan_install)
  build/_pmm/1.3.1/main.cmake:32 (_pmm_conan)
  build/_pmm/1.3.1/main.cmake:47 (_pmm_project_fn)
  CMakeLists.txt:32 (pmm)

CMake Error at build/_pmm/1.3.1/conan.cmake:500 (message):
  Conan dependencies were not imported (Expected file
  C:/Users/MartyLake/Dev/pitchfork/build/conanbuildinfo.cmake).  You may need to
  run Conan manually (from the build directory).  Ensure you are using the
  'cmake' generator.
Call Stack (most recent call first):
  build/_pmm/1.3.1/conan.cmake:643 (_pmm_conan_install)
  build/_pmm/1.3.1/main.cmake:32 (_pmm_conan)
  build/_pmm/1.3.1/main.cmake:47 (_pmm_project_fn)
  CMakeLists.txt:32 (pmm)

CMake Error at CMakeLists.txt:33 (conan_set_find_paths):
  Unknown CMake command "conan_set_find_paths".
vector-of-bool commented 4 years ago

Hello! I'm so sorry that this issue has sat for so long. :disappointed:

I'm actually familiar with this error, as I hit it while working on a completely unrelated project around the same time. There were some faulty changes in the zlib recipe that caused it to break under certain conditions. I was able to get it resolved with the recipe maintainers, and this should now be fixed.

MartyLake commented 4 years ago

Hello @vector-of-bool , I can still reproduce the same error today. I am at the develop branch. Should I try another one ?

vector-of-bool commented 4 years ago

Can you remove the zlib2 recipe that you have stored on your box? The recipe has a bug, and the fix didn't increment the version, which means it may not have been re-pulled after the bad version was used.

MartyLake commented 4 years ago

So I did conan remove zlib, and ran the configure again.

In the configure logs, in the conan section, I can see that zlib is downloaded:

Requirements
    boost/1.68.0@conan/stable from 'conan-center' - Cache
    bzip2/1.0.6@conan/stable from 'conan-center' - Cache

    catch2/2.3.0@bincrafters/stable from 'conan-center' - Cache
    fmt/5.1.0@bincrafters/stable from 'conan-center' - Cache
    spdlog/1.1.0@bincrafters/stable from 'conan-center' - Cache
    zlib/1.2.11@conan/stable from 'conan-center' - Downloaded

But it still produces the same error. Maybe I don't understand what remove the zlib2 recipe that you have stored on your box means ?

vector-of-bool commented 4 years ago

You understood correctly. I noticed that your error is slightly different than the one that I've seen previously. At this point, I'd refer you to https://github.com/conan-io/conan-center-index to open a ticket there, as this is where the zlib recipe is maintained. I note that the 1.2.11 has had recent revisions, so its likely that its been moving for a while.

MartyLake commented 4 years ago

From now I have never experienced a successful build with the conan build system. Have you considered using only cmake with git-submodules for example?

I will report the error on monday when I have access to my other computer.

vector-of-bool commented 4 years ago

I haven't considered such a case, no. Partially the issue is just that I'm using Conan to pull some deps that transitively pull in zlib (The final executable doesn't even use zlib, but that's what you get when your dependencies are over-eager :disappointed:).

Transitively building the required code with submodules would be much hairier, so I'd prefer to just remove the dependencies or move to dependencies that don't require such fragile build processes. The pf tool is on hold at the moment as I work on other related projects.