Fix VRS OSS macOS build: include <fmt/format.h> for fmt::format#252
Open
YLouWashU wants to merge 1 commit into
Open
Fix VRS OSS macOS build: include <fmt/format.h> for fmt::format#252YLouWashU wants to merge 1 commit into
YLouWashU wants to merge 1 commit into
Conversation
Contributor
|
@YLouWashU has exported this pull request. If you are a Meta employee, you can view the originating Diff in D109906400. |
Summary:
The VRS OSS GitHub CI (`Build VRS on macos-latest`, both `XPRS=OFF` and `XPRS=ON`) fails to compile with:
```
error: no member named 'format' in namespace 'fmt'
```
at every translation unit that uses the logging / check macros (first `vrs/helpers/Throttler.cpp` → `XR_LOGW`, then `vrs/DataSource.cpp` → `XR_DEV_CHECK_GT`, etc.).
The logging headers define their macros in terms of `fmt::format(...)` but only include `<fmt/core.h>`. `fmt::format` is declared in `<fmt/format.h>`. This compiled before only because older `{fmt}` releases happened to pull `format` in transitively via `core.h`. Homebrew on `macos-latest` recently upgraded `{fmt}` to 11.x, where the headers were reorganized (`core.h` is now a deprecated shim and no longer drags in the `format` definition), so the symbol is no longer visible. This is environment-driven — no VRS source change triggered it — which is why a previously-green build started failing this week, and why it is independent of the `XPRS` flag (both matrix legs break identically).
Switch the include to `<fmt/format.h>` (which transitively includes `core.h`/`base.h`) in every VRS OSS file that calls `fmt::format` but only included `<fmt/core.h>`:
- `vrs/oss/logging/Log.h`
- `vrs/oss/logging/Checks.h`
- `vrs/oss/logging/Verify.h`
- `vrs/utils/cli/CompressionBenchmark.cpp`
This makes each header/TU self-contained against the function it actually calls, independent of the `{fmt}` version.
Differential Revision: D109906400
af09813 to
76d867d
Compare
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.
Summary:
The VRS OSS GitHub CI (
Build VRS on macos-latest, bothXPRS=OFFandXPRS=ON) fails to compile with:at every translation unit that uses the logging / check macros (first
vrs/helpers/Throttler.cpp→XR_LOGW, thenvrs/DataSource.cpp→XR_DEV_CHECK_GT, etc.).The logging headers define their macros in terms of
fmt::format(...)but only include<fmt/core.h>.fmt::formatis declared in<fmt/format.h>. This compiled before only because older{fmt}releases happened to pullformatin transitively viacore.h. Homebrew onmacos-latestrecently upgraded{fmt}to 11.x, where the headers were reorganized (core.his now a deprecated shim and no longer drags in theformatdefinition), so the symbol is no longer visible. This is environment-driven — no VRS source change triggered it — which is why a previously-green build started failing this week, and why it is independent of theXPRSflag (both matrix legs break identically).Switch the include to
<fmt/format.h>(which transitively includescore.h/base.h) in every VRS OSS file that callsfmt::formatbut only included<fmt/core.h>:vrs/oss/logging/Log.hvrs/oss/logging/Checks.hvrs/oss/logging/Verify.hvrs/utils/cli/CompressionBenchmark.cppThis makes each header/TU self-contained against the function it actually calls, independent of the
{fmt}version.Differential Revision: D109906400