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

FreeBSD: 0.15.0: tinyxml2:error 'utils/base64.h' file not found #1353

Closed
nunotexbsd opened this issue Dec 27, 2024 · 15 comments
Closed

FreeBSD: 0.15.0: tinyxml2:error 'utils/base64.h' file not found #1353

nunotexbsd opened this issue Dec 27, 2024 · 15 comments

Comments

@nunotexbsd
Copy link

FreeBSD 15
Clang 19.1.5
tinyxml2 10.0.0

Some C++17 imcompatibilities and utils/base64.h file not found as it is located in include/base64.h.
What's best procedure to fix it?

Thanks

checking for libtorrent >= 0.15.0... yes
checking for XMLRPC-C... ignored
checking for tinyxml2... yes
--- rpc/xmlrpc_tinyxml2.o ---
In file included from rpc/xmlrpc_tinyxml2.cc:19:
./rpc/tinyxml2/tinyxml2.h:116:14: warning: nested namespace definition is a C++17 extension; define each namespace separately [-Wc++17-extensions]
  116 | namespace rpc::tinyxml2 // rpc is a rtorrent-specific namespace
      |              ^~~~~~~~~~
      |               { namespace tinyxml2
--- input/manager.o ---
input/manager.cc:67:54: warning: 'mem_fun<bool, input::Bindings, int>' is deprecated [-Wdeprecated-declarations]
   67 |     std::find_if(rbegin(), rend(), std::bind2nd(std::mem_fun(&Bindings::pressed), key));
      |                                                      ^
/usr/include/c++/v1/__functional/mem_fun_ref.h:49:1: note: 'mem_fun<bool, input::Bindings, int>' has been explicitly marked deprecated here
--- rpc/xmlrpc_tinyxml2.o ---
rpc/xmlrpc_tinyxml2.cc:20:10: fatal error: 'utils/base64.h' file not found
   20 | #include "utils/base64.h"
      |          ^~~~~~~~~~~~~~~~

Full log:
rtorrent-0.15.0.log

@nunotexbsd
Copy link
Author

Patching:

--- src/rpc/xmlrpc_tinyxml2.cc.orig     2024-12-27 10:43:05 UTC
+++ src/rpc/xmlrpc_tinyxml2.cc
@@ -17,7 +17,7 @@

 #include "parse_commands.h"
 #include "rpc/tinyxml2/tinyxml2.h"
-#include "utils/base64.h"
+#include "base64.h"
 #include "xmlrpc.h"
--- rpc/xmlrpc_tinyxml2.o ---
rpc/xmlrpc_tinyxml2.cc:129:35: error: no member named 'decode_base64' in namespace 'utils'
  129 |     return torrent::Object(utils::decode_base64(utils::remove_newlines(child_element->ToText()->Value())));
      |                            ~~~~~~~^
rpc/xmlrpc_tinyxml2.cc:129:56: error: no member named 'remove_newlines' in namespace 'utils'
  129 |     return torrent::Object(utils::decode_base64(utils::remove_newlines(child_element->ToText()->Value())));
      |                                                 ~~~~~~~^
--- input/manager.o ---
3 warnings generated.
--- display/window.o ---
depbase=`echo display/window.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; c++ -std=c++14 -DHAVE_CONFIG_H -I. -I..   -I. -I.. -isystem /usr/local/include  -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -DNDEBUG -Wall -pthread  -I/usr/local/include -I/usr/local/include -MT display/window.o -MD -MP -MF $depbase.Tpo -c -o display/window.o display/window.cc && mv -f $depbase.Tpo $depbase.Po
--- rpc/xmlrpc_tinyxml2.o ---
1 warning and 2 errors generated.
*** [rpc/xmlrpc_tinyxml2.o] Error code 1

Full log:
rtorrent-0.15.0.log

@kannibalox
Copy link
Contributor

It looks like base64.h wasn't included in the release tarball for some reason, I'm not sure which base64.h you've managed to get included there, but it's almost certainly not the same one as the repo, which is why compilation is still failing.

Some C++17 imcompatibilities

The warnings can be ignored if compilation still succeeds, C++14 is the current supported language version.

@nunotexbsd
Copy link
Author

Hello,

As I being told for a FreeBSD dev, I did wrong using our include/base64.h.
How can I get upstream base64.h so I can test port?

@kannibalox
Copy link
Contributor

If you just want to build and test locally, you can grab it directly from the repo: https://raw.githubusercontent.com/rakshasa/rtorrent/refs/heads/master/src/utils/base64.h and put it into src/utils/, since it doesn't require any preprocessing.

I'll have to wait for @rakshasa to find out exactly why the release process didn't pull it in, it looks like make dist pulls it in, but I don't know the exact commands being used.

bapt added a commit to bapt/rtorrent that referenced this issue Dec 27, 2024
@bapt
Copy link

bapt commented Dec 27, 2024

you need to have base64.h listed in Makefile.am to make dist will take it into the distfiles.

@nunotexbsd
Copy link
Author

I confirm that it builds with missing file fetched to src/utils.

Not sure if it is supposed to be linked with libtinyxml2.so or not like it does with libxmlrpc.so when building with xmlrpc-c.

=>> Checking shared library dependencies
 0x0000000000000001 NEEDED               Shared library: [libc++.so.1]
 0x0000000000000001 NEEDED               Shared library: [libc.so.7]
 0x0000000000000001 NEEDED               Shared library: [libcurl.so.4]
 0x0000000000000001 NEEDED               Shared library: [libcxxrt.so.1]
 0x0000000000000001 NEEDED               Shared library: [libexecinfo.so.1]
 0x0000000000000001 NEEDED               Shared library: [libgcc_s.so.1]
 0x0000000000000001 NEEDED               Shared library: [libm.so.5]
 0x0000000000000001 NEEDED               Shared library: [libncursesw.so.9]
 0x0000000000000001 NEEDED               Shared library: [libthr.so.3]
 0x0000000000000001 NEEDED               Shared library: [libtinfow.so.9]
 0x0000000000000001 NEEDED               Shared library: [libtorrent.so.23]

Including full log just in case:
rtorrent-0.15.0.log

I will now proceed with some run testing

@bapt
Copy link

bapt commented Dec 27, 2024

@nunotexbsd no it is not, tinyxml2 is bundled into and nothing in the build system exist to use an external already packaged version of it.

@nunotexbsd
Copy link
Author

nunotexbsd commented Dec 27, 2024

@bapt yes, I can confirm that too. Removed lib dep libtinyxml2.so:textproc/tinyxml2 as we using bundled one.
Lets see if an external option will comes up in future.

Run test is OK

@AngryPenguinPL
Copy link

I added patch #1354 to build but it still fail with

make[2]: Leaving directory '/builddir/build/BUILD/rtorrent-0.15.0-build/rtorrent-0.15.0/src'
DEBUG util.py:461:  rpc/xmlrpc_tinyxml2.cc:20:10: fatal error: utils/base64.h: No such file or directory
DEBUG util.py:461:     20 | #include "utils/base64.h"
DEBUG util.py:461:        |          ^~~~~~~~~~~~~~~~
DEBUG util.py:461:  compilation terminated.

Any idea?

OS: OpenMandriva Cooker
LLVM/Clang 19.1.6

@nunotexbsd
Copy link
Author

@AngryPenguinPL That patch fixes the distribution tarball by adding missing file to it.

@freultwah
Copy link

Off-topic a bit, but how do you manage to achieve:

checking for XMLRPC-C... ignored

I can only get it to yes or no, and then error out complaining that I can't enable both xmlrpc-c and tinyxml2. Whatever I do, however I ./configure.

@nunotexbsd
Copy link
Author

nunotexbsd commented Dec 28, 2024

@freultwah

You can't enable both.
You can have one of the 2 XLMs or none.

So when you add:
--with-xmlrpc-tinyxml2
it will ignore:
xmlrpc-c
and vice-versa.
But cannot use the 2:

--with-xmlrpc-tinyxml2
--with-xmlrpc-c

at same time

@freultwah
Copy link

Here's the rub: I never enable both. I can even disable both explicitly, and configure will still error out complaining about me enabling both. I've tried --without-xmlrpc-c and --with-xmlrpc-c=no, and both at the same time, but no.

@kannibalox
Copy link
Contributor

kannibalox commented Dec 28, 2024

The way configure works --without-xmlrpc-c/--with-xmlrpc-c=no will simultaneously enable the xmlrpc-c check but set the test value to no (instead of leaving it empty). It could probably be fixed with more complex logic, but in the meantime simply leaving off any kind of xmlrpc-c flag e.g. ./configure --with-xmlrpc-tinyxml2 should only enable tinyxml2 and allow you to proceed.

@rakshasa
Copy link
Owner

rakshasa commented Jan 1, 2025

Fixed missing header.

@rakshasa rakshasa closed this as completed Jan 1, 2025
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 a pull request may close this issue.

6 participants