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

[question][Conan 2.0] what's the correct way of obtaining the list of settings for a package in conancenter? #13343

Closed
1 task done
mkmkme opened this issue Mar 6, 2023 · 5 comments
Assignees

Comments

@mkmkme
Copy link
Contributor

mkmkme commented Mar 6, 2023

What is your question?

In 1.X, you could see the available options for the upstream package at least by search the full reference:

❯ conan search 'sdl/2.26.1@' -r conancenter
...
    Package_ID: f4055e5fd18060c3b0e30bed926e054dcb4524ab
        [options]
            alsa: True
            arts: False
            directfb: False
            esd: False
            fPIC: True
            iconv: True
            jack: False
            libunwind: True
            nas: True
            opengl: True
            opengles: True
            pulse: True
            sdl2main: True
            shared: False
            sndio: False
            video_rpi: False
            vulkan: True
            wayland: True
            x11: True
            xcursor: True
            xinerama: True
            xinput: True
            xrandr: True
            xscrnsaver: True
            xshape: True
            xvm: True
...

I couldn't find any way to get the list of options in 2.0. I need that in order to understand how can I configure the dependencies for my project.

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@AbrilRBS
Copy link
Member

AbrilRBS commented Mar 6, 2023

You can get pretty similar results with conan list (As in, conan search is just an alias for list over all remotes), by specifying that you want info for all the packages of a reference, like so: (And maybe adding a --formater=json in case you need to parse this output from another script)

$ conan list "zlib/1.2.13:*" -r conancenter
conancenter
  zlib
    zlib/1.2.13
      revisions
        13c96f538b52e1600c40b88994de240f (2022-11-02 13:46:53 UTC)
          packages
            d62dff20d86436b9c58ddc0162499d197be9de1e
              info
                settings
                  arch: x86_64
                  build_type: Release
                  compiler: apple-clang
                  compiler.version: 13
                  os: Macos
                options
                  fPIC: True
                  shared: False
            abe5e2b04ea92ce2ee91bc9834317dbe66628206
              info
                settings
                  arch: x86_64
                  build_type: Release
                  compiler: gcc
                  compiler.version: 11
                  os: Linux
                options
                  shared: True
            ae9eaf478e918e6470fe64a4d8d4d9552b0b3606
              info
                settings
                  arch: x86_64
                  build_type: Release
                  compiler: msvc
                  compiler.runtime: dynamic
                  compiler.runtime_type: Release
                  compiler.version: 192
                  os: Windows
                options
                  shared: True
            41ad450120fdab2266b1185a967d298f7ae52595
              info
                settings
                  arch: x86_64
                  build_type: Release
                  compiler: msvc
                  compiler.runtime: dynamic
                  compiler.runtime_type: Release
                  compiler.version: 192
                  os: Windows
                options
                  shared: False
            76864d438e6a53828b8769476a7b57a241d91b69
              info
                settings
                  arch: x86_64
                  build_type: Release
                  compiler: msvc
                  compiler.runtime: static
                  compiler.runtime_type: Release
                  compiler.version: 192
                  os: Windows
                options
                  shared: False
            24612164eb0760405fcd237df0102e554ed1cb2f
              info
                settings
                  arch: x86_64
                  build_type: Release
                  compiler: apple-clang
                  compiler.version: 13
                  os: Macos
                options
                  shared: True
            a3c9d80d887539fac38b81ff8cd4585fe42027e0
              info
                settings
                  arch: armv8
                  build_type: Release
                  compiler: apple-clang
                  compiler.version: 13
                  os: Macos
                options
                  shared: True
            b647c43bfefae3f830561ca202b6cfd935b56205
              info
                settings
                  arch: x86_64
                  build_type: Release
                  compiler: gcc
                  compiler.version: 11
                  os: Linux
                options
                  fPIC: True
                  shared: False
            dbb40f41e6e9a5c4a9a1fd8d9e6ccf6d92676c92
              info
                settings
                  arch: armv8
                  build_type: Release
                  compiler: apple-clang
                  compiler.version: 13
                  os: Macos
                options
                  fPIC: True
                  shared: False

@AbrilRBS AbrilRBS self-assigned this Mar 6, 2023
@mkmkme
Copy link
Contributor Author

mkmkme commented Mar 6, 2023

Doesn't work for sdl:

❯ conan list 'sdl/2.26.1:*' -r conancenter
conancenter
  sdl
    sdl/2.26.1
      revisions
        bc6eca6d9fe575c79f3dc900354b497d (2023-02-17 02:00:00 UTC)
          packages

@AbrilRBS
Copy link
Member

AbrilRBS commented Mar 6, 2023

Oh, yes, sorry about that, I didn't look at the recipe itself. With Conan 2 being out for just a few weeks, some recipes are not yet migrated to the newer version, and so won't show packages in Conan v2, because none has yet been built for it.

Luckily, sdl2 has a few PRs in the pipeline to migrate it, namely conan-io/conan-center-index#16266. Once merged, packages for sdl will show up with their options. We just opened the CI services from a planned maintenance, so the backlog of PRs that the CI needs to process has increased a bit, but it should get addressed shortly™️

@mkmkme
Copy link
Contributor Author

mkmkme commented Mar 6, 2023

I see. Thanks!
I wonder if it's worth converting this issue to a feature request and make it so you don't need to figure out those options from actually compiled packages in conancenter :)

I do have a workaround for this with

conan download sdl/2.26.1 --recipe-only
conan inspect $(conan cache path sdl/2.26.1)

and luckily I can make it a custom subcommand for myself with 2.0 features. Although I wish I didn't have to, and having such information without need to download recipe first sounds like a good feature :)

@AbrilRBS
Copy link
Member

AbrilRBS commented Dec 1, 2023

Recent work for conan list formatters have made the output of conan list easier to understand - If a different approach is wanted, we'd be happy to accept custom commands in conan-extensions, closing as solved! :)

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

No branches or pull requests

2 participants