question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] FMT missing builddirs for the component

See original GitHub issue

Environment Details

  • os: Ubuntu 22.04
  • gcc version: 11.2
  • conan version: 1.51.1
  • python version: 3.10.4

Steps to reproduce

In an empty directory create a conanfile.txt with the following content:

[requires]
fmt/8.1.1

[generators]
cmake_paths

Issue conan install . and inspect conan_paths.cmake:

set(CONAN_FMT_ROOT "<path_to_conan_cache>/fmt/8.1.1/_/_/package/3bb43d390932310d9ef00e9986e41f02509d79e8")
set(CMAKE_MODULE_PATH  ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR})
set(CMAKE_PREFIX_PATH  ${CMAKE_PREFIX_PATH} ${CMAKE_CURRENT_LIST_DIR})

Expectation: CMAKE_MODULE_PATH and CMAKE_PREFIX_PATH contain the value of CONAN_FMT_ROOT Actual: Neither variable contains the value of CONAN_FMT_ROOT.

Possible cause

The cmake_paths generator generates the CMAKE_* variables by concatenating the build_paths arrays of the dependencies. The default value for this path (which would be the correct value here) is overriden in _call_package_info in conans/client/installer.py if hasattr(conanfile, "layout") is true.

The correct value is set in conan/client/installer.py:659:

conanfile.cpp_info = CppInfo(conanfile.name, package_folder)

But it is later overridden in conan/client/installer.py:679:

if hasattr(conanfile, "layout"):
    # Old cpp info without defaults (the defaults are in the new one)
    conanfile.cpp_info = CppInfo(conanfile.name, package_folder,
                                 default_values=CppInfoDefaultValues())

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
lasotecommented, Aug 16, 2022

IMHO the documentation isn’t wrong. What was documented aligned with our expectations and observations even if the implementation had different (but then compatible) semantics. The change in behavior actually breaks reasonable expectations that recipe authors may have after reading the docs.

That is True but the code of the cmake_paths never managed the root folder of the packages. That is a collateral effect of having a builddir declared in the dependencies pointing to ..

As a side-note: There is no clear indication in the docs that the cmake_paths generator is not maintained anymore. After reading the note on https://docs.conan.io/en/latest/integrations/build_system/cmake.html I expected a deprecation in the future but only after conan.tools.cmake became stable.

That is also True, but FYI we stopped long ago to develop Conan 1.X since we are working with 2.X beta.

Anyway I’ve talked with the team and we will “fix” the cmake_paths generator to add the root folders of the dependencies always because we understand this is breaking just because the dependencies are introducing the layout() method.

1reaction
SpaceImcommented, Aug 12, 2022

@lasote Context is a project that relies on CMAKE_MODULE_PATH to find its dependencies.

CMAKE_PREFIX_PATH I guess. root package folder of fmt in CMAKE_MODULE_PATH is useless since there is no cmake module file. CMAKE_MODULE_PATH is not used at all in commands like find_file, find_program, find_library etc.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[fmt] Build error - vcpkg hosed · Issue #26776 - GitHub
Note, I sets up it's own PATH where the WinKit's bin is missing! How nice. Where is the source of this mess? After...
Read more >
578426 – I can't find the format file `pdflatex.fmt'
Bug 578426 - I can't find the format file `pdflatex.fmt' ... Version-Release number of selected component (if applicable): rpm -q texlive ...
Read more >
515374 - add a flag to make packager.pm missing file warnings fatal
After fixing bug 511642 I cleaned up all the package manifest nonsense, so all of our builds are free of packager.pm warnings. We...
Read more >
49112 – [4.6/4.7 Regression] [OOP] Missing type-bound procedure ...
In this case we just pull out the component we Unfortunately this patchlet seems to induce the following testsuite regressions: FAIL: gfortran.dg/func_assign_3.
Read more >
[JDK-5038132] (fmt) missing support for '^' uppercase - Java Bug ...
When i did a diff between build 48 and build 49 source i could find the following method has a missed UPPERCASE support....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found