Skip to content

[ci] add fmtlib - #7165

Draft
AenBleidd wants to merge 2 commits into
masterfrom
vko_add_fmtlib
Draft

[ci] add fmtlib#7165
AenBleidd wants to merge 2 commits into
masterfrom
vko_add_fmtlib

Conversation

@AenBleidd

@AenBleidd AenBleidd commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary by cubic

Add fmt as a required dependency across Linux, macOS, and Windows. CI installs it on all arches, Autotools enforces it, and macOS builds a universal static libfmt.a with updated build scripts and docs.

  • Dependencies

    • Added fmt to all vcpkg.json configs (apps/libs/client/msbuild/android/mingw/manager) and the tests boinc port.
    • Linux CI: install libfmt-dev for x64, i386, arm64, and armhf in both linux.yml and linux-release.yml (including non-vcpkg arm paths).
    • Autotools: detect fmt via pkg-config or fallback header/link check; clear error if missing.
    • macOS: new mac_build/buildfmt.sh builds static libfmt.a for x86_64/arm64 (10.13 min); integrated into buildMacDependencies.sh, dependencyNames.sh, and setupForBOINC.sh; docs updated to include fmt; minor fixes in buildlibzip.sh; use wget -O for downloads.
    • Link fmt only where used (boinc, boincapi, boinc_zip); tests add find_dependency(fmt); Windows resolves fmt via vcpkg; fixed vboxwrapper.vcxproj additional library paths.
  • Migration

    • Linux: install libfmt-dev (Debian/Ubuntu) or libfmt-devel (Fedora), or use vcpkg.
    • macOS: install CMake command-line tools; buildMacDependencies.sh/setupForBOINC.sh build fmt automatically.
    • Windows: vcpkg pulls fmt; clean rebuild if linker errors appear.

Written for commit bc28b58. Summary will update on new commits.

Review in cubic

Copilot AI review requested due to automatic review settings July 3, 2026 04:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces fmt (fmtlib) as a cross-platform dependency and integrates it into the BOINC build/CI toolchain so it can be reliably available for upcoming formatted logging/output work.

Changes:

  • Windows: add /utf-8 compile flag and link fmt (fmt.lib/fmtd.lib) via the shared MSBuild property sheet; fix library directory propagation in vboxwrapper.vcxproj.
  • Autotools: add a pkg-config check that fails configure when fmt development files are missing.
  • macOS + vcpkg: add fmt to all relevant vcpkg.json configs; add macOS dependency metadata plus a new mac_build/buildfmt.sh and integrate it into the macOS dependency build script.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
win_build/vboxwrapper.vcxproj Preserves inherited library directories while adding $(TargetDir) for linking.
win_build/boinc.props Adds /utf-8 and links fmt libraries for Debug/Release builds.
mac_build/dependencyNames.sh Adds fmt version/name metadata for macOS dependency scripts.
mac_build/buildfmt.sh New script to build/install static libfmt.a (universal) for macOS dependencies.
configure.ac Adds a pkg-config dependency check for fmt.
3rdParty/vcpkg_ports/configs/msbuild/vcpkg.json Adds fmt to vcpkg dependencies for MSBuild-based builds.
3rdParty/vcpkg_ports/configs/manager/linux/vcpkg.json Adds fmt to vcpkg dependencies for the Linux manager config.
3rdParty/vcpkg_ports/configs/libs/windows/vcpkg.json Adds fmt to vcpkg dependencies for Windows libs config.
3rdParty/vcpkg_ports/configs/libs/vcpkg.json Adds fmt to vcpkg dependencies for shared libs config.
3rdParty/vcpkg_ports/configs/client/vcpkg.json Adds fmt to vcpkg dependencies for client config.
3rdParty/vcpkg_ports/configs/apps/mingw/vcpkg.json Adds fmt to vcpkg dependencies for MinGW apps config.
3rdParty/vcpkg_ports/configs/apps/linux/vcpkg.json Adds fmt to vcpkg dependencies for Linux apps config.
3rdParty/vcpkg_ports/configs/apps/android/vcpkg.json Adds fmt to vcpkg dependencies for Android apps config.
3rdParty/buildMacDependencies.sh Hooks fmt into the macOS dependency build pipeline.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread win_build/boinc.props Outdated
Comment thread configure.ac Outdated
Comment thread mac_build/buildfmt.sh Outdated
Comment thread mac_build/buildfmt.sh Outdated
Comment thread mac_build/buildfmt.sh
Copilot AI review requested due to automatic review settings July 3, 2026 05:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 10 comments.

Comment thread mac_build/buildfmt.sh Outdated
Comment thread mac_build/buildfmt.sh Outdated
Comment thread mac_build/buildfmt.sh
Comment thread 3rdParty/vcpkg_ports/configs/manager/linux/vcpkg.json Outdated
Comment thread 3rdParty/vcpkg_ports/configs/libs/windows/vcpkg.json Outdated
Comment thread 3rdParty/vcpkg_ports/configs/libs/vcpkg.json Outdated
Comment thread 3rdParty/vcpkg_ports/configs/client/vcpkg.json Outdated
Comment thread 3rdParty/vcpkg_ports/configs/apps/mingw/vcpkg.json Outdated
Comment thread 3rdParty/vcpkg_ports/configs/apps/linux/vcpkg.json Outdated
Comment thread 3rdParty/vcpkg_ports/configs/apps/android/vcpkg.json Outdated
Copilot AI review requested due to automatic review settings July 3, 2026 05:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 9 comments.

Comment thread configure.ac Outdated
Comment thread 3rdParty/vcpkg_ports/configs/apps/linux/vcpkg.json Outdated
Comment thread 3rdParty/vcpkg_ports/configs/apps/android/vcpkg.json Outdated
Comment thread 3rdParty/vcpkg_ports/configs/apps/mingw/vcpkg.json Outdated
Comment thread 3rdParty/vcpkg_ports/configs/client/vcpkg.json Outdated
Comment thread 3rdParty/vcpkg_ports/configs/libs/vcpkg.json Outdated
Comment thread 3rdParty/vcpkg_ports/configs/libs/windows/vcpkg.json Outdated
Comment thread 3rdParty/vcpkg_ports/configs/manager/linux/vcpkg.json Outdated
Comment thread mac_build/buildfmt.sh Outdated
Copilot AI review requested due to automatic review settings July 3, 2026 07:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.

Comment thread mac_build/buildfmt.sh Outdated
Comment thread mac_build/buildfmt.sh
Comment thread mac_build/buildfmt.sh Outdated
Comment thread configure.ac
Copilot AI review requested due to automatic review settings July 3, 2026 08:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated 10 comments.

Comment thread mac_build/buildfmt.sh
Comment thread 3rdParty/vcpkg_ports/configs/apps/linux/vcpkg.json Outdated
Comment thread 3rdParty/vcpkg_ports/configs/manager/linux/vcpkg.json Outdated
Comment thread 3rdParty/vcpkg_ports/configs/apps/mingw/vcpkg.json Outdated
Comment thread 3rdParty/vcpkg_ports/configs/apps/android/vcpkg.json Outdated
Comment thread 3rdParty/vcpkg_ports/configs/client/vcpkg.json Outdated
Comment thread 3rdParty/vcpkg_ports/configs/libs/windows/vcpkg.json Outdated
Comment thread 3rdParty/vcpkg_ports/configs/libs/vcpkg.json Outdated
Comment thread configure.ac
Comment thread configure.ac
Copilot AI review requested due to automatic review settings July 3, 2026 10:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.

Comment thread mac_build/buildfmt.sh Outdated
Comment on lines +54 to +55
lprefix="/tmp/installed-fmt"
libPath="./lib"
Comment thread mac_build/buildfmt.sh
Comment on lines +203 to +207
make 1>$stdout_target
if [ $? -ne 0 ]; then
rm -f ./lib/fmt_x86_64.a
return 1
fi
Comment thread mac_build/buildfmt.sh Outdated
Comment on lines +21 to +26
# Script to build Macintosh 64-bit Intel library of fmt for
# use in building BOINC.
#
#
## This script requires OS 10.8 or later
#
Comment thread configure.ac
Comment on lines +1237 to +1241
])
])
LIBS="$save_LIBS"
AC_LANG_POP([C++])
])
Copilot AI review requested due to automatic review settings July 3, 2026 10:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.

Comment thread mac_build/buildfmt.sh
Comment on lines +198 to +218
mv -f ./libfmt.a ./libfmt_x86_64.a

# Build for arm64 architecture
make clean 1>$stdout_target

make 1>$stdout_target
if [ $? -ne 0 ]; then
rm -f ./lib/fmt_x86_64.a
return 1
fi

mv -f ./libfmt.a ./libfmt_arm64.a

# combine x86_64 and arm libraries
lipo -create ./libfmt_x86_64.a ./libfmt_arm64.a -output "./libfmt.a"
if [ $? -ne 0 ]; then
rm -f ./libfmt_x86_64.a ./libfmt_arm64.a
return 1
fi

rm -f ./libfmt_x86_64.a ./libfmt_arm64.a
Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
Copilot AI review requested due to automatic review settings July 15, 2026 10:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@CharlieFenton

Copy link
Copy Markdown
Contributor

@AenBleidd I have fixed a few issues in the Mac build scripts and updated the Mac build instructions. The local build seems to work correctly on my Mac. If it works correctly for the CI build, then I think it is ready from my point of view.

@AenBleidd

Copy link
Copy Markdown
Member Author

@CharlieFenton, thank you for your fixes.
I will wait for a new release of fmtlib that contains fixes for x86 builds, and then we will be reado for the merge.

@CharlieFenton

Copy link
Copy Markdown
Contributor

@AenBleidd : 2 questions.

[1] Do you expect to use libfmt mainly in the Manager? If so, I can update the Xcode project to link it to the Manager and add the headers to the header search path. Should i do that?

[2] The Mac Manager uses a precompiled prefix header clientgui/mac/MacGUI.pch which includes all the wxWidgets headers, config.h and stdlib.h plus a few other items. If we expect to use libfmt widely (like we now use stdlib) I could add the #include fmt/format.h to this file. But that only makes sense if there is a corresponding way to do it for Windows and Linux builds. If those require adding the #include fmt/format.h to the individual .cpp files, then nothing is to be gained from putting it in the precompiled header for the Mac.
Should I add the #include fmt/format.h to clientgui/mac/MacGUI.pch?

@AenBleidd

Copy link
Copy Markdown
Member Author

@CharlieFenton,

Do you expect to use libfmt mainly in the Manager?

I would like to use it everywhere since it's more comfortable and more powerfull with the better and simpler syntax.
But I definitely don't want to start refactoring just to switch to this library.
We were talking with David recently about this, and his idea was to start using this library in the docker_wrapper first (since this is the component we are extensively working on during the last sveral months).
So I would not add fmtlib globally and instead do that when time comes.
Of course, if you want to do that in advance - feel free to do that.
However, I believe, doint this now will make the whole building process a little bit longer because it will be trying to link the library that is not used in aone or another prohect (and eventually will not do that since there is no any symbols imported from that library) .

Should I add the #include fmt/format.h to clientgui/mac/MacGUI.pch?

The answer is basically the same: I would not do that unless we start using it in more that one file.
For Windows we do use precompiled headers (they are not unified at the moment, but this is something I fix later, since currently it works and is not a big time loss during the compilation phase).
For Linux we do not using precompiled headers at all, but this is something I plan to fix.

So just to summarize: I would not include it into the list of precompiled headers and would not include this library by default until we start using it actively.

@davidpanderson

Copy link
Copy Markdown
Contributor

In general, .h files should be included only in files that directly use them

@AenBleidd

Copy link
Copy Markdown
Member Author

@davidpanderson, yes, but if any external header file is heavily used across several files - having it precompiled will significantly lower compilation time.
This is expecially applicable to those libraries that use heavy templates (e.g. nlohmann-json, fmtlib, etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants