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

trying to avoid touching remote when binary not found in -r=remote #9355

Merged
merged 8 commits into from Aug 24, 2021
Merged
2 changes: 1 addition & 1 deletion conans/client/graph/graph_binaries.py
Expand Up @@ -113,7 +113,7 @@ def _evaluate_remote_pkg(self, node, pref, remote, remotes):

# If the "remote" came from the registry but the user didn't specified the -r, with
# revisions iterate all remotes
if not remote or (not remote_info and self._cache.config.revisions_enabled):
if not remote: # or (not remote_info and self._cache.config.revisions_enabled):
for r in remotes.values(): # FIXME: Here we hit the same remote we did before
try:
remote_info, pref = self._get_package_info(node, pref, r)
Expand Down
17 changes: 17 additions & 0 deletions conans/test/functional/revisions_test.py
Expand Up @@ -1598,3 +1598,20 @@ def test_necessary_update():
c.save({"conanfile.py": GenConanfile("app", "0.1").with_requires("pkg/0.1#{}".format(rrev2))})
c.run("install .")
assert rrev2 in c.out


def test_touching_other_server():
# https://github.com/conan-io/conan/issues/9333
servers = OrderedDict([("remote1", TestServer()),
("remote2", None)]) # None server will crash if touched
c = TestClient(servers=servers, users={"remote1": [("conan", "password")]})
c.run("config set general.revisions_enabled=True")
c.save({"conanfile.py": GenConanfile().with_settings("os")})
c.run("create . pkg/0.1@conan/channel -s os=Windows")
c.run("upload * --all -c -r=remote1")
c.run("remove * -f")

# This is OK, binary found
c.run("install pkg/0.1@conan/channel -r=remote1 -s os=Windows")
c.run("install pkg/0.1@conan/channel -r=remote1 -s os=Linux", assert_error=True)
assert "ERROR: Missing binary: pkg/0.1@conan/channel" in c.out