conan icon indicating copy to clipboard operation
conan copied to clipboard

[question] URI/URL scheme for a file within a conan package

Open naggerx opened this issue 1 year ago • 1 comments

What is your question?

Hi. We often have to handle references to (local) conan packages or files within a package and also sometimes to a package on a specific conan-remote.

Does anybody already came up with a reasonable URI/URL scheme describing (all of) these? (https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Syntax)

Maybe something like: conan:hello/0.1@demo/testing:subfolder/file.txt?profile=linux_x64_gcc9 conan:hello/0.1@demo/testing/conanfile.py?export_folder=yes conan://hello%2F0.1%40demo%2Ftesting/subfolder/file.txt conan://remote-name/hello/0.1/demo/testing/package/subfolder/file.txt conan:/hello/0.1/demo/testing/package/subfolder/file.txt conan+remote://user:[email protected]/artifactory/remote-name/user/pkg/version/channel/0/package/d53d7c15c44c2f2bb180d10b263b08746a2dd85b/subfolder

The package id should be optional, since often the profile and options are known by context. (I'm only interested in the definition of the scheme - not a library/function resolving these URLs.)

Have you read the CONTRIBUTING guide?

  • [ ] I've read the CONTRIBUTING guide

naggerx avatar Apr 24 '24 11:04 naggerx

Thanks for your question @naggerx

There is no URI/URL scheme, and I think this is not planned, most likely not even wanted. Packages are "moving" entities, and they can exist and have multiple copies in different remotes, servers, and Conan client caches.

The identifier of a package in Conan has different parts: name/version@user/channel#recipe-revision:package-id#package-revision, being the last 3 unique hashes to guarantee the integrity and uniqueness of the contents. This entity can exist in the Conan cache, then be uploaded to a server, that will store it in the way it likes, but without needing an external URL. The URI for the resource is exactly that name.

memsharded avatar Apr 24 '24 14:04 memsharded

I am closing this question as resolved. Please create new tickets for any further question you might have, thanks for the feedback.

memsharded avatar Jul 29 '24 22:07 memsharded