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

[bug] Bad error message about using conan list packages #13021

Closed
franramirez688 opened this issue Feb 1, 2023 · 5 comments
Closed

[bug] Bad error message about using conan list packages #13021

franramirez688 opened this issue Feb 1, 2023 · 5 comments
Assignees
Milestone

Comments

@franramirez688
Copy link
Contributor

Environment details

  • Operating System+version:
  • Compiler+version:
  • Conan version:
  • Python version:

Steps to reproduce

$ mkdir pkg && cd pkg
$ conan new cmake_lib -d name=pkg -d version=1.0
$ conan export .
$ mkdir pkg1 && cd pkg1
$ conan new cmake_lib -d name=pkg1 -d version=1.0
# Add -> requires = "pkg/1.0" to the conanfile.py
$ conan create .

Logs

ERROR: Missing prebuilt package for 'pkg/1.0'
Use 'conan list packages pkg/1.0 --format=html -r=remote > table.html' and open the table.html file to see available packages
Or try to build locally from sources with '--build=pkg/1.0'

More Info at 'https://docs.conan.io/en/latest/faq/troubleshooting.html#error-missing-prebuilt-package'
@franramirez688 franramirez688 added this to the 2.0.0-beta10 milestone Feb 1, 2023
@franramirez688 franramirez688 self-assigned this Feb 1, 2023
@SSE4
Copy link
Contributor

SSE4 commented Feb 2, 2023

bad things about this error message:

  1. it basically suggests a command that doesn't exist at all:
conan list packages yasm/1.3.0 --format=html -r=conancenter > table.html
usage: conan list [-h] [-f FORMAT] [-v [V]] [--logger] [-p PACKAGE_QUERY]
                  [-r REMOTE] [-c]
                  reference
conan list: error: unrecognized arguments: yasm/1.3.0
ERROR: Exiting with code: 2

apparently, there is no conan list packages, but only conan list (see reference)

  1. it's kinda inconvenient to suggest to export an .html to someone who is working from console and potentially doesn't have a web-browser to view it comfortably (e.g. over ssh session).

  2. even if you manage to fix the command and run the right one (conan list "yasm/1.3.0:*" --format=html -r=conancenter > table.html), it will export an empty table:

        <table id="results" class="table table-striped table-bordered" style="width:100%">
            <thead>

            </thead>
            <tbody>

            </tbody>
            <tfoot>

            </tfoot>
        </table>

while JSON will export something more appropriate:

conan list "yasm/1.3.0:*" --format=json -r=conancenter         
{
    "conancenter": {
        "yasm/1.3.0": {
            "revisions": {
                "2a3d4e934b903c33d380b47bdf7f45be": {
                    "timestamp": 1668025199.03,
                    "packages": {}
                }
            }
        }
    }
}

this isn't currently reflected in documentation that JSON and HTML outputs are semantically different.

  1. in general, I wonder why tell a user to run some command, if it could be done internally and showed immediately? it might only cause a headache in some situations. imagine a CI system, where builds could take some minutes or even hours, you will need to re-run CI to get a more useful error message. and by the time you manage to re-run it, a situation may change, as someone may upload or delete a package on remote.

@czoido
Copy link
Contributor

czoido commented Feb 15, 2023

Closed by conan-io/docs#2945

@czoido czoido closed this as completed Feb 15, 2023
@SSE4
Copy link
Contributor

SSE4 commented Feb 15, 2023

@czoido but it's not actually fixed, bad error message is still there, there is just a warning in docs. am I missing something?

@czoido
Copy link
Contributor

czoido commented Feb 15, 2023

Sorry, my mistake, I meant to close #13022

@czoido
Copy link
Contributor

czoido commented Feb 16, 2023

closed by #13135

@czoido czoido closed this as completed Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants