conan-io / conan-io/docs

[feature] Lockfile 'base' with recipe revisions only workflow

Open
#1,904 7 comments 0 reactions 1 assignee Claimed by @memsharded View on GitHub
Dominant language
C++
Stars
125
Forks
382
Avg merge
22h 39m
Merged PRs (30d)
21

Description

- [x] I've read the [CONTRIBUTING guide](https://github.com/conan-io/conan/blob/develop/.github/CONTRIBUTING.md).

Take the given `conanfile.py` snippet:
```py
def requirements(self):
self.requires("restinio/0.6.10")
self.requires("json-schema-validator/2.1.0")
self.requires("lyra/1.4.0")
self.requires("spdlog/1.8.0")
```

conan lock create

```sh
$ conan lock create conanfile.py --version=1.0.0-dev.0 --base --lockfile-out=conan-deps.lock
Requirements
asio/1.17.0 from 'conan-center' - Cache
expected-lite/0.4.0 from 'conan-center' - Cache
fmt/7.0.3 from 'conan-center' - Cache
http_parser/2.9.4 from 'conan-center' - Cache
json-schema-validator/2.1.0 from 'conan-center' - Cache
lyra/1.4.0 from 'conan-center' - Cache
nlohmann_json/3.9.1 from 'conan-center' - Cache
openssl/1.1.1g from 'conan-center' - Cache
optional-lite/3.2.0 from 'conan-center' - Cache
restinio/0.6.10 from 'conan-center' - Cache
spdlog/1.8.0 from 'conan-center' - Cache
string-view-lite/1.4.0 from 'conan-center' - Cache
variant-lite/1.2.2 from 'conan-center' - Cache
Packages
asio/1.17.0:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
expected-lite/0.4.0:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
fmt/7.0.3:66c5327ebdcecae0a01a863939964495fa019a06 - Download
http_parser/2.9.4:d50a0d523d98c15bb147b18fa7d203887c38be8b - Download
json-schema-validator/2.1.0:8de143647f7a68ba9847f010597556418f1f6953 - Download
lyra/1.4.0:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
nlohmann_json/3.9.1:d1091b2ed420e6d287293709a907ae824d5de508 - Cache
openssl/1.1.1g:d50a0d523d98c15bb147b18fa7d203887c38be8b - Download
optional-lite/3.2.0:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
restinio/0.6.10:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
spdlog/1.8.0:72cd2c4cdabb80343b4cefc3b31911672f0e2551 - Download
string-view-lite/1.4.0:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
variant-lite/1.2.2:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
Build requirements
catch2/2.13.0 from 'conan-center' - Cache
Build requirements packages
catch2/2.13.0:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache

Generated lockfile: backend/conan-deps.lock
```

Which results in the generate lockfile.

conan-deps.lock

```json
{
"graph_lock": {
"nodes": {
"0": {
"ref": "user-management/1.0.0-dev.0",
"requires": [
"1",
"10",
"12",
"13"
],
"build_requires": [
"14"
],
"path": "conanfile.py",
"context": "host"
},
"1": {
"ref": "restinio/0.6.10#6ded525708af0f9298a32bffc35cf7f5",
"requires": [
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9"
],
"context": "host"
},
"2": {
"ref": "http_parser/2.9.4#16c06558f4414108119e2ebf26e9aea6",
"context": "host"
},
"3": {
"ref": "fmt/7.0.3#2e4cfb84c7647e8c2b5fef1ebb527b7a",
"context": "host"
},
"4": {
"ref": "expected-lite/0.4.0#20b6eb044edb5f0554695de4f69bb4a2",
"context": "host"
},
"5": {
"ref": "optional-lite/3.2.0#16ff2c5bedc906252c92e04fb05b4d8c",
"context": "host"
},
"6": {
"ref": "string-view-lite/1.4.0#ba6c7fdd59c14dcd95fddc655f60e463",
"context": "host"
},
"7": {
"ref": "variant-lite/1.2.2#e2a9ee39933cb18d2326dab6cfe97375",
"context": "host"
},
"8": {
"ref": "asio/1.17.0#d5e050dc0e244955b037e5160071935a",
"context": "host"
},
"9": {
"ref": "openssl/1.1.1g#7db1aa62818c6bb1a1e51166f8fb602d",
"context": "host"
},
"10": {
"ref": "json-schema-validator/2.1.0#a2a0f16dc456d099ebea16329868c60d",
"requires": [
"11"
],
"context": "host"
},
"11": {
"ref": "nlohmann_json/3.9.1#ea6e1cd91366a6aeebad1f31213bccd2",
"context": "host"
},
"12": {
"ref": "lyra/1.4.0#7f8cb9aa1b30b40773537d1a991dda52",
"context": "host"
},
"13": {
"ref": "spdlog/1.8.0#a4a3e8f6f3cd5b62992585ca9eb50dfc",
"requires": [
"3"
],
"context": "host"
},
"14": {
"ref": "catch2/2.13.0#b8f4e03bfc860a975393ffd815ba7a46",
"context": "host"
}
},
"revisions_enabled": true
},
"version": "0.4"
}
```

### Just image if

You could run `conan install .. -s build_type=Debug --lockfile=../conan-deps.lock` and you can get a reproducible dependency graph every time that is tracked by git.

However currently,

```sh
$ conan install .. -s build_type=Debug --lockfile=../conan-deps.lock
ERROR: Cannot use profile, settings, options or env 'host' when using lockfile
$ conan install .. --lockfile=../conan-deps.lock
ERROR: Lockfiles with --base do not contain profile information, cannot be used. Create a full lockfile
```

This is an experimental feature but I was hoping for an explanation about the current limitation and if there's any road map for expanding this feature to help address the short coming regarding upstream changes breaking consumer. It looks to have a lot of potential

Thank you in advance for taking time to answer.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.