Make nolocale-test actually disable locale - #4939
Merged
Merged
Conversation
nolocale-test defines FMT_STATIC_THOUSANDS_SEPARATOR, which stopped doing anything in b90b4bc ("Remove FMT_STATIC_THOUSANDS_SEPARATOR in favor of FMT_USE_LOCALE"). That macro no longer appears anywhere under include/, so since then the target has compiled src/format.cc with locale support enabled. It is not a dead target: the pedantic CI jobs build it (linux.yml, macos.yml both pass -DFMT_PEDANTIC=ON), and it passes. So the configuration looks covered while nothing actually tests it. fmtlib#4627 - a locale-off build break - landed during that window. Define FMT_USE_LOCALE=0 instead. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
vitaut
approved these changes
Sep 11, 2026
Contributor
|
Nice catch, thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
nolocale-testdefinesFMT_STATIC_THOUSANDS_SEPARATOR, which stopped doing anything in b90b4bc ("Remove FMT_STATIC_THOUSANDS_SEPARATOR in favor of FMT_USE_LOCALE"). That macro no longer appears anywhere underinclude/, so since then the target has compiledsrc/format.ccwith locale support enabled.It is not a dead target: the pedantic CI jobs build it (
linux.ymlandmacos.ymlboth pass-DFMT_PEDANTIC=ON), and it passes. So the configuration looks covered while nothing actually tests it. #4627, a locale-off build break, landed during that window.This defines
FMT_USE_LOCALE=0instead. Verified the target still builds clean in that configuration (MSVC 19.51, Ninja,-DFMT_PEDANTIC=ON).Two things this deliberately does not do, happy to follow up on either:
chrono.h/xchar.hto the target.chrono.hincludes<locale>unconditionally, and this target looks like it exists for platforms that have no<locale>at all. Instantiating the formatters in that configuration - which is what would actually have caught fix: error: invalid 'static_cast' from type 'fmt::v12::locale_ref' to type 'bool' #4627 - probably wants a separate target.FMT_PEDANTICis off in the Windows workflow, so this configuration still never builds on MSVC.