Skip to content

[question] How to build a tool requirement (application) without dependencies? #4410

@fschoenm

Description

@fschoenm

What is your question?

Hi, we have a tool that we want to package as a build requirement. It is available for Linux and Windows but I'm not really sure how to handle its requirements.

If I build the tool self.info.clear() in the package_id() function, it looks like this:

  my_tool
    my_tool/1.2.4@trs/stable
      revisions
        f32a5c93be09e5580addbb2e20881830 (2025-09-04 10:03:27 UTC)
          packages
            da39a3ee5e6b4b0d3255bfef95601890afd80709
              info

So now the os and arch are missing and it won't work to download the correct package for the platform I'm running on.

If I just remove build_type and compiler it looks like this:

  my_tool
    my_tool/1.2.4@trs/stable
      revisions
        e52cee289a43b509db2245fe852034de (2025-09-04 10:09:02 UTC)
          packages
            1394ccb8a7af3b8f676acb63a733d2134157e0c6
              info
                settings
                  arch: x86_64
                  os: Linux
                  os.glibc: 2.35
                requires
                  cxxopts/3.2.0#8026d4f53938b476b36288e5d006bcfb:da39a3ee5e6b4b0d3255bfef95601890afd80709
                  rapidjson/cci

Now it requires very specific dependencies that it (sometimes?) brings to the consumers of the tool.

Shouldn't an application package have no dependencies at all as it's only used as a tool at runtime? Is there a correct way to declare that? Or shouldn't conan maybe automatically remove dependencies from a conan package if you create an application package? Unfortunately I didn't really find the documentation helpful in that regard.

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions