Skip to content

Fix VRS OSS macOS build: include <fmt/format.h> for fmt::format#252

Open
YLouWashU wants to merge 1 commit into
facebookresearch:mainfrom
YLouWashU:export-D109906400
Open

Fix VRS OSS macOS build: include <fmt/format.h> for fmt::format#252
YLouWashU wants to merge 1 commit into
facebookresearch:mainfrom
YLouWashU:export-D109906400

Conversation

@YLouWashU

@YLouWashU YLouWashU commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

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.cppXR_LOGW, then vrs/DataSource.cppXR_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

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 27, 2026
@meta-codesync

meta-codesync Bot commented Jun 27, 2026

Copy link
Copy Markdown
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
@meta-codesync meta-codesync Bot changed the title Fix VRS OSS macOS build: include <fmt/format.h> in Log.h Fix VRS OSS macOS build: include <fmt/format.h> for fmt::format Jun 27, 2026
@YLouWashU YLouWashU force-pushed the export-D109906400 branch from af09813 to 76d867d Compare June 27, 2026 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant