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

[bug]: "package-id doesn't match" error with zlib/1.2.11, doxygen/1.9.1, and base lockfiles #9446

Closed
hannahwhy opened this issue Aug 18, 2021 · 17 comments

Comments

@hannahwhy
Copy link
Contributor

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: zlib/1.2.11 and doxygen/1.9.1 (both appear to be important)
  • Operating System+version: Linux Ubuntu 20.04.1
  • Compiler+version: gcc 9.3.0
  • Conan version: conan 1.39.0
  • Python version: Python 3.8.10
  • Conan package ID mode: package_revision_mode
  • Revisions enabled: True

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

This bug report requires two profiles.

test-debug
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.cppstd=20
compiler.version=9
compiler.libcxx=libstdc++11
build_type=Debug
[options]
[build_requires]
[env]
CC=x86_64-linux-gnu-gcc-9
CXX=x86_64-linux-gnu-g++-9
test-release
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.cppstd=20
compiler.version=9
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
[env]
CC=x86_64-linux-gnu-gcc-9
CXX=x86_64-linux-gnu-g++-9

Steps to reproduce (Include if Applicable)

  1. Create a conanfile.txt with the following contents:
[requires]
zlib/1.2.11

[build_requires]
doxygen/1.9.1
  1. Generate a base lockfile, specifying "build all packages":
conan lock create --base --lockfile-out conan-base.lock conanfile.txt --build
  1. Generate a lockfile from this base lockfile:
conan lock create -l conan-base.lock -pr:h test-debug -pr:b test-release conanfile.txt --build

When I run this sequence, the following error appears after step 3:

ERROR: 'zlib/1.2.11#280f98686dda91120690d3b58806868a' package-id '6af9cc7cb931c5ad942174fd7838eb655717c709' doesn't match the locked one '23b828d52c0630e6b0b96d2945419feb7843c4f8'

Package ID 6af9cc7cb931c5ad942174fd7838eb655717c709 is the package for build type Release; ID 23b828d52c0630e6b0b96d2945419feb7843c4f8 is the package for build type Debug.

Logs (Include/Attach if Applicable)

conan lock create --base --lockfile-out conan-base.lock conanfile.txt --build
$ conan lock create --base --lockfile-out conan-base.lock conanfile.txt --build 
zlib/1.2.11: Not found in local cache, looking in remotes...
zlib/1.2.11: Trying with 'develop'...
Downloading conanmanifest.txt completed [0.35k]                                          
Downloading conanfile.py completed [5.94k]                                               
Downloading conan_export.tgz completed [0.36k]                                           
Decompressing conan_export.tgz completed [0.00k]                                         
zlib/1.2.11: Downloaded recipe revision 280f98686dda91120690d3b58806868a
zlib/1.2.11: Forced build from source
doxygen/1.9.1: Not found in local cache, looking in remotes...
doxygen/1.9.1: Trying with 'develop'...
Downloading conanmanifest.txt completed [0.52k]                                          
Downloading conanfile.py completed [4.16k]                                               
Downloading conan_export.tgz completed [0.50k]                                           
Decompressing conan_export.tgz completed [0.00k]                                         
doxygen/1.9.1: Downloaded recipe revision c255db0964b60e0ba76a60cdb1a52a6a
xapian-core/1.4.18: Not found in local cache, looking in remotes...
xapian-core/1.4.18: Trying with 'develop'...
Downloading conanmanifest.txt completed [0.52k]                                          
Downloading conanfile.py completed [7.25k]                                               
Downloading conan_export.tgz completed [0.42k]                                           
Decompressing conan_export.tgz completed [0.00k]                                         
xapian-core/1.4.18: Downloaded recipe revision 8c004fe7a233faa1df33dabcfed6c2e6
libuuid/1.0.3: Not found in local cache, looking in remotes...
libuuid/1.0.3: Trying with 'develop'...
Downloading conanmanifest.txt completed [0.20k]                                          
Downloading conanfile.py completed [2.88k]                                               
Downloading conan_export.tgz completed [0.32k]                                           
Decompressing conan_export.tgz completed [0.00k]                                         
libuuid/1.0.3: Downloaded recipe revision 9c105b3c225d3534bd909800d28c0e7f
libuuid/1.0.3: Forced build from source
libtool/2.4.6: Not found in local cache, looking in remotes...
libtool/2.4.6: Trying with 'develop'...
Downloading conanmanifest.txt completed [0.28k]                                          
Downloading conanfile.py completed [9.29k]                                               
Downloading conan_export.tgz completed [0.31k]                                           
Decompressing conan_export.tgz completed [0.00k]                                         
libtool/2.4.6: Downloaded recipe revision 24c41fe9c9cc178ee1f009c2402beb7f
automake/1.16.3: Not found in local cache, looking in remotes...
automake/1.16.3: Trying with 'develop'...
Downloading conanmanifest.txt completed [1.38k]                                          
Downloading conanfile.py completed [5.47k]                                               
Downloading conan_export.tgz completed [0.51k]                                           
Decompressing conan_export.tgz completed [0.00k]                                         
automake/1.16.3: Downloaded recipe revision 9f811cf1e5ae7c0f292cf316dd885e17
autoconf/2.71: Not found in local cache, looking in remotes...
autoconf/2.71: Trying with 'develop'...
Downloading conanmanifest.txt completed [1.05k]                                          
Downloading conanfile.py completed [5.02k]                                               
Downloading conan_export.tgz completed [0.47k]                                           
Decompressing conan_export.tgz completed [0.00k]                                         
autoconf/2.71: Downloaded recipe revision 0496601066d53aab9abdd1123dade2ef
m4/1.4.18: Not found in local cache, looking in remotes...
m4/1.4.18: Trying with 'develop'...
Downloading conanmanifest.txt completed [0.94k]                                          
Downloading conanfile.py completed [4.84k]                                               
Downloading conan_export.tgz completed [0.46k]                                           
Decompressing conan_export.tgz completed [0.00k]                                         
m4/1.4.18: Downloaded recipe revision 8fb1f99229e460194872a73077bd50ab
m4/1.4.18: Forced build from source
autoconf/2.71: Forced build from source
gnu-config/cci.20201022: Not found in local cache, looking in remotes...
gnu-config/cci.20201022: Trying with 'develop'...
Downloading conanmanifest.txt completed [0.10k]                                          
Downloading conanfile.py completed [2.09k]                                               
Downloading conan_export.tgz completed [0.28k]                                           
Decompressing conan_export.tgz completed [0.00k]                                         
gnu-config/cci.20201022: Downloaded recipe revision 2cbbb9aac74039632f715306fdb1ce5a
gnu-config/cci.20201022: Forced build from source
flex/2.6.4: Not found in local cache, looking in remotes...
flex/2.6.4: Trying with 'develop'...
Downloading conanmanifest.txt completed [0.10k]                                          
Downloading conanfile.py completed [4.04k]                                               
Downloading conan_export.tgz completed [0.26k]                                           
Decompressing conan_export.tgz completed [0.00k]                                         
flex/2.6.4: Downloaded recipe revision ac6aa2cae00c591c053d6ee479f3bc06
bison/3.7.1: Not found in local cache, looking in remotes...
bison/3.7.1: Trying with 'develop'...
Downloading conanmanifest.txt completed [0.73k]                                          
Downloading conanfile.py completed [7.10k]                                               
Downloading conan_export.tgz completed [0.50k]                                           
Decompressing conan_export.tgz completed [0.00k]                                         
bison/3.7.1: Downloaded recipe revision 4bb3c1142ded811ce0e45f1109c4d75b
Requirements
    zlib/1.2.11 from 'develop' - Downloaded
Packages
    zlib/1.2.11:6af9cc7cb931c5ad942174fd7838eb655717c709 - Build
Build requirements
    autoconf/2.71 from 'develop' - Downloaded
    automake/1.16.3 from 'develop' - Downloaded
    bison/3.7.1 from 'develop' - Downloaded
    doxygen/1.9.1 from 'develop' - Downloaded
    flex/2.6.4 from 'develop' - Downloaded
    gnu-config/cci.20201022 from 'develop' - Downloaded
    libtool/2.4.6 from 'develop' - Downloaded
    libuuid/1.0.3 from 'develop' - Downloaded
    m4/1.4.18 from 'develop' - Cache
    xapian-core/1.4.18 from 'develop' - Downloaded
Build requirements packages
    autoconf/2.71:cb054d0b3e1ca595dc66bc2339d40f1f8f04ab31 - Build
    automake/1.16.3:Package_ID_unknown - Unknown
    bison/3.7.1:Package_ID_unknown - Unknown
    doxygen/1.9.1:Package_ID_unknown - Unknown
    flex/2.6.4:Package_ID_unknown - Unknown
    gnu-config/cci.20201022:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Build
    libtool/2.4.6:Package_ID_unknown - Unknown
    libuuid/1.0.3:6af9cc7cb931c5ad942174fd7838eb655717c709 - Build
    m4/1.4.18:24647d9fe8ec489125dfbae4b3ebefaf7581674c - Build
    xapian-core/1.4.18:Package_ID_unknown - Unknown

Generated lockfile: /home/user/prj/bugcheck/conan-base.lock
conan lock create -l conan-base.lock -pr:h test-debug -pr:b test-release conanfile.txt --build
$ conan lock create -l conan-base.lock -pr:h test-debug -pr:b test-release conanfile.txt --build
zlib/1.2.11: Forced build from source
libuuid/1.0.3: Forced build from source
ERROR: 'zlib/1.2.11#280f98686dda91120690d3b58806868a' package-id '6af9cc7cb931c5ad942174fd7838eb655717c709' doesn't match the locked one '23b828d52c0630e6b0b96d2945419feb7843c4f8'
@hannahwhy
Copy link
Contributor Author

Some miscellaneous notes:

On a hunch that doxygen's custom package ID might be causing confusion, I tried the above procedure with the following patch applied to the doxygen recipe:

diff --git a/recipes/doxygen/all/conanfile.py b/recipes/doxygen/all/conanfile.py
index 66d52c0cd..42e996f52 100644
--- a/recipes/doxygen/all/conanfile.py
+++ b/recipes/doxygen/all/conanfile.py
@@ -91,16 +91,6 @@ class DoxygenConan(ConanFile):
         cmake = self._configure_cmake()
         cmake.install()
 
-    def package_id(self):
-        del self.info.settings.compiler
-
-        # Doxygen doesn't make code. Any package that will run is ok to use.
-        # It's ok in general to use a release version of the tool that matches the
-        # build os and architecture.
-        compatible_pkg = self.info.clone()
-        compatible_pkg.settings.build_type = "Release"
-        self.compatible_packages.append(compatible_pkg)
-

That, however, had the same result.


I'm not sure if this issue is a CCI, Conan, or other bug, but this is the first package pair I've seen that exhibits this behavior under a host/build profile split where the host and build profiles have different build types.

This procedure successfully completes if the host and build profiles have identical build types.

@madebr
Copy link
Contributor

madebr commented Aug 18, 2021

This issue looks conan related, not cci specific.
I'm tagging some people from conan/jfrog: @lasote @memsharded @danimtb (Sorry if I wrongfully bothered you)

@danimtb
Copy link
Member

danimtb commented Aug 19, 2021

@madebr thanks for the ping. I am transferring it to the conan client repository

@danimtb danimtb transferred this issue from conan-io/conan-center-index Aug 19, 2021
@hannahwhy hannahwhy changed the title [package] zlib/1.2.11: "package-id doesn't match" error when used with doxygen/1.9.1 and base lockfiles [bug]: "package-id doesn't match" error with zlib/1.2.11, doxygen/1.9.1, and base lockfiles Aug 19, 2021
@hannahwhy
Copy link
Contributor Author

@danimtb Thanks for moving this to conan-io/conan. I've modified the title a bit to better fit in with other bug reports.

@memsharded
Copy link
Member

I am trying to reproduce this issue, so far without success. My current test is:

    @staticmethod
    def test_cross_build_package_id_error():
        # https://github.com/conan-io/conan/issues/9446
        client = TestClient()
        client.run("config set general.revisions_enabled=1")
        client.run("config set general.default_package_id_mode=package_revision_mode")
        conanfile_txt = textwrap.dedent("""
            [requires]
            zlib/1.2.11

            [build_requires]
            doxygen/1.9.1
            """)
        profile_release = textwrap.dedent("""
            [settings]
            build_type=Release
            """)
        profile_debug = textwrap.dedent("""
            [settings]
            build_type=Debug
            """)
        client.save({"zlib/conanfile.py": GenConanfile().with_settings("build_type"),
                     "doxygen/conanfile.py": GenConanfile().with_settings("build_type"),
                     "consumer/conanfile.txt": conanfile_txt,
                     "release": profile_release,
                     "debug": profile_debug
                     })

        client.run("export zlib zlib/1.2.11@")
        client.run("export doxygen doxygen/1.9.1@")

        client.run("lock create consumer/conanfile.txt --base --build --lockfile-out=conan.lock")
        print(client.load("conan.lock"))

        client.run("lock create consumer/conanfile.txt --build "
                   "--lockfile=conan.lock --lockfile-out=conan.lock "
                   "-pr:h debug -pr:b release")

Some possible things to check:

  • Print the lockfile generated with step 2) including the --base argument, just to make sure that it doesn't contain any package-id. I don't know why step 3) is complaining about a mismatch, because the "base" lockfiles do not store the package_id of the dependencies.
  • I would also suggest to capture the base profile with the same build/host profiles you are going to use later, if possible.
  • I still don't get the possible role of build_requires, as they are not connected to package_id of consumers. In theory it should be possible to reproduce without using build_requires

@hannahwhy
Copy link
Contributor Author

Here's a base lockfile that I generated from step 2:

Base lockfile
{
 "graph_lock": {
  "nodes": {
   "0": {
    "requires": [
     "1"
    ],
    "build_requires": [
     "2"
    ],
    "path": "conanfile.txt",
    "context": "host"
   },
   "1": {
    "ref": "zlib/1.2.11#08c5163c8e302d1482d8fa2be93736af",
    "context": "host"
   },
   "2": {
    "ref": "doxygen/1.9.1#53cc478fca12af67b4e4af0a0f360b62",
    "requires": [
     "3",
     "1"
    ],
    "build_requires": [
     "10",
     "12"
    ],
    "context": "host"
   },
   "3": {
    "ref": "xapian-core/1.4.18#94d37807039bb8cda0c16410a96a70b3",
    "requires": [
     "4",
     "1"
    ],
    "context": "host"
   },
   "4": {
    "ref": "libuuid/1.0.3#42d244923e46f0a22bdafd1978cc4109",
    "build_requires": [
     "5"
    ],
    "context": "host"
   },
   "5": {
    "ref": "libtool/2.4.6#bd7c7de8fc74ea4435fbf72da105569c",
    "requires": [
     "6"
    ],
    "build_requires": [
     "9"
    ],
    "context": "host"
   },
   "6": {
    "ref": "automake/1.16.3#b955497aa8da80a23c4e633ec1a1c8ae",
    "requires": [
     "7"
    ],
    "context": "host"
   },
   "7": {
    "ref": "autoconf/2.71#a11b8fc050bb986f37c27897a2ff8ad7",
    "requires": [
     "8"
    ],
    "context": "host"
   },
   "8": {
    "ref": "m4/1.4.18#6b0d509a6e5257f042b3076decabe2ee",
    "context": "host"
   },
   "9": {
    "ref": "gnu-config/cci.20201022#c9b5dccbc620ae581bb1c60547ced620",
    "context": "host"
   },
   "10": {
    "ref": "flex/2.6.4#4ee653bf6e3f8dee58fe7e8b74368f6c",
    "requires": [
     "11"
    ],
    "context": "host"
   },
   "11": {
    "ref": "m4/1.4.18#6b0d509a6e5257f042b3076decabe2ee",
    "context": "host"
   },
   "12": {
    "ref": "bison/3.7.1#bc01a3da7230fa5625eaaec51722d83e",
    "requires": [
     "11"
    ],
    "build_requires": [
     "13"
    ],
    "context": "host"
   },
   "13": {
    "ref": "flex/2.6.4#4ee653bf6e3f8dee58fe7e8b74368f6c",
    "requires": [
     "11"
    ],
    "context": "host"
   }
  },
  "revisions_enabled": true
 },
 "version": "0.4"
}

Creating the base profile using the build and host profiles, however, did allow step (3) to succeed. The base lockfile generated from this step is reproduced below.

conan-base.lock with build and host profiles specified (conan lock create conanfile.txt --base --build --lockfile-out=conan-base.lock -pr:h dbg -pr:b rel)
{
 "graph_lock": {
  "nodes": {
   "0": {
    "requires": [
     "1"
    ],
    "build_requires": [
     "2"
    ],
    "path": "conanfile.txt",
    "context": "host"
   },
   "1": {
    "ref": "zlib/1.2.11#08c5163c8e302d1482d8fa2be93736af",
    "context": "host"
   },
   "2": {
    "ref": "doxygen/1.9.1#53cc478fca12af67b4e4af0a0f360b62",
    "requires": [
     "3",
     "5"
    ],
    "build_requires": [
     "11",
     "13"
    ],
    "context": "build"
   },
   "3": {
    "ref": "xapian-core/1.4.18#94d37807039bb8cda0c16410a96a70b3",
    "requires": [
     "4",
     "5"
    ],
    "context": "build"
   },
   "4": {
    "ref": "libuuid/1.0.3#42d244923e46f0a22bdafd1978cc4109",
    "build_requires": [
     "6"
    ],
    "context": "build"
   },
   "5": {
    "ref": "zlib/1.2.11#08c5163c8e302d1482d8fa2be93736af",
    "context": "build"
   },
   "6": {
    "ref": "libtool/2.4.6#bd7c7de8fc74ea4435fbf72da105569c",
    "requires": [
     "7"
    ],
    "build_requires": [
     "10"
    ],
    "context": "build"
   },
   "7": {
    "ref": "automake/1.16.3#b955497aa8da80a23c4e633ec1a1c8ae",
    "requires": [
     "8"
    ],
    "context": "build"
   },
   "8": {
    "ref": "autoconf/2.71#a11b8fc050bb986f37c27897a2ff8ad7",
    "requires": [
     "9"
    ],
    "context": "build"
   },
   "9": {
    "ref": "m4/1.4.18#6b0d509a6e5257f042b3076decabe2ee",
    "context": "build"
   },
   "10": {
    "ref": "gnu-config/cci.20201022#c9b5dccbc620ae581bb1c60547ced620",
    "context": "build"
   },
   "11": {
    "ref": "flex/2.6.4#4ee653bf6e3f8dee58fe7e8b74368f6c",
    "requires": [
     "12"
    ],
    "context": "build"
   },
   "12": {
    "ref": "m4/1.4.18#6b0d509a6e5257f042b3076decabe2ee",
    "context": "build"
   },
   "13": {
    "ref": "bison/3.7.1#bc01a3da7230fa5625eaaec51722d83e",
    "requires": [
     "12"
    ],
    "build_requires": [
     "14"
    ],
    "context": "build"
   },
   "14": {
    "ref": "flex/2.6.4#4ee653bf6e3f8dee58fe7e8b74368f6c",
    "requires": [
     "12"
    ],
    "context": "build"
   }
  },
  "revisions_enabled": true
 },
 "version": "0.4"
Base lockfile diff
--- conan-base-no-profiles.lock	2021-08-24 10:33:59.843075786 -0500
+++ conan-base-with-profiles.lock	2021-08-24 10:34:04.686046536 -0500
@@ -19,88 +19,92 @@
     "ref": "doxygen/1.9.1#53cc478fca12af67b4e4af0a0f360b62",
     "requires": [
      "3",
-     "1"
+     "5"
     ],
     "build_requires": [
-     "10",
-     "12"
+     "11",
+     "13"
     ],
-    "context": "host"
+    "context": "build"
    },
    "3": {
     "ref": "xapian-core/1.4.18#94d37807039bb8cda0c16410a96a70b3",
     "requires": [
      "4",
-     "1"
+     "5"
     ],
-    "context": "host"
+    "context": "build"
    },
    "4": {
     "ref": "libuuid/1.0.3#42d244923e46f0a22bdafd1978cc4109",
     "build_requires": [
-     "5"
+     "6"
     ],
-    "context": "host"
+    "context": "build"
    },
    "5": {
+    "ref": "zlib/1.2.11#08c5163c8e302d1482d8fa2be93736af",
+    "context": "build"
+   },
+   "6": {
     "ref": "libtool/2.4.6#bd7c7de8fc74ea4435fbf72da105569c",
     "requires": [
-     "6"
+     "7"
     ],
     "build_requires": [
-     "9"
+     "10"
     ],
-    "context": "host"
+    "context": "build"
    },
-   "6": {
+   "7": {
     "ref": "automake/1.16.3#b955497aa8da80a23c4e633ec1a1c8ae",
     "requires": [
-     "7"
+     "8"
     ],
-    "context": "host"
+    "context": "build"
    },
-   "7": {
+   "8": {
     "ref": "autoconf/2.71#a11b8fc050bb986f37c27897a2ff8ad7",
     "requires": [
-     "8"
+     "9"
     ],
-    "context": "host"
+    "context": "build"
    },
-   "8": {
+   "9": {
     "ref": "m4/1.4.18#6b0d509a6e5257f042b3076decabe2ee",
-    "context": "host"
+    "context": "build"
    },
-   "9": {
+   "10": {
     "ref": "gnu-config/cci.20201022#c9b5dccbc620ae581bb1c60547ced620",
-    "context": "host"
+    "context": "build"
    },
-   "10": {
+   "11": {
     "ref": "flex/2.6.4#4ee653bf6e3f8dee58fe7e8b74368f6c",
     "requires": [
-     "11"
+     "12"
     ],
-    "context": "host"
+    "context": "build"
    },
-   "11": {
+   "12": {
     "ref": "m4/1.4.18#6b0d509a6e5257f042b3076decabe2ee",
-    "context": "host"
+    "context": "build"
    },
-   "12": {
+   "13": {
     "ref": "bison/3.7.1#bc01a3da7230fa5625eaaec51722d83e",
     "requires": [
-     "11"
+     "12"
     ],
     "build_requires": [
-     "13"
+     "14"
     ],
-    "context": "host"
+    "context": "build"
    },
-   "13": {
+   "14": {
     "ref": "flex/2.6.4#4ee653bf6e3f8dee58fe7e8b74368f6c",
     "requires": [
-     "11"
+     "12"
     ],
-    "context": "host"
+    "context": "build"
    }
   },
   "revisions_enabled": true

@memsharded
Copy link
Member

memsharded commented Aug 24, 2021

I think I start to understand the issue and why my test was not reproducing it.

The problem is that zlib is a transitive requirement of some build_require. But in the first case, when not defining the 2 profiles, zlib is always in the host context. When later the 2 profiles are used, there is a mismatch because now there exist a zlib in the "build" context. The graph is different, and the error message is expected it is raising an unexpected difference in the graph. It might not be an issue in many cases, where there are no overlap of packages in the build and host context.

In short: when a lockfile is computed, subsequent usage of that lockfile should be consistent with it. If the base lockfile is intended to be used with the 2 profiles approach, then the base lockfile must be captured with the 2 profiles.

@hannahwhy
Copy link
Contributor Author

In short: when a lockfile is computed, subsequent usage of that lockfile should be consistent with it. If the base lockfile is intended to be used with the 2 profiles approach, then the base lockfile must be captured with the 2 profiles.

Hmm. So, I first ran into this problem when examining a problem in a CI setup that did the following:

  1. Generate a base lockfile
  2. For each build/host combination, use the base lockfile to generate a concrete lockfile for the build and host profiles

We added step (1) to make sure that each build launched in (2) would be sure to use the same recipe revision of a given package. (We have multiple builds simultaneously reading and writing to an Artifactory repository.) For this scenario, I am under the impression that (1) should not have any profiles; is this incorrect?

@franramirez688
Copy link
Contributor

franramirez688 commented Aug 25, 2021

Could it be related to this other issue? #9398
I opened a PR for that issue as well: #9411

@memsharded
Copy link
Member

We added step (1) to make sure that each build launched in (2) would be sure to use the same recipe revision of a given package. (We have multiple builds simultaneously reading and writing to an Artifactory repository.) For this scenario, I am under the impression that (1) should not have any profiles; is this incorrect?

Yes, a base lockfile shouldn't and won't contain the profiles. The issue here is that the result, also the "base" result is different, because the graph is different when using the 2 profiles, because it already annotates the "context" and using 2 profiles introduce the "build" context, also in the base profile.

@hannahwhy
Copy link
Contributor Author

Ah, I think I understand: it sounds like I should be able to use any two profiles when generating the base lockfile, as it's the fact that a build/host split exists that's important.

I'll give that a try in my CI system and report back; if it works for doxygen, I think that'll be an effective workaround.

@memsharded
Copy link
Member

Ah, I think I understand: it sounds like I should be able to use any two profiles when generating the base lockfile, as it's the fact that a build/host split exists that's important.

Yep, exactly, it is recommended to use the 2 profiles that would represent the largest subset of dependencies in case there are conditional dependencies that exist in one platform and not the others, but as long as you use 2 profiles, the "topology" of the graph will be good enough to create a lockfile later from it using 2 profiles.

Looking forward your feedback, cross fingers! 🤞 😄

@hannahwhy
Copy link
Contributor Author

hannahwhy commented Aug 25, 2021

@memsharded So far, it looks like things are working -- I've been able to run the build that motivated this report (an x86-64 -> armv7 cross build) without incident, using doxygen/1.9.1 as a build requirement.

Given Conan 2.0 will always use separate build and host profiles (conan-io/tribe#23), I'm okay with doing this for Conan 1.x. If you also think this is acceptable, I'm okay with writing up a PR to note this workaround in the documentation.

Thanks again for looking into this!

@memsharded
Copy link
Member

Given Conan 2.0 will always use separate build and host profiles (conan-io/tribe#23), I'm okay with doing this for Conan 1.x. If you also think this is acceptable, I'm okay with writing up a PR to note this workaround in the documentation.

Yes, please that would be great

Also, we are proposing #9468 for next release, to define always the build profile by default, even if not specified in command line, that might be of your interest if this moves forward.

@hannahwhy
Copy link
Contributor Author

Sorry about the delay. I'll aim to get a PR for this documentation change out in the next day or two.

@hannahwhy
Copy link
Contributor Author

Sorry about the delay. I'll aim to get a PR for this documentation change out in the next day or two.

I've opened conan-io/docs#2203 for this.

@memsharded
Copy link
Member

conan-io/docs#2203, will be published in 1.40, I think we can close this issue now?

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

5 participants