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

[BUG] fmt error during compile of 1.15.0 #101

Open
3 tasks done
FixedWing99 opened this issue Mar 12, 2025 · 6 comments
Open
3 tasks done

[BUG] fmt error during compile of 1.15.0 #101

FixedWing99 opened this issue Mar 12, 2025 · 6 comments
Labels
bug Something isn't working

Comments

@FixedWing99
Copy link

Code of conduct

Self-training on how to write a bug report

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

-- Found fmt 11.1.4

`[249/311] Building CXX object libsession-util/src/CMakeFiles/config.dir/config/base.cpp.o
FAILED: libsession-util/src/CMakeFiles/config.dir/config/base.cpp.o
/usr/bin/ccache /usr/bin/c++ -DFMT_SHARED -DHAVE_TI_MODE -DNAPI_VERSION=8 -DOXEN_LOGGING_SOURCE_ROOTS="/tmp/makepkg/session-desktop/src/session-desktop-1.15.0/node_modules/libsession_util_nodejs/libsession-util" -DOXEN_LOGGING_SOURCE_ROOTS_LEN=1 -DSODIUM_STATIC -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DSPDLOG_SHARED_LIB -I/tmp/makepkg/session-desktop/src/session-desktop-1.15.0/node_modules/libsession_util_nodejs/libsession-util/src/../include -I/tmp/makepkg/session-desktop/src/session-desktop-1.15.0/node_modules/libsession_util_nodejs/libsession-util/external/oxen-libquic/external/oxen-encoding -I/tmp/makepkg/session-desktop/src/session-desktop-1.15.0/node_modules/libsession_util_nodejs/libsession-util/external/oxen-libquic/external/oxen-logging/include -I/tmp/makepkg/session-desktop/src/session-desktop-1.15.0/node_modules/libsession_util_nodejs/libsession-util/proto -I/tmp/makepkg/session-desktop/src/session-desktop-1.15.0/node_modules/libsession_util_nodejs/libsession-util/external/protobuf/src -I/tmp/makepkg/session-desktop/src/session-desktop-1.15.0/node_modules/libsession_util_nodejs/libsession-util/external/libsodium-internal/src/libsodium/include -I/tmp/makepkg/session-desktop/src/session-desktop-1.15.0/node_modules/libsession_util_nodejs/libsession-util/external/zstd/lib -I/tmp/makepkg/session-desktop/src/session-desktop-1.15.0/node_modules/libsession_util_nodejs/libsession-util/external/zstd/lib/common -DBUILDING_NODE_EXTENSION -O3 -DNDEBUG -std=c++20 -flto=auto -fno-fat-lto-objects -fPIC -Wno-error=unused-parameter -MD -MT libsession-util/src/CMakeFiles/config.dir/config/base.cpp.o -MF libsession-util/src/CMakeFiles/config.dir/config/base.cpp.o.d -o libsession-util/src/CMakeFiles/config.dir/config/base.cpp.o -c /tmp/makepkg/session-desktop/src/session-desktop-1.15.0/node_modules/libsession_util_nodejs/libsession-util/src/config/base.cpp
/tmp/makepkg/session-desktop/src/session-desktop-1.15.0/node_modules/libsession_util_nodejs/libsession-util/src/config/base.cpp: In member function ‘std::vector<std::__cxx11::basic_string > session::config::ConfigBase::_merge(const std::vector<std::pair<std::__cxx11::basic_string, std::basic_string_view > >&)’:
/tmp/makepkg/session-desktop/src/session-desktop-1.15.0/node_modules/libsession_util_nodejs/libsession-util/src/config/base.cpp:134:52: error: ‘join’ is not a member of ‘fmt’
134 | log::trace(cat, "Current old_hashes: {}", fmt::join(_old_hashes, ", "));
| ^~~~
[250/311] Building CXX object libsession-util/external/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/any.cc.o
[251/311] Building CXX object CMakeFiles/libsession_util_nodejs.dir/src/addon.cpp.o
[252/311] Building CXX object libsession-util/external/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/any.pb.cc.o
[253/311] Building CXX object CMakeFiles/libsession_util_nodejs.dir/src/contacts_config.cpp.o
[254/311] Building CXX object CMakeFiles/libsession_util_nodejs.dir/src/convo_info_volatile_config.cpp.o
[255/311] Building CXX object CMakeFiles/libsession_util_nodejs.dir/src/utilities.cpp.o
[256/311] Building CXX object CMakeFiles/libsession_util_nodejs.dir/src/groups/meta_group_wrapper.cpp.o
[257/311] Building CXX object CMakeFiles/libsession_util_nodejs.dir/src/user_config.cpp.o

==> ERROR: A failure occurred in prepare().
Aborting...`

Expected Behavior

My source is aur.archlinux.org.

This has failed on two different machines with the same error.

Steps To Reproduce

No response

Desktop Version

1.15.0

Anything else?

No response

@FixedWing99 FixedWing99 added the bug Something isn't working label Mar 12, 2025
@FixedWing99
Copy link
Author

What, no comment?

Ok, so my uneducated guess is that this is a conflict between the configuration for the bundled version of fmt and the version 11.1.4 which is actually on my systems, and which is being found and used during compile.

134 | log::trace(cat, "Current old_hashes: {}", fmt::join(_old_hashes, ", "));
| ^~~~

Join is a valid command in fmt version 11 so we shouldn't be seeing this error.

This is an error which would only show for those with a newer version of fmt on their system.

If I'm right, the better solution, I think, is to make fmt a dependency, rather than bundling it.

Stephen

@mpretty-cyro
Copy link
Collaborator

What, no comment?

Ok, so my uneducated guess is that this is a conflict between the configuration for the bundled version of fmt and the version 11.1.4 which is actually on my systems, and which is being found and used during compile.

134 | log::trace(cat, "Current old_hashes: {}", fmt::join(_old_hashes, ", ")); | ^~~~

Hey @FixedWing99, thanks for reporting this - I've actually just run into a similar issue when working on doing some refactoring in libSession and updating Session Desktop's wrapper code to use the updated types (session-foundation/libsession-util-nodejs#21)

Join is a valid command in fmt version 11 so we shouldn't be seeing this error.

This is an error which would only show for those with a newer version of fmt on their system.

If I'm right, the better solution, I think, is to make fmt a dependency, rather than bundling it.

At the moment libSession is setup to check if the system already has a dependency installed and, if so, use that rather than the bundled one: https://github.com/oxen-io/oxen-logging/blob/dev/cmake/load_fmt_spdlog.cmake so it should be working fine on your device since it did actually find version 11.1.4 on your system but clearly it's not, so I wonder if it's incorrectly using the bundled version somewhere

This will need to be resolved as part of finishing off the draft PR I linked above, so once that is merged and Session Desktop is updated to use the new version it should fix your issue

@FixedWing99
Copy link
Author

Yes, the problem will go away once Session is upgraded to the same version I currently have. But this is only a temporary fix. As soon as Fmt is upgraded to a new version it will be out-of-sync again and the issue will recur. I'm noticing it because I'm on Arch Linux, which has a rolling release. I'm the canary. The risk is that this starts happening to everyone if the versions are not resynced before the major packages start upgrading their versions.

Stephen

@woutershep
Copy link

I've just hit the same. I suspect as a result of fmtlib/fmt@50565f9 which moved the join function to ranges.h in fmt 11?

Various projects are solving it simply with the additional include. Example:
sandialabs/seacas#477

@mpretty-cyro
Copy link
Collaborator

I've just hit the same. I suspect as a result of fmtlib/fmt@50565f9 which moved the join function to ranges.h in fmt 11?

Various projects are solving it simply with the additional include. Example: sandialabs/seacas#477

Thanks for linking that @woutershep, as it turns out we've actually already updated spdlog and fmt in oxen-logging which resolves these errors - it's just that oxen-libquic hasn't been updated to use it yet (which then needs to be propagated to libSession-util, then libSession-util-NodeJS and finally into the Desktop project)

We are going through and updating this chain of dependencies at the moment so should hopefully have the build issues resolved soon

@mpretty-cyro
Copy link
Collaborator

Hey @woutershep and @FixedWing99, the PR #1391 should now include the updated version of libSession-util which resolves these build issues - when either of you get the chance can you take a look and see if you are still running into build issues?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants