Skip to content

Conversation

nyllet
Copy link
Contributor

@nyllet nyllet commented Sep 14, 2025

Issue

This is an alternative solution to #7238

Tasklist

Requirements / Relations

none

@nyllet nyllet marked this pull request as draft September 14, 2025 11:27
@afarber
Copy link
Contributor

afarber commented Sep 14, 2025

Please do not forget to remove the fmt from scripts/update_dependencies.sh

@afarber
Copy link
Contributor

afarber commented Oct 18, 2025

Hi @nyllet, your PR removes the fmt library entirely and switches directly to std::format...

However, this might cause build failures on systems where std::format is incomplete. For example:

  • Clang with older libstdc++: The <format> header exists, but symbols are missing at link time
  • Some GCC 13 installations: Have incomplete chrono formatting support
  • Alpine Linux with GCC 14: Missing chrono formatters

I've just submitted #7261 which takes a different approach:

  • Adds a thin compatibility layer (util/format.hpp) that automatically uses std::format when available
  • Falls back to fmt::format on systems where std::format doesn't work
  • Uses CMake runtime detection (check_cxx_source_runs) to test compile, link and execution
  • Also fixes the node_osrm C++17/C++20 ABI mismatch that was overlooked in Use C++20 #6877

This way, we can:

  1. Keep fmt as a fallback for systems with incomplete std::format
  2. Gradually phase out fmt as older compilers are retired
  3. Avoid breaking builds for users on platforms with partial C++20 support

Would you be open to reviewing #7261 as an alternative approach?

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

Successfully merging this pull request may close these issues.

2 participants