You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have the PR conan-io/conan-center-index#24054 which simplifies the test package by only building a test application and running a packaged tool.
When trying to run the packaged tool, there is no PATH configured by VirtualRunEnv generator, resulting in failure when calling self.run(... , env='conanrun')
After talking with @RubenRBS , it's related to the package type of the recipe: library. The recipe packages not only libraries, but applications too.
The documentation is not clear about this situation, because VirtualRunEnv says:
Also automatically deduced from the self.cpp_info definition of the package to define PATH.
...
conanrunenv-release-x86_64.(bat|ps1|sh): This file contains the actual definition of environment variables like PATH, LD_LIBRARY_PATH, etc, and runenv_info of dependencies corresponding to the host context, and to the current installed configuration. If a repeated call is done with other settings, a different file will be created.
Reading this section I understand PATH would be available too.
As workaround, we need to force the PATH via the recipe, like:
Yes, you can't have both automatically, you cannot have a regular requires and run applications from it while being in the host context.
Note that adding it to the PATH while it is in the host context might confuse the users which might find the wrong executable when they pretended to use such executable as a tool_requires in the "build" context.
Another possibility would be that the self.requires(self.tested_reference_str, run=True) to force it to appear as a "run" requirement that will probably work.
What is your question?
We have the PR conan-io/conan-center-index#24054 which simplifies the test package by only building a test application and running a packaged tool.
When trying to run the packaged tool, there is no PATH configured by
VirtualRunEnv
generator, resulting in failure when callingself.run(... , env='conanrun')
After talking with @RubenRBS , it's related to the package type of the recipe:
library
. The recipe packages not only libraries, but applications too.The documentation is not clear about this situation, because VirtualRunEnv says:
Reading this section I understand PATH would be available too.
As workaround, we need to force the PATH via the recipe, like:
Is there a better/correct way to manage this situation: Be able to call
self.run("...", env='conanrun')
without changing the PATH manually?/cc @ErniGH
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: