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 have a use case where it would be nice to have a conan install --requires package/version work more like a conan install conanfile.py. I would like to be able to install a package and its build dependencies using the --requires option. (Maybe conan install --requires package/version --context=build)
I'm working to produce an offline environment for people to work with conan packages. I've created a custom command that lets a user install a package and its dependencies to a folder. They can then clone whatever repos they want to work in and run without having to worry about conan.
It is working fairly well, but I'm running into an issue with how the conan install command works. If I run conan install conanfile.py, it installs the packages needed to BUILD the conanfile. If I run conan install --requires package/version, this installs the packages needed to RUN the package. For example, this won't install any header-only dependencies. It would be really helpful if there was an option to install the build dependencies too.
Note that I am aware of editable packages, but I wasn't able to get it work out.
My present workaround is to do a conan install followed by a conan cache path to get the recipe location, followed by a conan install on the recipe. It's fairly clunky.
Have you read the CONTRIBUTING guide?
I've read the CONTRIBUTING guide
The text was updated successfully, but these errors were encountered:
I think I understand the issue, but it is also true that the way Conan handles conan install --requires=xxx can make something like this a bit challenging.
A couple of quick questions:
Is your conanfile.py for that package mostly empty, and used just as a named way to be able to install the dependencies (and tool_requires)?
If that is the case, why isn't the flow git clone + conan install working? It seems less clunky.
The challenges can be:
If a package is already built and the binary exists, then its tool_requires are actually not downloaded at all, just the recipes, but the binaries are skipped
If the package is not built and the binary doesn't exist, the tool_requires will be downloaded to build it, but they are in practice private to the package, and not propagated to the consumers of the package, so they cannot be collected.
If the recipe is mostly a named proxy to install dependencies, I think with build_policy="missing" and using the new deploy() method feature that has been merged for 2.0.15 in #15172, it might be an approach to explore
I discovered that I can handle this by adding -c tools.graph:skip_binaries=False. It is not exactly the same as running conan install on the conanfile, but it is close enough and gives me what I need.
I discovered that I can handle this by adding -c tools.graph:skip_binaries=False. It is not exactly the same as running conan install on the conanfile, but it is close enough and gives me what I need.
Good to know. It seems that I didn't fully understand the issue, but if that is working for you, happy about it 🙂
What is your suggestion?
I have a use case where it would be nice to have a
conan install --requires package/version
work more like aconan install conanfile.py
. I would like to be able to install a package and its build dependencies using the--requires
option. (Maybeconan install --requires package/version --context=build
)I'm working to produce an offline environment for people to work with conan packages. I've created a custom command that lets a user install a package and its dependencies to a folder. They can then clone whatever repos they want to work in and run without having to worry about conan.
It is working fairly well, but I'm running into an issue with how the
conan install
command works. If I runconan install conanfile.py
, it installs the packages needed to BUILD the conanfile. If I runconan install --requires package/version
, this installs the packages needed to RUN the package. For example, this won't install any header-only dependencies. It would be really helpful if there was an option to install the build dependencies too.Note that I am aware of editable packages, but I wasn't able to get it work out.
My present workaround is to do a
conan install
followed by aconan cache path
to get the recipe location, followed by aconan install
on the recipe. It's fairly clunky.Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: