conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
8.31k stars 986 forks source link

conan 1.65.0 lockfile #17160

Closed danielhalati closed 1 month ago

danielhalati commented 1 month ago

What is your question?

Hello. I am trying to use conan 1.65.0 with revision enabled and to generate lockfiles

I found out a new package will be generated every time the contents change which is perfect. That's what I am expecting

This is how packages look inside Artifactory: image

And then I have a simple requirements.txt file

[requires]
flatbuffers/23.5.26@user/stable

[options]
flatbuffers:shared=False

[imports]
. ,* -> . @ excludes=conan*

AFAIK from the docs: https://docs.conan.io/1/versioning/revisions.html I am downloading the latest available package, which is again correct

The next step I want to do is to generate the lockfile:

conan lock create requirements.txt

This is the output generated:

Requirements
    flatbuffers/23.5.26@user/stable from 'artifactory' - Cache
Packages
    flatbuffers/23.5.26@user/stable:3fb49604f9c2f729b85ba3115852006824e72cab - Missing

Generated lockfile: D:\Projects\conan-packages\conan.lock

The thing is that the package doesn't exist for some reason, but I've just downloaded it ...

I also tried placing some revisions inside requirements.txt but it doesn't seem to have any effect. How can I pick up a certain package inside artifactory manually?

Have you read the CONTRIBUTING guide?

memsharded commented 1 month ago

Hi @danielhalati

Thanks for your question.

Quick question: Are you using any other arguments for conan install of your package? Like any settings, profiles? Because those same arguments should be used for the conan lock create command. Lockfiles in Conan 1.X are 1 lockfile for each different configuration (combination of profiles, settings, etc), so the dependency graph has to be computed with the same inputs as the conan install would do.

danielhalati commented 1 month ago

I am using a custom profile. Does the conan lock create accept a custom profile?

memsharded commented 1 month ago

Yes you should pass the same -pr=profile -s settings=value ... arguments you would be using for conan install.

danielhalati commented 1 month ago

It works now. many thanks

memsharded commented 1 month ago

Happy to help!