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

bugfix conan 1.x: consider revision for build_requires #14679

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conans/client/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def load_virtual(self, references, profile_host, scope_options=True,
conanfile.settings = profile_host.processed_settings.copy_values()

if is_build_require:
conanfile.build_requires = [str(r) for r in references]
conanfile.build_requires = [r for r in references]
else:
for reference in references:
conanfile.requires.add_ref(reference)
Expand Down
19 changes: 19 additions & 0 deletions conans/test/functional/revisions_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,25 @@ def test_revision_mismatch_packages_remote(self, v1):
client.run(command, assert_error=True)
self.assertIn("Can't find a '{}' package".format(self.ref), client.out)

def test_revision_build_requires(self):
conanfile = GenConanfile()

refs = []
for _ in range(1,4): # create different revisions
conanfile.with_build_msg("any change to get another rrev")
pref = self.c_v2.create(self.ref, conanfile=conanfile)
self.c_v2.upload_all(pref.ref)
refs.append(pref.ref)
assert refs.count(pref.ref) == 1 # make sure that all revisions are different

client = self.c_v2 # revisions enabled
client.remove_all()

for ref in refs:
command = "install --update --build-require {}".format(repr(ref))
client.run(command)
self.assertIn("Downloaded recipe revision {}".format(ref.revision), client.out)

def test_json_output(self):
client = TurboTestClient()
client.save({"conanfile.py": GenConanfile()})
Expand Down