conan-io / conan-io/docs

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

Open
#4,410 1 comment 0 reactions 1 assignee Claimed by @AbrilRBS View on GitHub
type: question
Dominant language
C++
Stars
125
Forks
382
Avg merge
22h 39m
Merged PRs (30d)
21

Description

### 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?

- [x] I've read the CONTRIBUTING guide

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.