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
I expect that there will be a conanbuild.sh in the install folder.
You may argue that there are no environment variables, so conanbuild.sh is irrelevant. I would counter that the file should always be produced, so that a surrounding build script can activate the environment without having to test whether the file is there or not. This could happen using different profiles on different machines, for instance.
If conanbuild.sh is always there, a script can unconditionally do something like this to activate the environment and, say, run CMake:
The source of this bug is a new project at Datalogics where we are really trying to be Conan 2.0 compatible:
Only import from conan, not conans
Use conan.tools.cmake and conan.tools.env.
conan install is the last contact Conan when initiating a build.
Run source dir/dir/conanbuild.sh && cmake -DCONAN_TOOLCHAIN_FILE=... and source dir/dir/conanbuild.sh && cmake --build ... instead of using conan build during development.
So far this has been indeed a feature: Trying to be minimalistic on the user side. If a user does conan install ... and there is no special environment to activate, generating the file for them would pollute a bit more than necessary their folders, and what is worse, it would create the user the feeling that they need to activate that environment, because there might be something there that they need. Introducing more steps in their flow, which we know cause them some annoyance.
So, to be honest, I also understand your point, so I am not sure what would be the best default, if generating them always by default or not. Will ask for further feedback in the team too.
Environment Details (include every applicable attribute)
Steps to reproduce (Include if Applicable)
Given a
conanfile.txt
:...and
profile-without-buildenv
:... and I install it:
$ conan install . -if without-buildenv -pr:h profile-without-buildenv -pr:b profile-without-buildenv
I expect that there will be a conanbuild.sh in the install folder.
You may argue that there are no environment variables, so
conanbuild.sh
is irrelevant. I would counter that the file should always be produced, so that a surrounding build script can activate the environment without having to test whether the file is there or not. This could happen using different profiles on different machines, for instance.If
conanbuild.sh
is always there, a script can unconditionally do something like this to activate the environment and, say, run CMake:Even using the
tools.env.virtualenv:auto_use
config variable doesn't force the existance ofconanbuild.sh
:$ conan install . -if without-buildenv -pr:h profile-without-buildenv -pr:b profile-without-buildenv --conf tools.env.virtualenv:auto_use=True
If the profile has a variable in
buildenv
, it works, of course.profile-with-buildenv
:Logs (Executed commands with output) (Include/Attach if Applicable)
Failure case:
Success case:
The text was updated successfully, but these errors were encountered: