Closed GordonJess closed 4 years ago
Hi @GordonJess
Sorry, update from my response, I didn't read it correctly.
I am not sure what could be happening, it might be that the build-require is dropped at some step. I would need to check the intermediate steps and what is being obtained as a result of the build processes. One of the things that changed is that now, the UI is more explicit, it is necessary to use --lockfile-out
arg to get the modified lockfile with the result of the build.
Could you please provide something that I could check, including the build-order
and install/create
commands, and what lockfiles are being generated at each step? If you prefer you could zip something and attach, and I can check here. Many thanks!
Hi @memsharded,
I think maybe I used the --build
flag at the wrong place before...
I have now added it when deriving the configuration-specific lockfile from the base:
conan lock create ../conanfile.py --user=Concepts --channel=master --lockfile=locks/libb_base.lock --lockfile-out=locks/libb_cfg1.lock --profile=my_profile --build
This avoids the error message from the issue description however the build_requires (although already existing in the cache from when the initial package was created) is output in the calculated build-order:
C:\ci_test\libb\build> conan lock build-order locks/app1_cfg0.lock --json=build_order/app1_cfg0.json
[[('cmake_installer/3.15.3@conan/stable#0', '60b04a80ac4dd5c23f1acffacc679e9902e636e5', 'host', '10')], [('liba/0.1@Concepts/master#c960eb1771be6c094332069fb511f9c7', '5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9', 'host', '1')], [('libb/0.2@Concepts/master#a8db729478ee8cdf09eded1a4e0b8884', 'Package_ID_unknown', 'host', '0'), ('libc/0.1@Concepts/master#9ec9b5aad5bafc8c4bfac176f3acc947', 'Package_ID_unknown', 'host', '5')], [('libd/0.1@Concepts/master#385c7ef15cbad2fe4901a2b60bd3cacd', 'Package_ID_unknown', 'host', '4')], [('app1/0.1@Concepts/master#44b74fb44dfa512b82bfc6190a51f4f5', 'Package_ID_unknown', 'host', '3')]]
Any ideas how to avoid this unnecessary rebuilding?
Thanks, I'll try send a .zip later on!
Hi @memsharded,
Here is my modified example with build requires. You will see that cmake_installer/3.15.3@conan/stable
is rebuilt from sources as a result of the build-order output.
Thanks!
Hi @GordonJess
Yes, this behavior is expected: The --build
has exactly the same semantics as if you do a conan install --build
which means build everything in source. In fact, it tries to achieve the exact same result, but with immutability guarantees that allow to distribute a build and be sure that dependencies don't change.
So if you don't want to rebuild from sources the cmake_installer
package, then you need to provide the desired build policy to the conan lock create
(typically is a combination of package_id_mode
and --build=missing
), to define what needs to be built from sources and what not. Please try this approach and let me know.
Hi @memsharded.
Ah, got it! Thanks! --build=missing
when creating the lockfile works.
Excellent, very happy that it is working.
which is looking great btw
Good! I was quite happy about the final result, I think it is a good step forward for lockfiles. Looking forward to hearing more feedback and reported issues if necessary to keep improving. Thanks!
I am following the example for Lockfiles in CI, which is looking great btw, only it does not mention anything about
build_requires
.When I am deriving a full lockfile for a product from a base lockfile, my profile contains the
cmake_installer
package as a build_requirement. After computing the build order and firing the parallel build commands I receive the error:Previously, using the
conan graph lock
commands I forced this using the --build flag, but this doesn't seem to have any effect.Lockfile contents: