Skip to content

[feature] conan search lacks support for platform/build_type filters #19418

@AaronKonishi

Description

@AaronKonishi

What is your suggestion?

Subject: conan search lacks support for platform/build_type filters, making it impossible to check remote packages for specific configurations

Description:

When working with cross-platform C/C++ projects, it's critical to verify whether a specific package version for a particular platform and build type already exists in a remote repository before uploading.
This prevents accidental overwrites and enables proper package management across multiple target platforms (e.g., x86_64, ARM, MIPS, RISC-V).

However, the current conan search command does not support filtering by platform (-pr:h) or build type (-s build_type), which are essential parameters for distinguishing between different binary
configurations of the same package.

Problem Scenario:

In a typical cross-platform build workflow:

  • Package: host-service/1.1.4@application/mk
  • Platform A: mr536 (ARM) with Release build
  • Platform B: x2600-mips (MIPS) with Release build

These are distinct binary packages that should coexist in the remote repository, but conan search cannot distinguish between them.

Expected Behavior:

The conan search command should support platform and build type filtering, similar to how conan install and conan create support these parameters:

conan search "pkg/version@user/channel" -r {remote} -pr:h {platform} -s build_type={build_type}

This command should:

  • Return exit code 0 and display package information if the specific platform/build_type combination exists in the remote repository
  • Return a non-zero exit code and/or "not found" message if the specific combination does not exist
  • Not be affected by local cache or locally exported packages

Alternative Solution:

Provide a dedicated command to explicitly check for package existence in the remote repository:

conan check-remote "pkg/version@user/channel" -r {remote} -pr:h {platform} -s build_type={build_type}

Impact:

  • High Priority: This limitation prevents implementing safe upload workflows that prevent accidental overwrites of platform-specific packages
  • Use Case: CI/CD pipelines building for multiple platforms need to verify remote package existence before attempting uploads
  • Workaround Complexity: Current workarounds require complex logic and are unreliable due to local cache interference

Environment:

  • Conan Version: 2.x
  • Operating System: Linux (affects all platforms)
  • Use Case: Cross-platform C/C++ project building for multiple target architectures

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions