Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch from custom stringFormat to fmtlib #2769

Merged
merged 2 commits into from
Jan 7, 2025
Merged

switch from custom stringFormat to fmtlib #2769

merged 2 commits into from
Jan 7, 2025

Conversation

neheb
Copy link
Collaborator

@neheb neheb commented Sep 17, 2023

The latter helps to avoid wrong format errors and is simpler to use. Will be replaced by std::format once C++20 becomes mandatory.

@ghost
Copy link

ghost commented Sep 17, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@codecov
Copy link

codecov bot commented Sep 17, 2023

Codecov Report

Attention: Patch coverage is 36.36364% with 35 lines in your changes are missing coverage. Please review.

Project coverage is 64.57%. Comparing base (77915ad) to head (a0aa4a7).
Report is 11 commits behind head on main.

❗ Current head a0aa4a7 differs from pull request most recent head 51fd65b. Consider uploading reports for the commit 51fd65b to get more accurate results

Files Patch % Lines
src/rafimage.cpp 0.00% 26 Missing ⚠️
src/basicio.cpp 14.28% 6 Missing ⚠️
src/bmffimage.cpp 71.42% 2 Missing ⚠️
src/image.cpp 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2769      +/-   ##
==========================================
- Coverage   64.62%   64.57%   -0.05%     
==========================================
  Files         104      104              
  Lines       22239    22155      -84     
  Branches    10911    10849      -62     
==========================================
- Hits        14371    14306      -65     
+ Misses       5626     5610      -16     
+ Partials     2242     2239       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kmilos
Copy link
Collaborator

kmilos commented Oct 18, 2023

How about we just wait for C++20 as min requirement and use std::format straight away? Or code it in a way to use std::format if using C++20 so there is one less dependency?

CMakeLists.txt Outdated Show resolved Hide resolved
src/CMakeLists.txt Outdated Show resolved Hide resolved
meson.build Outdated Show resolved Hide resolved
src/basicio.cpp Outdated Show resolved Hide resolved
@neheb neheb force-pushed the fmt branch 7 times, most recently from 1ac41a6 to db8dbda Compare October 20, 2023 18:46
CMakeLists.txt Outdated Show resolved Hide resolved
src/CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
src/image_int.hpp Show resolved Hide resolved
src/CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
src/image_int.hpp Outdated Show resolved Hide resolved
src/rafimage.cpp Outdated Show resolved Hide resolved
@neheb neheb force-pushed the fmt branch 9 times, most recently from 43e31a2 to 51b29fe Compare November 16, 2023 21:38
@neheb
Copy link
Collaborator Author

neheb commented Jul 9, 2024

Rebased.

@neheb
Copy link
Collaborator Author

neheb commented Dec 20, 2024

Rebased.

@kmilos
Copy link
Collaborator

kmilos commented Dec 20, 2024

@neheb I think I managed to install GCC 13 for the Cygwin job so this can finally proceed.

@neheb
Copy link
Collaborator Author

neheb commented Dec 20, 2024

Hmm? Not sure what you mean by GCC 13 on Cygwin needed.

@kmilos
Copy link
Collaborator

kmilos commented Dec 20, 2024

Hmm? Not sure what you mean by GCC 13 on Cygwin needed.

It's been a while, heh? 😉 There is no fmt package on Cygwin, and only GCC (libstdc++) 13 onwards has this feature.

@kevinbackhouse
Copy link
Collaborator

I think the CIFuzz error might fix itself after this is merged. My guess is that OSS-Fuzz is running ci/install_dependencies.sh from the main branch, so the fmt package isn't installed. If something goes wrong, we can do a follow-up PR to fix it.

@neheb neheb force-pushed the fmt branch 2 times, most recently from 7fb888b to 72ed49a Compare December 21, 2024 02:37
@neheb
Copy link
Collaborator Author

neheb commented Dec 21, 2024

hmmm CMAKE_CXX_STANDARD is not being overwritten.

@kmilos
Copy link
Collaborator

kmilos commented Jan 6, 2025

hmmm CMAKE_CXX_STANDARD is not being overwritten

Looks like it gets reset back to 17 at least here and here:

set(CMAKE_CXX_STANDARD 17)

set(CMAKE_CXX_STANDARD 17)

Those should probably be wrapped w/ if(NOT CMAKE_CXX_STANDARD)...?

@neheb neheb force-pushed the fmt branch 2 times, most recently from 0f57ce6 to 89d78d9 Compare January 6, 2025 22:58
The latter helps to avoid wrong format errors and is simpler to use.
Will be replaced by std::format once C++20 becomes mandatory.

Signed-off-by: Rosen Penev <[email protected]>
@neheb
Copy link
Collaborator Author

neheb commented Jan 6, 2025

good to go now.

Signed-off-by: Rosen Penev <[email protected]>
@kmilos
Copy link
Collaborator

kmilos commented Jan 7, 2025

Ah, one last thing, but could be added in a separate PR: probably now also need to (conditionally) include fmt dependency in the CMake config file...

@neheb neheb merged commit b8fd4d1 into Exiv2:main Jan 7, 2025
58 of 59 checks passed
@neheb neheb deleted the fmt branch January 7, 2025 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Cleanup / Simplify code -> more readable / robust
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants