Conan: Disabling/enabling remotes

Created on 26 Jul 2019  路  4Comments  路  Source: conan-io/conan

A feature request from user could be summarized as:

  • They have multiple remotes, 20+, that are defined and installed via conan config install
  • Developers need to login only to a few of them 1, 2...
  • The remotes that the user is not logged in should be skipped.

After discussing it, the most common use case is that users would like to use those remotes, even if not logged-in, because anonymous read usage is common practice. So it doesn't seem a pattern that would be useful for other users.

Furthermore, it would be coupling the auth process with the remote enabling process, seems not the best way.

I think that the feature that could make sense and totally address this use case too is the one of enabling/disabling remotes:

  • Remotes can be conan remote disable <remote-name> or conan remote enable <remote-name>
  • Disabled remotes are NOT removed from the definition, that means that packages that were installed from that remote do not lose their tracking to that remote (removing a remote cleans from the metadata the original remote)
  • Disabled remotes are skipped when a package install is iterating remotes
  • An exception is raised if a package tries to reach that remote (like --update, or completing missing sources)

This is a feature I have missed myself a few times, like disabling conan-center or bincrafters for doing experiments, and later needing to look up the remote to be able to set-up it again, and also playing with --insert to get the same order it was before. Plus it seems not very complex to implement.

medium high queue feature

Most helpful comment

I think it is useful when I have artifactory configured, but I don't want to run it all the time. So to avoid any error when installing a package, I need to exclude it from my remote list, otherwise Conan will raise an error because it's impossible to reach Artifactory. Disabling it would be better.

All 4 comments

So you config install 20+ repositories and you would need to disable 18? I don't like it... I'm that case I think it is better to remove them or not install them.

Maybe allowing patterns for enable/disable is a bit more handy. You can disable * and enable two of them.

I think it is useful when I have artifactory configured, but I don't want to run it all the time. So to avoid any error when installing a package, I need to exclude it from my remote list, otherwise Conan will raise an error because it's impossible to reach Artifactory. Disabling it would be better.

Yes, for disabling multiple repos:

  • Allowing patterns
  • allowing to define the disable/enable state in remotes.txt files too

I think the first should be easier to implement

Was this page helpful?
0 / 5 - 0 ratings