Skip to content

Fixing linking fmt & improved visitor patterns#28

Merged
KaruroChori merged 12 commits intomasterfrom
fix-linking
Jul 7, 2025
Merged

Fixing linking fmt & improved visitor patterns#28
KaruroChori merged 12 commits intomasterfrom
fix-linking

Conversation

@KaruroChori
Copy link
Copy Markdown
Contributor

@KaruroChori KaruroChori commented Jul 4, 2025

Closes #29 and #30

This last commit has regressions in linking which I am not able to fully isolate.
Running in CI might help to figure out what is going on. it did, issue found out, resolution pending.

That being said I will make use of this PR to fix/improve the visitor interface, so that the new print2 serialization is not needing memory allocations for the lambda capture contexts.

…ing TreeRaw iterator.

Linking regression emerged, to be investigated and fixed.
@KaruroChori
Copy link
Copy Markdown
Contributor Author

It looks like something broke on my system for whatever strange and obscure reason? I get errors like this when replicating the same build of CI.

g++-14  -o utils/vs-xml.decode utils/vs-xml.decode.p/decode.cpp.o -Wl,--as-needed -Wl,--no-undefined '-Wl,-rpath,$ORIGIN/..' -Wl,-rpath-link,/home/migration/Documents/projects/vs.xml/build3/ libvs-xml.so
/usr/bin/ld: utils/vs-xml.decode.p/decode.cpp.o: undefined reference to symbol '_ZN3fmt3v107vformatB5cxx11ENS0_17basic_string_viewIcEENS0_17basic_format_argsINS0_20basic_format_contextINS0_8appenderEcEEEE'
/usr/bin/ld: /lib/x86_64-linux-gnu/libfmt.so.10: error adding symbols: DSO missing from command line

…fmt, since that library is not linked in the final application, some symbols being generated by libvs-xml inline in the headers are not part of the final optimized blob, and code will complain it cannot be found.
@KaruroChori
Copy link
Copy Markdown
Contributor Author

KaruroChori commented Jul 4, 2025

So, the issue was found. In impl.hpp one of the assertions had a std::format converted to VS_XML_NS::format, and I am compiling using fmt in place of the std version.
Which means, the specific template being used will only ever be reserved once at compiletime.
Solutions to this issue are:

  • Being explicit on which template versions of format should be generated.
  • Link the library to the final executables as well.

This is a huge pain to handle, and makes the build process much more fragile than what I would like. But some solution will be found at some point.

…o keep the basic interface more embedded-friendly. Also it was recursive which is not good.
… will also allow a template version to be exposed (likely speedup to implement serialiation and no memory allocation due to lambda context)
@KaruroChori KaruroChori changed the title Fixing linking Fixing linking fmt & improved visitor patterns Jul 4, 2025
@KaruroChori KaruroChori mentioned this pull request Jul 4, 2025
5 tasks
Karuro Chari and others added 8 commits July 5, 2025 18:33
…the new one. New print functions to match added capabilities.
…sitor patterns.

Added `[[nodiscard]]` around to fix interfaces.
…ch inherited from an early version.

Dependencies have now been better isolated in compile units to avoid leaking to downstream code.
The interface is basically the same as the earlier commit, but it fixes all issues with linking fmt to downstream.
@KaruroChori KaruroChori merged commit a4ae950 into master Jul 7, 2025
4 checks passed
@KaruroChori KaruroChori deleted the fix-linking branch July 7, 2025 11:47
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.

[TRACKER] v0.2.13

1 participant