Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] conan install option to also fetch build requirements without building #8558

Closed
GordonJess opened this issue Feb 25, 2021 · 5 comments
Assignees
Milestone

Comments

@GordonJess
Copy link

I am developing a CI flow where each affected dependent (calculated by lockfile build-order) is rebuilt by triggering it's respective pipeline job. I trigger the first layer, those jobs trigger the next layer, and so on, cascading all the way down to the end-product.

When all downstream jobs have finished, I update the original lockfile with the results and generate buildinfo. (I know buildinfo is not currently recommended, but even with the current issues it is still fit for my usage in package promotion.)

In order to generate build info I need to have a cache with all the packages, so I install from the updated lockfile:

conan install app1 --lockfile=complete_app1.lock

and generate the build info:

>conan_build_info --v2 create --lockfile complete_app1.lock build_info.json
�[1m�[31mERROR: Recipe not found: 'cmake_installer/3.15.3@conan/stable'�[0m

but it fails because the install did not fetch the build requirements. I could not find any build policy which would make the build requirements without having to rebuild a package.

I think maybe a workaround would be to parse the lockfile to find the build requirements and use the experimental --lockfile-node-id LOCKFILE_NODE_ID options, but I'd appreciate a neater solution.

@solvingj
Copy link
Contributor

I think this basically boils down to a feature request which is kind of related to this: #8121

Ideally, there would be a way to opt-into installing all the build_requires of a dependency graph or lockfile, even if not calling the build method.

There is already an extensive change to graph evaluation where the plan is to evaluate the whole graph on every operation (instead of the current logic, in which a bunch of things are skipped when build() is not being performed).

@memsharded , is the current plan for Conan 2.0 to always download/install build_requires, even if not building?

@memsharded
Copy link
Member

This seems very related: conan-io/tribe#20, please have a look.

As a temporary workaround, I would try invoking conan info app1 --lockfile=complete_app1.lock --build which might retrieve at least the recipes (but not the binary).

Maybe also #8021 could also help with this need (this is work in progress as well).

@raphael-grimm
Copy link

I just ran into a similar issue, where such a parameter would be advantageous. What is the current recommended workaround to achieve downloading all build and normal requirements of a conan.py? (no previous commands were executed)

@memsharded
Copy link
Member

Hi all

This has been already implemented in Conan 2.0. The 2.0.0-alpha.1 is out there, still missing docs, etc, but that will be the good solution.

With Conan 1.X, one approach could be to do a conan lock, then parse the json and do a conan download of what is there.

@memsharded memsharded added this to the 2.0 milestone Nov 18, 2021
@memsharded
Copy link
Member

Closing this as implemented and released in 2.0.0-alpha1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants