Skip to content

Commit

Permalink
fix: Recent journaling changes break with some fmtlib versions (#1715)
Browse files Browse the repository at this point in the history
Certain fmt library versions don't automatically know how to format
atomics. Explicitly load them to turn into regular ints to avoid new
build errors introduced by the recent journaling changes.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
  • Loading branch information
lgritz committed Aug 23, 2023
1 parent 9e30a4e commit 271f8bc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ jobs:
os: ubuntu-22.04
cxx_compiler: g++-11
cxx_std: 17
fmt_ver: 9.1.0
fmt_ver: 10.1.0
openexr_ver: v3.1.7
openimageio_ver: master
pybind11_ver: v2.10.0
Expand Down
2 changes: 1 addition & 1 deletion src/liboslcomp/ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ScopeExit print_node_counts([]() {
for (int i = 0; i < ASTNode::_last_node; ++i)
if (node_counts[i] > 0)
Strutil::print("ASTNode type {:2}: {:5} (peak {:5})\n", i,
node_counts[i], node_counts_peak[i]);
node_counts[i].load(), node_counts_peak[i].load());
});
} // namespace
#endif
Expand Down
6 changes: 3 additions & 3 deletions src/liboslexec/journal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,13 @@ Reader::process()
if (m_org.additional_bytes_required != 0) {
std::string overfill_message = OSL::fmtformat(
"Journal sized {} bytes couldn't capture all prints, warnings, and errors. Additional {} bytes would be required",
m_org.buf_size, m_org.additional_bytes_required);
m_org.buf_size, m_org.additional_bytes_required.load());
m_reporter.report_warning(-1, -1, overfill_message);
}
if (m_org.exceeded_page_size != 0) {
std::string exceeded_message = OSL::fmtformat(
"Journal page size {} exceeded, largest individual message sized {} bytes. Consider increasing your page size.",
m_org.page_size, m_org.exceeded_page_size);
m_org.page_size, m_org.exceeded_page_size.load());
m_reporter.report_warning(-1, -1, exceeded_message);
}
}
Expand Down Expand Up @@ -436,4 +436,4 @@ Reader::process_entries_for_thread(int thread_index)

} //namespace journal

OSL_NAMESPACE_EXIT
OSL_NAMESPACE_EXIT

0 comments on commit 271f8bc

Please sign in to comment.