Skip to content
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

Ability to set remote priorities higher than default #43

Open
ahepp opened this issue Mar 14, 2023 · 2 comments
Open

Ability to set remote priorities higher than default #43

ahepp opened this issue Mar 14, 2023 · 2 comments
Labels
question Further information is requested

Comments

@ahepp
Copy link

ahepp commented Mar 14, 2023

Hi,

A different team at my company is distributing prebuilt binaries with Conan, which I want to include in my Yocto based OS image. I am a Conan novice, so apologies if there's an easy way to solve my problem that I am not seeing.

I've created a recipe for "my-package". The recipe sets CONAN_REMOTE_URL and CONAN_REMOTE_NAME. Conan finds "my-package", but it appears to be installing the dependencies from center.conan.io rather than from my remote.

I believe this is because of the default .conan/remotes.json file that seems to be generated in the Yocto build directory. This file has center.conan.io listed first in the JSON array of remotes, and I assume only packages not found on the first remote go on to my custom remote.

This quick hack has fixed my issue for now, but I'd like to be able to use mainline meta-conan. I'm happy to work on a enhancement to support this, but I'm not sure what the best way to go about it is.

I briefly attempted overriding the .conan/remotes file with my Yocto recipe, but that was not successful.

I am not familiar with Conan config URLs, but it seems like maybe I could host a config archive on artifactory and get my remote settings from there? But I would prefer to store the config settings in my Yocto recipe if at all possible.

It looks like there is already support for multiple remotes. I believe these will already be added in order to .conan/remotes.json.

Making center.conan.io the default value for for CONAN_REMOTE_URL and not adding it automatically to .conan/remotes could be an elegant solution. Then users who wish to simply add an additional remote can append to the variable, and users who wish to mess around with priority can fully override it. However that would pose a major backwards compatibility issue. So perhaps, if a change along these lines is deemed appropriate, it would need to involve a new environment variable.

I would love to hear others' thoughts on this. Especially if I'm just overlooking something simple about how Conan works.

@uilianries uilianries added the question Further information is requested label Mar 14, 2023
@uilianries
Copy link
Member

uilianries commented Mar 14, 2023

@ahepp What version of Conan is your company running?

You may use conan remote add along its --index option command to chose your first remote option. Plus, you can disable/enable remotes there. Please, take a look on the documentation.

@ahepp
Copy link
Author

ahepp commented Mar 14, 2023

Won't the bbclass blow away outside config before starting the install stage?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants