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

std::format does not play well with macos #822

Closed
anonrig opened this issue Jan 3, 2025 · 10 comments
Closed

std::format does not play well with macos #822

anonrig opened this issue Jan 3, 2025 · 10 comments

Comments

@anonrig
Copy link
Member

anonrig commented Jan 3, 2025

Referencing https://github.com/nodejs/node/actions/runs/12600455701/job/35119524310?pr=56452, std::format in URLPattern branch does not play well with macOS. cc @lemire

@lemire
Copy link
Member

lemire commented Jan 3, 2025

We have at least one macOS CI runner in ada:

https://github.com/ada-url/ada/actions/runs/12602577753/job/35125940436?pr=785

@lemire
Copy link
Member

lemire commented Jan 3, 2025

It builds fine in our other macos Runner:
https://github.com/ada-url/ada/actions/runs/12603258277/job/35127958267

@anonrig
Copy link
Member Author

anonrig commented Jan 3, 2025

I think the minimum deployment target of Node.js makes it really hard to support std::format

@lemire
Copy link
Member

lemire commented Jan 4, 2025

@anonrig What is the Apple/LLVM version?

We can drop the std::format thing, it is not at all essential... but std::format is C++20 and supported in LLVM as of LLVM 14.

@anonrig
Copy link
Member Author

anonrig commented Jan 4, 2025

node.js supports llvm 12 or higher. https://github.com/nodejs/node/blob/main/BUILDING.md

@lemire
Copy link
Member

lemire commented Jan 4, 2025

That C++20 support is described here:

https://clang.llvm.org/cxx_status.html#cxx20

@lemire
Copy link
Member

lemire commented Jan 4, 2025

But yeah, LLVM/libc++ 12 probably does not support std::format. :-/

@anonrig
Copy link
Member Author

anonrig commented Jan 4, 2025

What do you think about checking for llvm version before using std::format?

@lemire
Copy link
Member

lemire commented Jan 4, 2025

@anonrig

The clean way is to check __cpp_lib_format.

https://en.cppreference.com/w/cpp/feature_test

@lemire
Copy link
Member

lemire commented Jan 4, 2025

See e297f7c

@anonrig anonrig closed this as completed Jan 5, 2025
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