-
Notifications
You must be signed in to change notification settings - Fork 993
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
[bug] Channel overriding inconsistent between build / create / graph #15791
Comments
Thanks for your report def test_user_channel_override():
c = TestClient()
conanfile = textwrap.dedent("""
from conan import ConanFile
class SayConan(ConanFile):
name = "pkg"
version = "0.1"
user = "user"
channel = "channel"
""")
c.save({"conanfile.py": conanfile})
c.run("create . --channel=testing")
# ERROR:
# ERROR: Package recipe with channel testing!=channel Can you please check it? |
Hi @memsharded, You are right, I did the test on a recipe that did not have the channel defined (while I thought it had one). So The issue remaining is therefore that
|
So let's say there is a recipe with a user defined as "my_user" and no channel, the
|
That is correct. Using
Then, this we want indeed to check it, I'll try to reproduce in a test. |
Not sure about that either 😅 def test_graph_info_user():
"""
https://github.com/conan-io/conan/issues/15791
"""
c = TestClient()
conanfile = textwrap.dedent("""
from conan import ConanFile
class Pkg(ConanFile):
name = "pkg"
version = "0.1"
user = "user"
""")
c.save({"conanfile.py": conanfile})
c.run("graph info .")
assert "pkg/0.1@user" in c.out UPDATE: Sorry, now I got it. adding
Makes it fail |
Found the issue, was a too early argument check, I have moved it later to allow this: #15794, it will be in next 2.2 |
Environment details
Steps to reproduce
conan build
/conan create
orconan graph info
on the recipe, overriding the channel using--channel=test
Logs
Create command works fine, overrides the channel accordingly and finishes successfully. I'm not sure what is the expected behavior as for the three commands the behavior is different (should it fail ? always ? only when user is not provided ?).
I'm aware that using the channel is not particularly recommended. I'm using it to automate testing of conan workflows & versioning, setting the channel provides a simple way to provide a clean test setup for each workflow.
Build command dramatically fails:
Expand log
Graph info command fails with a nice error message:
Expand log
NB: Overriding the user on the command line as well using
--user=barbarian
works as expected and corrects the issues.The text was updated successfully, but these errors were encountered: