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

Configuration failure with fmt-11.0 due to movement of FMT_VERSION #1477

Closed
hhoffstaette opened this issue Jul 2, 2024 · 2 comments · Fixed by #1478
Closed

Configuration failure with fmt-11.0 due to movement of FMT_VERSION #1477

hhoffstaette opened this issue Jul 2, 2024 · 2 comments · Fixed by #1478
Labels
bug Does not work as intended/documented build Affects building of Ccache itself
Milestone

Comments

@hhoffstaette
Copy link
Contributor

How to reproduce

  1. install fmt-11.0
  2. try to build ccache-4.10.1 using external fmt
  3. configuration error!

Actual behavior

CMake Error at cmake/FindFmt.cmake:11 (math):
  math cannot parse the expression: " / 10000": syntax error, unexpected
  exp_DIVIDE (2).
Call Stack (most recent call first):
  cmake/Dependencies.cmake:25 (find_package)
  CMakeLists.txt:88 (include)

CMake Error at cmake/FindFmt.cmake:12 (math):
  math cannot parse the expression: " / 100 % 100": syntax error, unexpected
  exp_DIVIDE (2).
Call Stack (most recent call first):
  cmake/Dependencies.cmake:25 (find_package)
  CMakeLists.txt:88 (include)

CMake Error at cmake/FindFmt.cmake:13 (math):
  math cannot parse the expression: " % 100": syntax error, unexpected
  exp_MOD (2).
Call Stack (most recent call first):
  cmake/Dependencies.cmake:25 (find_package)
  CMakeLists.txt:88 (include)

Expected behavior

Correct configuration

Environment

ccache version 4.10.1

Reported on Gentoo in: https://bugs.gentoo.org/935291 (detailed logs etc).

@hhoffstaette hhoffstaette added the bug Does not work as intended/documented label Jul 2, 2024
@hhoffstaette
Copy link
Contributor Author

hhoffstaette commented Jul 2, 2024

As documented on the downstream bug, fmt-11.0 has changed the location of FMT_VERSION to be in base.h, so the version check does not find anything and croaks.

@jrosdahl jrosdahl added the build Affects building of Ccache itself label Jul 2, 2024
@jrosdahl jrosdahl added this to the 4.10.2 milestone Jul 2, 2024
@jrosdahl
Copy link
Member

jrosdahl commented Jul 2, 2024

Workarounds until ccache 4.10.2 or 4.11 is released:

  • Pass -D FMT_INCLUDE_DIR=<path-to-include-dir> and -D FMT_LIBRARY=<path-to-lib> to CMake explicitly.
  • Pass -D DEP_FMT=BUNDLED to CMake to use the bundled Fmt copy instead of the system one.

jrosdahl pushed a commit that referenced this issue Jul 2, 2024
fmt-11.0 moved the FMT_VERSION from core.h to base.h, so try the
new header first and then fall back to the old one.

Closes: #1477
(cherry picked from commit 71f772e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Does not work as intended/documented build Affects building of Ccache itself
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants