-
Notifications
You must be signed in to change notification settings - Fork 992
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
[question] How to update a reference in a lockfile? #16636
Comments
Have you seen |
I've seen it. From the docs |
@memsharded could you please comment on this issue? |
The If you want to get some specific package version "unlocked", then you can remove it from the lockfile with |
Any further question here @maksim-petukhov? |
I am a bit confused after reading this issue. I was expecting that the purpose of Is that not how it works? So if I already have a lock file created and I want to make a minimal update to the lock file to bump a single package to a new version (without specifying the exact revision) how would I do that? |
Hi @s-geiger-si
No,
There are 2 alternatives:
|
Thanks for the clarification, it might help to document explicitly which Regarding your suggestion, I am not sure how that would help me. I am usually not calling But on my local workspace I want to manage the lifecycle of the lock file without creating the package. I usually only run If I have an updated package version, what I can do is: rm conan.lock
conan install conanfile.py --lockfile-out=conan.lock This generates a new lock file using the latest versions in my local conan registry pulling in newer versions of the components that were just built by my CI/CD pipeline. But it has the risk that some unrelated libraries get also updated that I might not want to update that this point in time (usually 3rd party libraries like spdlog or boost). So what I am really looking for is some command that also me to say: "Update a single package (or a list) to their respective latest versions (within the version range specified in the conanfile.py), make transitive changes if its needed to satisfy any dependencies and leave all other package versions constant." Is this an uncommon workflow? |
Maybe what you are looking for is the |
You are right, the following is basically what I was looking for: conan lock remove --requires libfoo/*
conan lock remove --requires libbar/*
conan lock remove --requires libbaz/*
conan install ./conanfile.py --update --lockfile-partial --lockfile-out=conan.lock --output ./cmake-build-debug Afterwards my three libraries
I wonder if there could be a short-hand for this to make this scenario easier for users that are not conan experts. Something like: |
I think you can do them in one line:
Yes, indeed. By default Conan resolves from the Conan cache for performance reasons. It will only check for latest in the servers with
Also true, Conan 2 made patterns more explicit everywhere.
For
The problem with that is that there are a lot of semantics and inputs missing:
This is still a relatively advanced operation, and while the proposal is easier to type, we are talking mostly about:
I'll check with the team for considering something like this for inclusion to Conan, but at the moment it seems a bit too minor to be built-in. Conan has the "custom commands" framework, so organizations can define their own command, if you want to try to implement your own I'll check with the team for considering something like this for inclusion to Conan, but at the moment it seems a bit too minor to be built-in. |
I have discussed with the team, we would like to explore this idea a bit further. As I see it, there could be 2 different approaches:
There are pros and cons to both approaches:
|
What is your question?
Hi. I started to use lockfiles and I have my libraries locked inside conan.lock (I used
conan install ... -lockfile-out=conan.lock
to create it and didn't edit it or usedconan lock ...
commands on it). Among them -qt/5.15.10#3c0bbf763b778e7b7fc6663eea043447
which I want to update. I've added some patches, built the package and now I have a new revision of it (qt/5.15.10#64e483ec8cfebb74e03da891c848e5a4
) in our Artifactory. I also have a new requirement in my conanfile which I want to lock (let's saycpython
). What I've tried so far:conan install . --profile:host ... --profile:build ... -o=&:my_option=my_value --lockfile-partial --lockfile-out=conan.lock --update
returnsERROR: Requirement 'cpython/...' not in lockfile
. But the documentation clearly states--lockfile-partial Do not raise an error if some dependency is not found in lockfile
. Why do I have an error then?On the other hand this doesn't return an error (I moved
--lockfile-partial
to the beginning) and it addscpython
to the lockfile, though it doesn't update a reference of aqt
in a lockfile:conan install . --lockfile-partial --profile:host ... --profile:build ... -o=&:my_option=my_value --lockfile-out=conan.lock --update
. Again, according documentation--update Will install newer versions and/or revisions in the local cache for the given reference, or all in case no argument is supplied.
and I believe that's what I want.In the logs I have:
If I specify that I want to update
qt
it also doesn't update a reference of aqt
in a lockfile:conan install . --lockfile-partial --profile:host ... --profile:build ... -o=&:my_option=my_value --lockfile-out=conan.lock --update=qt
.Same logs.
So, how do I update the reference of
qt
in the lockfile to the latest available in the remote revision ofqt
?conan 2.5.0
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: