conan-io / conan-center-index

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

Failed `drogon/1.7.5@#be3f0e63b9b4d6af7b6c37694ff77ac7` #11037

Open nitrogene opened 2 years ago

nitrogene commented 2 years ago
[requires]
drogon/1.7.5

[generators]
cmake

[options]
drogon:with_ctl=True
# The following is required due to a bug that will be soon treated
# Once done, remove this line
drogon:shared=True

It does install, but the PATH environment variable does not seem to be updated despite the logs:

-- Installing: /home/jean-pierre/.conan/data/drogon/1.7.5/_/_/package/bd113cdd86326f8704cc2e813f92829321fdea19/bin/dg_ctl
drogon/1.7.5 package(): Packaged 62 '.h' files
drogon/1.7.5 package(): Packaged 3 files: drogon_ctl, dg_ctl, LICENSE
drogon/1.7.5 package(): Packaged 1 '.1' file: libdrogon.so.1
drogon/1.7.5 package(): Packaged 1 '.5' file: libdrogon.so.1.7.5
drogon/1.7.5 package(): Packaged 1 '.so' file: libdrogon.so
drogon/1.7.5: Package 'bd113cdd86326f8704cc2e813f92829321fdea19' created
drogon/1.7.5: Created package revision cd32701d99aef64f694494a3fdad290a
>>>
drogon/1.7.5: Appending PATH environment variable: /home/jean-pierre/.conan/data/drogon/1.7.5/_/_/package/bd113cdd86326f8704cc2e813f92829321fdea19/bin
>>>
conanfile.txt: Generator cmake created conanbuildinfo.cmake
conanfile.txt: Generator txt created conanbuildinfo.txt
conanfile.txt: Aggregating env generators
conanfile.txt: Generated conaninfo.txt
conanfile.txt: Generated graphinfo

Here's what I get when trying to launch dg_ctl:

jean-pierre@XXXXXXX:~/acp_dev/CppRestAPI/drogon/static-site/build$ dg_ctl
dg_ctl : commande introuvable

$PATH does not seem to be updated:

jean-pierre@XXXXXXX:~/acp_dev/CppRestAPI/drogon/static-site/build$ echo $PATH
/sbin:/bin:/usr/bin:/usr/local/bin:/snap/bin:/home/jean-pierre/.local/bin
jean-pierre@TIVDEVLX03:~/acp_dev/CppRestAPI/drogon/static-site/build$ ls /home/jean-pierre/.conan/data/drogon/1.7.5/_/_/package/bd113cdd86326f8704cc2e813f92829321fdea19/bin
dg_ctl  drogon_ctl

But, even if PATH were correctly updated, it would not survive a reboot? Am I missing something ? Wouldn't it be better to put a link into a drogon_tools folder that would sit into the current project build folder ?

Best regards,

Jean-Pierre

toge commented 2 years ago

Please try to use [imports]. https://docs.conan.io/en/latest/reference/conanfile_txt.html?highlight=imports#imports

[imports]
lib, *.so* -> ./lib # Copies all dll files from packages bin folder to my "bin" folder
bin, drogon_ctl* -> ./bin

When executing conan install, conan print out following messages.

conanfile.txt imports(): Copied 2 '.5' files: libdrogon.so.1.7.5, libtrantor.so.1.5.5
conanfile.txt imports(): Copied 2 '.so' files: libdrogon.so, libtrantor.so
conanfile.txt imports(): Copied 2 '.1' files: libdrogon.so.1, libtrantor.so.1
conanfile.txt imports(): Copied 1 file: drogon_ctl

Now you can find drogon_ctl in build/bin. Please execute with LD_LIBRARY_PATH.

>  LD_LIBRARY_PATH=build/lib  build/bin/drogon_ctl
usage: drogon_ctl [-v | --version] [-h | --help] <command> [<args>]
commands list:
create                  create some source files(Use 'drogon_ctl help create' for more information)
press                   Do stress testing(Use 'drogon_ctl help press' for more information)
help                    display this message
version                 display version of this tool
valgur commented 2 months ago

The reported issue occurred with the legacy cmake generator rather than CMakeDeps and VirtualRunEnv or VirtualBuildEnv. Can probably be closed.