docs
docs copied to clipboard
Cannot specify dependency with revisions and pkg id in recipe
Environment Details (include every applicable attribute)
- Operating System+version:
- Compiler+version:
- Conan version: 1.40
- Revisions are disabled
- Python version:
Steps to reproduce (Include if Applicable)
Create a recipe. Add to the requires function dependencies in this format: lib/1.0@conan/stable#RREV:PACKAGE_ID#PREV where the revision is 0 for the moment. Revisions will be enabled soon but the reference should be working also with the default revision. Try to install deps locally by calling conan install . Example that we were using: self.requires(f"example/1.11@ci/baselines#0:2303205ffe848694a2cd0f49e16984ec423b58bb:0")
Logs (Executed commands with output) (Include/Attach if Applicable)
Error in requirements() method, line 18 InvalidNameException: The revision field, must contain only letters and numbers with a length between 1 and 51
You cannot specify a package reference as a requirement in a recipe. Only a recipe reference (with or without revision: example/1.11@ci/baselines#0). The package is calculated from the applied settings while installing.
If you need to freeze the binary package that is being used I recommend taking a look at the lockfiles: https://docs.conan.io/en/latest/versioning/lockfiles.html
But the document here says that we can specify the reference in the following way
| lib/1.0@conan/stable#RREV:PACKAGE_ID#PREV | A binary package revision PREV belonging to the specific RREV |
|---|
@sniraimathi that is something that is not clear in the docs. We will fix the docs to improve that.
But it is not possible to specify the package_id in recipes, as above said, it is a computed value from the profiles and other data, it doesn't make sense to specify it directly.
Moving this to the docs repo.
+1 for misleading documentation :( thanks @memsharded and @lasote for the detailed reply.
is the pinning mechanism considered a stable feature, or is it experimental, similarly to the lock file?
The pinning mechanism is recipes requires should be considered stable, as it belongs to the revisions feature, stabilized some time ago.