conan-io / training

(Deprecated) Support code for conan 1.X trainings
MIT License
62 stars 38 forks source link

Conan Essentials course - exercises in "consumer" folder fail the cmake generate step ("cmake ..") #87

Open cppal opened 2 years ago

cppal commented 2 years ago
  include could not find load file:

    /home/conan/training/consumer/conanbuildinfo.cmake

CMake Error at CMakeLists.txt:7 (conan_basic_setup):
  Unknown CMake command "conan_basic_setup".

-- Configuring incomplete, errors occurred!

Same outcome when running the catchup script for exercise #6.

Environment info: running in your docker on an Ubuntu terminal on Windows 11, with Docker for Windows running in WSL mode.

memsharded commented 2 years ago

Hi @cppal

This is weird, it seems there is something that has been changed and is not correct, affecting also the catchup script. I recommend wiping up both the folder and the conan cache (conan remove "*" -f), and then quickly running the catchup script, all steps from 1 to 6.

I would say that you have changed the consumer folder during exercise 4, instead of modifying the cmake_find_package folder or something like that. It would be necessary to have the whole output of the command, not just the last lines: was the cmake generator called? Is there a message saying it generated the file?

Please try the above and let us know

cppal commented 2 years ago

@memsharded Here's something even weirder:

conan@f3914949e97b:~/training$ conan remove "*" -f
WARN: No package recipe matches '*'

And also:

conan search
There are no packages

And to top it up, here's what happens when I try to run step #1 in the catchup script:


Enter choice: 1
performing Exercise 1 (consumer, with CMake)
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=7
os=Linux
os_build=Linux
[options]
[build_requires]
[env]

hello/0.1@user/testing: Not found in local cache, looking in remotes...
hello/0.1@user/testing: Trying with 'conancenter'...
ERROR: Unable to find 'hello/0.1@user/testing' in remot
```es
memsharded commented 2 years ago

But this happens because you have modified the conanfile.txt in the consumer project, to add a [requires] to "hello/0.1@user/testing". But you haven't created it (exercise 5 I think), so it tries to look for it in the local cache, then in the server, and then it fails. You need to start from scratch, or make sure you create the package correctly before trying to reuse it.