Code Monkey home page Code Monkey logo

Comments (6)

memsharded avatar memsharded commented on June 27, 2024 1

The issue remaining is therefore that graph info does not accept the channel on the command line without the user (even if no channel is defined in the recipe) and outputs the following error:

That is correct. Using channel but not user is not allowed, there were some complexities to maintain compatibility in the server sides, it would be breaking, so it is not allowed.

So let's say there is a recipe with a user defined as "my_user" and no channel, the graph info command requires to specify the user again (exactly) through the command line if specifying a channel, which is not the case for the build and create commands:

Then, this we want indeed to check it, I'll try to reproduce in a test.

from conan.

memsharded avatar memsharded commented on June 27, 2024 1

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

from conan.

memsharded avatar memsharded commented on June 27, 2024

Hi @docbrown1955

Thanks for your report
I am not sure this works with create, the following test fails:

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?

from conan.

docbrown1955 avatar docbrown1955 commented on June 27, 2024

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 build and create are consistent and prevent overriding the channel through the CLI.

The issue remaining is therefore that graph info does not accept the channel on the command line without the user (even if no channel is defined in the recipe) and outputs the following error:

ERROR: Can't specify --channel without --user

from conan.

docbrown1955 avatar docbrown1955 commented on June 27, 2024

So let's say there is a recipe with a user defined as "my_user" and no channel, the graph info command requires to specify the user again (exactly) through the command line if specifying a channel, which is not the case for the build and create commands:

conan graph info . --channel=my_channel --user=my_user

from conan.

memsharded avatar memsharded commented on June 27, 2024

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

c.run("graph info . --channel=channel")
assert "pkg/0.1@user/channel" in c.out

Makes it fail

from conan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.