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

[question] What is the expected behavior of conan install --remote REMOTE #9333

Closed
joeced opened this issue Jul 28, 2021 · 6 comments · Fixed by #9355
Closed

[question] What is the expected behavior of conan install --remote REMOTE #9333

joeced opened this issue Jul 28, 2021 · 6 comments · Fixed by #9355
Milestone

Comments

@joeced
Copy link

joeced commented Jul 28, 2021

I'm trying to understand the expected behavior of conan install --remote REMOTE. We have a local Artifactory server for our own packages, but still have conan-center as a remote, even though it is not really used.

Output of conan remote list:

virtual-remote: https://[...] [Verify SSL: True]
conan-center: https://conan.bintray.com [Verify SSL: True]

Whether or not I call conan install --remote virtual-remote or just conan install, I always get these "extra" calls in the trace log.

{"_action": "REST_API_CALL", "duration": 0.21838855743408203, "headers": {"User-Agent": "Conan/1.37.1 (Windows 10; Python 3.9.5; AMD64) python-requests/2.25.1", "X-Client-Anonymous-Id": "**********", "X-Client-Id": ""}, "method": "GET", "time": 1627460264.1806884, "url": "https://conan.bintray.com/v1/ping"}
{"_action": "REST_API_CALL", "duration": 0.016086578369140625, "headers": {"User-Agent": "Conan/1.37.1 (Windows 10; Python 3.9.5; AMD64) python-requests/2.25.1", "X-Client-Anonymous-Id": "**********", "X-Client-Id": ""}, "method": "GET", "time": 1627456231.6621335, "url": "https://conan.bintray.com/v2/conans/[...]/revisions/35c21a513276d9605b75da32df276b87/packages/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/latest"}

Is this to be expected and is there any way to avoid it (besides deleting the remote?)

Versions:

  • Python 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] on win32
  • Conan version 1.37.1

Edit: added Python and Conan version

@joeced joeced changed the title What is the expected behavior of conan install --remote REMOTE [question] What is the expected behavior of conan install --remote REMOTE Jul 28, 2021
@memsharded
Copy link
Member

Hi @joeced

Could you please try to provide more complete details how to reproduce? Does it happen when you try that from a clean cache?

For example, if I try, with 2 remotes:

(conan36) λ conan remote list
conancenter: https://center.conan.io [Verify SSL: True]
conan-center: https://conan.bintray.com [Verify SSL: True]

(conan36) λ conan install zlib/1.2.11@ -r=conancenter

then I see no trace at all from the bintray remote in my traces. One possibility is that you had something previously installed from the bintray remote. In some cases, Conan will be trying to use the remote it downloaded things in the first place, but I am not sure this should be one of those cases, lets try to reproduce this behavior.

Also, please, very important: The conan version you are running (plus details on the platform and Python version can sometimes help, but the conan version is very important)

@joeced
Copy link
Author

joeced commented Jul 30, 2021

Thanks for the elaborate answer. My use-case is slightly different. I have a conanfile.txt file in a directory and specify the path directly.

Given a conanfile.txt file:

[requires]
matlab-wsa-std/2.7.2@platform/stable
[generators]
txt

and the command

conan install -r virtual-remote .

I always get two calls to bintray in the trace log:

{"_action": "REST_API_CALL", "duration": 0.21838855743408203, "headers": {"User-Agent": "Conan/1.37.1 (Windows 10; Python 3.9.5; AMD64) python-requests/2.25.1", "X-Client-Anonymous-Id": "**********", "X-Client-Id": ""}, "method": "GET", "time": 1627460264.1806884, "url": "https://conan.bintray.com/v1/ping"}
{"_action": "REST_API_CALL", "duration": 0.016086578369140625, "headers": {"User-Agent": "Conan/1.37.1 (Windows 10; Python 3.9.5; AMD64) python-requests/2.25.1", "X-Client-Anonymous-Id": "**********", "X-Client-Id": ""}, "method": "GET", "time": 1627456231.6621335, "url": "https://conan.bintray.com/v2/conans/[...]/revisions/35c21a513276d9605b75da32df276b87/packages/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/latest"}

The conanfile.py for matlab-wsa-std looks like this:

import os
from conans import ConanFile

class MatlabPackage(ConanFile):
    name = "matlab-wsa-std"
    version = "2.7.2"
    url = "https://[some-url]"
    exports_sources = "src/+wsa/*", "setup.m",  "rmsetup.m"
    build_policy = "missing"
    generators = "txt"
    settings = None

    def source(self):
        pass

    def build(self):
        pass

    def package(self):
        self.copy("setup.m")
        self.copy("rmsetup.m")
        self.copy("*", src="src/+wsa", dst="src/+wsa")

However, if I try a similar approach with zlib:

[requires]
zlib/1.2.11@
[generators]
txt

and

conan install -r conan-center .

I'm not seeing any call to our local Artifactory server.

@memsharded
Copy link
Member

Uhmm, I think this could be due to revisions. When you do have revisions enabled, and one package binary is not found in one repository, it might be looked for in other repositories (for exactly the same recipe revision). Let's try to reproduce this (though the bad news is that changing this might be quite breaking for other users, lets see...)

@joeced
Copy link
Author

joeced commented Jul 30, 2021

Thanks for the swift response. We have revisions_enabled = true. Is there anything I can do different with my conanfile.py?

@memsharded
Copy link
Member

Reproduced the behavior and checking in this PR #9355, if it can be changed and considered a bug, we better make sure that this change is not breaking other users that depend on this behavior.

@memsharded
Copy link
Member

PR #9355 was merged, so this bug will be fixed and released in next 1.40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants