Conversation
Co-authored-by: Cadons <43477517+Cadons@users.noreply.github.com>
#include <print> causing Linux x64 build failures
|
@copilot macos build fails on std::format |
Co-authored-by: Cadons <43477517+Cadons@users.noreply.github.com>
Fixed in commit
|
There was a problem hiding this comment.
Pull request overview
This PR removes unused #include <print> (C++23) directives that break Linux x64 builds in older GCC/libstdc++ environments (e.g., vcpkg CI), while the codebase’s logging continues to go through docraft_logger.h.
Changes:
- Removed
#include <print>from 4 layout handler.ccfiles. - Removed
#include <print>from 2 renderer painter.ccfiles.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| docraft/src/docraft/layout/handler/docraft_layout_handler.cc | Drops unused <print> include to avoid GCC <14 build failure. |
| docraft/src/docraft/layout/handler/docraft_layout_text_handler.cc | Drops unused <print> include to avoid GCC <14 build failure. |
| docraft/src/docraft/layout/handler/docraft_layout_table_handler.cc | Drops unused <print> include; note: file uses std::format and should include <format>. |
| docraft/src/docraft/layout/handler/docraft_basic_layout_handler.cc | Drops unused <print> include to avoid GCC <14 build failure. |
| docraft/src/docraft/renderer/painter/docraft_text_painter.cc | Drops unused <print> include to avoid GCC <14 build failure. |
| docraft/src/docraft/renderer/painter/docraft_table_painter.cc | Drops unused <print> include; note: file uses std::format and should include <format>. |
Comments suppressed due to low confidence (1)
docraft/src/docraft/renderer/painter/docraft_table_painter.cc:22
- This file uses std::format (e.g., in LOG_DEBUG) but doesn't include . With removed, compilation may fail on toolchains that don't get transitively. Add an explicit #include in this translation unit (or move the formatting usage behind a header that includes ).
#include "docraft/renderer/painter/docraft_table_painter.h"
#include "docraft/backend/docraft_line_rendering_backend.h"
#include "docraft/renderer/painter/docraft_image_painter.h"
#include "docraft/utils/docraft_logger.h"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| #include <algorithm> | ||
| #include <numeric> | ||
| #include <print> | ||
| #include <vector> |
#include <print> causing Linux x64 build failures#include <print> and replace std::format
This was already fixed in commit |
…ency Co-authored-by: Cadons <43477517+Cadons@users.noreply.github.com>
Done in commit |
#include <print> and replace std::format#include <print> and replace std::format with fmt::format
Co-authored-by: Cadons <43477517+Cadons@users.noreply.github.com>
Done in commit |
Fixes cross-platform build failures in the VCPKG CI environment caused by use of C++ standard library headers that are not available on all supported compiler versions.
Changes
Removed unused
#include <print>(not available on GCC < 14) from:docraft/src/docraft/layout/handler/docraft_layout_handler.ccdocraft/src/docraft/layout/handler/docraft_layout_text_handler.ccdocraft/src/docraft/layout/handler/docraft_layout_table_handler.ccdocraft/src/docraft/layout/handler/docraft_basic_layout_handler.ccdocraft/src/docraft/renderer/painter/docraft_text_painter.ccdocraft/src/docraft/renderer/painter/docraft_table_painter.ccReplaced
std::format/ removed#include <format>(not available on older macOS/Apple Clang) withfmt::formatfrom the{fmt}library in:docraft/src/docraft/model/docraft_position.ccdocraft/src/docraft/renderer/painter/docraft_table_painter.ccdocraft/src/docraft/layout/handler/docraft_layout_table_handler.ccdocraft/src/docraft/templating/docraft_template_engine.ccAdded
fmtas a project dependency to support cross-platform string formatting:fmttovcpkg.jsonfind_package(fmt CONFIG REQUIRED)toCMakeLists.txtfmt::fmtto thedocraftlibrary indocraft/CMakeLists.txtUpdated CI workflows to install
fmton all platforms:libfmt-devto the Linux apt-get install step in.github/workflows/build.ymlfmtto the macOS Homebrew install step in.github/workflows/build.ymlOriginal prompt
This section details on the original issue you should resolve
<issue_title>VCPKG port fixes</issue_title>
<issue_description>This issue fixes the project for publishing to the vcpkg registry.</issue_description>
<agent_instructions>Linux x64 build failed: