build: Bump fmt minimum 7.0, fix fmt+gcc bugs #3973
Merged
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.
Bump fmt minimum to 7.0 for OIIO 2.5. fmt 7.0 is 3 years old, so let's stop doing extra work to support 6.x. It's not that we depend on newer features per se, but I'd like to no longer need separate reference output for some tests whose formatting behavior changed slightly between 6.x and 7.0.
Rig CI to properly test "latest" and "bleeding edge" fmt. It turns out we had not yet been testing 10.1 or keeping up with their master.
In the process, I discovered that the combo of fmt >= 10.1 and gcc >= 11 results in a mangled AVX math heisenbug, symptomatic in our simd_test. I struggled with this on and off for many days, having great difficulty reproducing (though it does fail every time and deterministically, I just can't seem to narrow it to a smaller example). It only happens with gcc, only gcc >= 11, only when we use FMT_EXCEPTIONS=0 to disable true exceptions in fmt. The change happens specifically at fmt commit 9a034b0 (midway between 10.0 and 10.1), which changes the definition of FMT_THROW when exceptions are disabled. Why this should affect SIMD math is a total mystery, and currently I am suspecting either a gcc compiler error or that it's exposing undefined behavior. I found that redefining FMT_THROW on our side to something innocuous is a good workaround. If I no longer disable fmt exceptions, that also makes it work, but I don't know what that might break for us or downstream.
My report of this to the fmt project is here, maybe they'll uncover the true cause.