conan-io / conan-package-tools

Conan Package Tools. Helps with massive package creation and CI integration (Travis CI, Appveyor...)
MIT License
165 stars 70 forks source link

Suggestions for Effective Lockfile Based Workflow #615

Open Narwhalrus opened 1 year ago

Narwhalrus commented 1 year ago

I've been using CPT as part of my CI pipelines for a few months now and upon reading the documentation on using lockfiles in CI began to wonder if CPT could be used to apply a similar flow for a build matrix.

Assuming I'm not overlooking some feature of CPT that makes this unnecessary, this would prevent depedency upload "race conditions" during CPT package generation.

I see that the ConanMultiPackager class has a lockfile member and constructor argument, but passing a base lockfile results in an error when calling conan create:

conans.errors.ConanException: Lockfiles with --base do not contain profile information, cannot be used. Create a full lockfile

This seems to be per design (https://github.com/conan-io/conan/issues/8144)

Does it make sense to add the flow described in the above issue as an option in CPT?

eg.

conan lock create ... --lockfile-out partial.lock --base
# for each configuration
conan lock create .. --lockfile partial.lock --lockfile-out full.lock -pr <generated_profile>
conan create ... --lockfile full.lock