[Bug 2366921] Review Request: glaze - Extremely fast, in memory, JSON and interface library for modern C++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=2366921



--- Comment #7 from Jannik Müller <nighti@xxxxxxxxxx> ---
(In reply to Ben Beasley from comment #5)
> (In reply to Jannik Müller from comment #3)
> > a) Unfortunately, I can't use a system library for that. I checked and glaze
> > has significantly modified the header files. For dragonbox, it looks very
> > similar, but it would require reverting the changes. For fast_float, they
> > integrated and wrote around the library deeply which would require a
> > significant amount of work to use the system library.
> > Therefore, I would prefer bundling it as an exception for this case.
> 
> For xxhashct, it is a simple as:
> 
>   # Unbundled (header-only)
>   BuildRequires:  xxhashct-static
> 
> (The -static, instead of or in addition to -devel, is required by
> https://docs.fedoraproject.org/en-US/packaging-guidelines/
> #_packaging_header_only_libraries.)
> 
> And then, in %prep:
> 
>   # Unbundle xxhash64ct
>   cat > include/glaze/api/xxh64.hpp <<'EOF'
>   #include <xxh64.hpp>
>   EOF
> 
> And in %package devel:
> 
>   # Unbundled (header-only)
>   Requires:       xxhashct-static
> 
> If you were to unbundle fast_float and/or dragonbox, it would be a little
> messier. It is still possible, because all upstream has done is wrap the C++
> symbols in a "glz" namespace and add a "GLZ_" prefix to the preprocessor
> macros. The namespace can be handled by re-including the header with a
> namespace alias, like
> 
>   cat > include/glaze/util/fast_float.hpp <<'EOF'
>   #include <fast_float/fast_float.h>
>   namespace glz::fast_float = fast_float;
>   EOF
> 
> However, the preprocessor macros are a little trickier. Something like this
> is not beautiful, but it works:
> 
>   # Unbundle fast_float
>   macros="$(
>     awk '/#define GLZ_FASTFLOAT/ { print $2 }' \
>         include/glaze/util/fast_float.hpp |
>       grep -vE 'FASTFLOAT_DETAIL|_H$' |
>       sort -u |
>       tr '\n' ' '
>   )"
>   cat > include/glaze/util/fast_float.hpp <<'EOF'
>   #include <fast_float/fast_float.h>
>   namespace glz::fast_float = fast_float;
>   // GLZ_-prefixed versions of "public" FASTFLOAT_ macros:
>   EOF
>   while read -r macro
>   do
>     cat >> include/glaze/util/fast_float.hpp <<EOF
>   #if defined FASTFLOAT_${macro}
>   #define GLZ_FASTFLOAT_${macro} FASTFLOAT_${macro}
>   #endif
>   EOF
>   done <<<"${macros}"
> 
> (You could also manually handle only the preprocessor macros that are
> actually needed, but that would be more brittle.)
> 
> I think a similar approach would be possible for dragonbox.
> 
> If you are *not* going to unbundle these (and the guidelines say that you
> “SHOULD make every effort” to do so), then you MUST follow the stipulations
> for bundling in
> https://docs.fedoraproject.org/en-US/packaging-guidelines/#bundling:
> 
> - Indicate what you bundle using virtual Provides
> - Contact upstream publicly about a path to supporting system libraries

I really thank you both for your input. I appreciate that. I will try it, I
wasn't sure whether it was possible, because in the commit history, they seemed
to have added stuff. include/glaze/util/glaze_fast_float.hpp specifically is
one such file, that isn't in fast_float itself. I will try to apply the
commands for each package and hope it won't break anything.


-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are always notified about changes to this product and component
https://bugzilla.redhat.com/show_bug.cgi?id=2366921

Report this comment as SPAM: https://bugzilla.redhat.com/enter_bug.cgi?product=Bugzilla&format=report-spam&short_desc=Report%20of%20Bug%202366921%23c7

-- 
_______________________________________________
package-review mailing list -- package-review@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to package-review-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/package-review@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite Conditions]     [KDE Users]

  Powered by Linux