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

[question] conan graph explain is unclear #16161

Open
1 task done
Todiq opened this issue Apr 26, 2024 · 1 comment
Open
1 task done

[question] conan graph explain is unclear #16161

Todiq opened this issue Apr 26, 2024 · 1 comment
Assignees

Comments

@Todiq
Copy link

Todiq commented Apr 26, 2024

What is your question?

Hello,

I have a question regarding boost dependencies. My recipe looks like this:

[requires]
boost/1.81.0

[options]
boost*:shared=True

However, when running conan graph explain . -pr:h windows -pr:b linux --remote conancenter, I get the following:

Click to expand log
======== Computing dependency graph ========
Graph root
    conanfile.txt: /workspace/conanfile.txt
Requirements
    boost/1.81.0#b8dc4d6077ea9c27851f39511ef48c72 - Cache
    bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4 - Cache
    zlib/1.3.1#f52e03ae3d251dec704634230cd806a2 - Cache
Build requirements
    b2/4.10.1#a41eecb267963ddf518e3c177eae60e1 - Cache
Resolved version ranges
    zlib/[>=1.2.11 <2]: zlib/1.3.1

======== Computing necessary packages ========
boost/1.81.0: Checking 3 compatible configurations
boost/1.81.0: Compatible configurations not found in cache, checking servers
boost/1.81.0: '0fca443ce7b4bec469dc8dfed3966275f5125381': compiler.cppstd=17
boost/1.81.0: '9344293e72e0c8b67d52530f98b530fafa9ed0e5': compiler.cppstd=20
boost/1.81.0: 'ea6e9113f49d26a6bf16ae55b70e880e60782e99': compiler.cppstd=23
Requirements
    boost/1.81.0#b8dc4d6077ea9c27851f39511ef48c72:baa3cee86fb8facf12380b0545abc82bcf63372c - Missing
Build requirements
Skipped binaries
    bzip2/1.0.8, zlib/1.3.1, b2/4.10.1

======== Retrieving and computing closest binaries ========
Missing binary: boost/1.81.0
With conaninfo.txt (package_id):
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows
[options]
asio_no_deprecated=False
bzip2=True
diagnostic_definitions=False
error_code_header_only=False
filesystem_no_deprecated=False
filesystem_use_std_fs=False
header_only=False
i18n_backend_iconv=off
i18n_backend_icu=False
layout=system
lzma=False
magic_autolink=False
multithreading=True
namespace=boost
namespace_alias=False
numa=True
segmented_stacks=False
shared=True
system_no_deprecated=False
system_use_utf8=False
visibility=hidden
without_atomic=False
without_chrono=False
without_container=False
without_context=False
without_contract=False
without_coroutine=False
without_date_time=False
without_exception=False
without_fiber=False
without_filesystem=False
without_graph=False
without_graph_parallel=True
without_iostreams=False
without_json=False
without_locale=False
without_log=False
without_math=False
without_mpi=True
without_nowide=False
without_program_options=False
without_python=True
without_random=False
without_regex=False
without_serialization=False
without_stacktrace=False
without_system=False
without_test=False
without_thread=False
without_timer=False
without_type_erasure=False
without_url=False
without_wave=False
zlib=True
zstd=False
[requires]
bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4:67bfcb7b4b78262b9d05495e479dcd92f747316b
zlib/1.3.1#f52e03ae3d251dec704634230cd806a2:7bfde258ff4f62f75668d0896dbddedaa7480a0f

Finding binaries in the cache
Finding binaries in remote conancenter

======== Closest binaries ========
boost/1.81.0
  boost/1.81.0#b8dc4d6077ea9c27851f39511ef48c72%1712856332.377 (2024-04-11 17:25:32 UTC)
    boost/1.81.0#b8dc4d6077ea9c27851f39511ef48c72:b282f151946d68ab853c39fbdc3172848f25fad4
      remote: conancenter
      settings: Windows, x86_64, Release, msvc, 14, dynamic, Release, 193
      options(diff):
      requires: bzip2/1.0.Z, zlib/1.3.Z
      diff
        dependencies
          expected: bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4:67bfcb7b4b78262b9d05495e479dcd92f747316b, zlib/1.3.1#f52e03ae3d251dec704634230cd806a2:7bfde258ff4f62f75668d0896dbddedaa7480a0f
          existing: bzip2/1.0.Z, zlib/1.3.Z
        explanation: This binary has same settings and options, but different dependencies

I find it not very clear. In fact, the option that causes a recompile is boost*:shared=True. Removing it from the conanfile.txt leads to:

======== Computing dependency graph ========
Graph root
    conanfile.txt: /workspace/conanfile.txt
Requirements
    boost/1.81.0#b8dc4d6077ea9c27851f39511ef48c72 - Cache
    bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4 - Cache
    zlib/1.3.1#f52e03ae3d251dec704634230cd806a2 - Cache
Build requirements
    b2/4.10.1#a41eecb267963ddf518e3c177eae60e1 - Cache
Resolved version ranges
    zlib/[>=1.2.11 <2]: zlib/1.3.1

======== Computing necessary packages ========
Requirements
    boost/1.81.0#b8dc4d6077ea9c27851f39511ef48c72:5d72bae26b292186b394bf49abc33edbee34a6b3#ef5f89eae6edb29fb13d9a20e1058964 - Download (conancenter)
    bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4:67bfcb7b4b78262b9d05495e479dcd92f747316b#cea9c0f0dfa41e83aebd5d39c5a5cbf3 - Download (conancenter)
    zlib/1.3.1#f52e03ae3d251dec704634230cd806a2:7bfde258ff4f62f75668d0896dbddedaa7480a0f#20d10b761ec15eed7a1d61c86bc7415a - Download (conancenter)
Build requirements
Skipped binaries
    b2/4.10.1

======== Retrieving and computing closest binaries ========
ERROR: There is no missing binary

Did I miss something? Thanks in advance for your time.

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@memsharded
Copy link
Member

Hi @Todiq

Thanks for your question.

The main lines are:

 dependencies
          expected: bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4:67bfcb7b4b78262b9d05495e479dcd92f747316b, zlib/1.3.1#f52e03ae3d251dec704634230cd806a2:7bfde258ff4f62f75668d0896dbddedaa7480a0f
          existing: bzip2/1.0.Z, zlib/1.3.Z

It means there is a mismatch in the dependencies versions that you are requesting. The binary that exist was built with dependencies bzip2/1.0.Z, but you are explicitly requesting a binary that is linked with the very specific bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4:67bfcb7b4b78262b9d05495e479dcd92f747316b, zlib/1.3.1#f52e03ae3d251dec704634230cd806a2:7bfde258ff4f62f75668d0896dbddedaa7480a0f

This is most likely because the existing binary was linked with transitive dependencies being shared libraries, that is, the default option *:shared=True, but in this case you might be requesting a binary with just boost:shared=True, that means it will be using the transitive dependencies bzip2 and zlib as static libraries. In this situation, boost is doing a full embedding of the dependencies binaries into its dynamic library artifact.

When you build a shared library against other shared libraries, it is binary compatible with more versions of the dependencies, as long as the interface doesn't change (then the 1.0.Z) but if you build a shared library against static libraries, a full copy of the static library is embedded inside the shared library, and thus the exact reference of the dependency is necessary.

Please let me know if this clarifies the issue.

@memsharded memsharded self-assigned this Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants