#19243·conan

[question] full_mode on embedded deps

Author: lo1olCreated Nov 13, 2025Updated Sep 28, 2026
Labelsstage: triaging

What is your question?

Hi!

We faced with some problem

At new versions of our custom conanfile extension (python_requires_extend) we stoped to set manually package_id_mode for deps with (visible=False). On old versions it was something like:

python
       # Hash only recipe for non-visible requires
        visible = kwargs.get("visible", True)
        if "package_id_mode" not in kwargs and not visible:
            kwargs["package_id_mode"] = "revision_mode"

Now we faced with following problem:

  1. We have Debug and Release version of pkgA (static-library)
  2. We have Release version of pkgB (application). It requires pkgA.
  3. I try to build Debug version of pkgC. It requires pkgB. I have compatibility setting, that allows using release version of pkgB instead of debug version:
bash
cat > conanfileA.py <<EOF
from conan import ConanFile

class conanfileA(ConanFile):
    name="pkg_a"
    version="0.0.1"
    package_type="static-library"

    settings = "os", "compiler", "arch", "build_type"
EOF

cat > conanfileB.py <<EOF
from conan import ConanFile

class conanfileB(ConanFile):
    name="pkg_b"
    version="0.0.1"
    package_type="application"

    settings = "os", "compiler", "arch", "build_type"

    def requirements(self):
        self.requires("pkg_a/0.0.1", visible=False)
EOF

cat > conanfileC.py <<EOF
from conan import ConanFile

class conanfileC(ConanFile):
    name="pkg_c"
    version="0.0.1"

    settings = "os", "compiler", "arch"

    def requirements(self):
        self.requires("pkg_b/0.0.1")
EOF

conan export-pkg conanfileA.py -s build_type=Debug
conan export-pkg conanfileA.py -s build_type=Release
conan export-pkg conanfileB.py -s build_type=Release

# -s pkg_b/*:build_type=Release -- emulate compatibility
conan install -s build_type=Debug -s "pkg_b/*:build_type=Release" conanfileC.py

With default package_id_embed_mode=full_mode, pkg_b couldn't be found because it's hash computed with Debug version of pkg_a.

We don't want to change default_embed_mode at global config, because it affect package_id of existing packages, that doesn't specify package_id manually.

Could you recommend us what to do in this case? It looks like we need to rebuild all our new packages, what doesn't set package_id explicitly.

Is there some better variants in this case? Or at least something, what help us in future?

We thinking about adding package_id_embed_mode = package_id_non_embed_mode = "revision_mode" to our base conanfie, to stop depends on default values at global config

conan 2.22

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide