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

Build failure with log4cxx 1.0.0 #464

Closed
thesamesam opened this issue Feb 4, 2023 · 7 comments
Closed

Build failure with log4cxx 1.0.0 #464

thesamesam opened this issue Feb 4, 2023 · 7 comments

Comments

@thesamesam
Copy link

thesamesam commented Feb 4, 2023

I recently updated our log4cxx package in Gentoo to 1.0.0 and hit the following build failure:

FAILED: plugin/cpp/CMakeFiles/transport-plugin.dir/Logging.cpp.o
/var/tmp/portage/net-im/spectrum2-2.1.3-r1/temp/clang-wrappers/x86_64-pc-linux-gnu-g++ -DBOOST_FILESYSTEM_VERSION=3 -DSPECTRUM_VERSION=\"2.1.x-git-89867b7\" -DSUPPORT_LEGACY_CAPS -DWITH_LIBEVENT -DWITH_LOG4CXX -DWITH_PROTOBUF -DWITH_SQLITE -Dtransport_plugin_EXPORTS -I/var/tmp/portage/net-im/spectrum2-2.1.3-r1/work/spectrum2-2.1.3/include  -O2 -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches -Wreturn-type  -ggdb3 -std=c++11 -fPIC -fdiagnostics-color=always   -fPIC -MD -MT plugin/cpp/CMakeFiles/transport-plugin.dir/Logging.cpp.o -MF plugin/cpp/CMakeFiles/transport-plugin.dir/Logging.cpp.o.d -o plugin/cpp/CMakeFiles/transport-plugin.dir/Logging.cpp.o -c /var/tmp/portage/net-im/spectrum2-2.1.3-r1/work/spectrum2-2.1.3/plugin/cpp/Logging.cpp
In file included from /usr/include/boost/smart_ptr/detail/sp_thread_sleep.hpp:22,
                 from /usr/include/boost/smart_ptr/detail/yield_k.hpp:23,
                 from /usr/include/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp:14,
                 from /usr/include/boost/smart_ptr/detail/spinlock.hpp:42,
                 from /usr/include/boost/smart_ptr/detail/spinlock_pool.hpp:25,
                 from /usr/include/boost/smart_ptr/shared_ptr.hpp:29,
                 from /usr/include/boost/shared_ptr.hpp:17,
                 from /usr/include/boost/program_options/options_description.hpp:16,
                 from /usr/include/boost/program_options.hpp:15,
                 from /var/tmp/portage/net-im/spectrum2-2.1.3-r1/work/spectrum2-2.1.3/include/transport/Config.h:23,
                 from /var/tmp/portage/net-im/spectrum2-2.1.3-r1/work/spectrum2-2.1.3/plugin/cpp/Logging.cpp:22:
/usr/include/boost/bind.hpp:36:1: note: ‘#pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.’
   36 | BOOST_PRAGMA_MESSAGE(
      | ^~~~~~~~~~~~~~~~~~~~
/var/tmp/portage/net-im/spectrum2-2.1.3-r1/work/spectrum2-2.1.3/plugin/cpp/Logging.cpp: In function ‘void Transport::Logging::initLogging(Transport::Config*, std::string, bool)’:
/var/tmp/portage/net-im/spectrum2-2.1.3-r1/work/spectrum2-2.1.3/plugin/cpp/Logging.cpp:103:92: error: no matching function for call to ‘log4cxx::ConsoleAppender::ConsoleAppender(log4cxx::PatternLayout*)’
  103 |                 root->addAppender(new ConsoleAppender(new PatternLayout("%d %-5p %c: %m%n")));
      |                                                                                            ^
In file included from /var/tmp/portage/net-im/spectrum2-2.1.3-r1/work/spectrum2-2.1.3/include/transport/Logging.h:31,
                 from /var/tmp/portage/net-im/spectrum2-2.1.3-r1/work/spectrum2-2.1.3/plugin/cpp/Logging.cpp:21:
/usr/include/log4cxx/consoleappender.h:63:17: note: candidate: ‘log4cxx::ConsoleAppender::ConsoleAppender(const log4cxx::LayoutPtr&, const log4cxx::LogString&)’
   63 |                 ConsoleAppender(const LayoutPtr& layout, const LogString& target);
      |                 ^~~~~~~~~~~~~~~
/usr/include/log4cxx/consoleappender.h:63:17: note:   candidate expects 2 arguments, 1 provided
/usr/include/log4cxx/consoleappender.h:55:17: note: candidate: ‘log4cxx::ConsoleAppender::ConsoleAppender(const log4cxx::LayoutPtr&)’
   55 |                 ConsoleAppender(const LayoutPtr& layout);
      |                 ^~~~~~~~~~~~~~~
/usr/include/log4cxx/consoleappender.h:55:50: note:   no known conversion for argument 1 from ‘log4cxx::PatternLayout*’ to ‘const log4cxx::LayoutPtr&’ {aka ‘const std::shared_ptr<log4cxx::Layout>&’}
   55 |                 ConsoleAppender(const LayoutPtr& layout);
      |                                 ~~~~~~~~~~~~~~~~~^~~~~~
/usr/include/log4cxx/consoleappender.h:48:17: note: candidate: ‘log4cxx::ConsoleAppender::ConsoleAppender()’
   48 |                 ConsoleAppender();
      |                 ^~~~~~~~~~~~~~~
/usr/include/log4cxx/consoleappender.h:48:17: note:   candidate expects 0 arguments, 1 provided
/var/tmp/portage/net-im/spectrum2-2.1.3-r1/work/spectrum2-2.1.3/plugin/cpp/Logging.cpp:126:24: error: cannot convert ‘log4cxx::helpers::FileInputStream*’ to ‘log4cxx::helpers::InputStreamPtr’ {aka ‘std::shared_ptr<log4cxx::helpers::InputStream>’}
  126 |                 p.load(istream);
      |                        ^~~~~~~
      |                        |
      |                        log4cxx::helpers::FileInputStream*

Full build log: build.log. Let me know if I can grab more info, thanks!

gentoo-bot pushed a commit to gentoo/gentoo that referenced this issue Feb 4, 2023
Fails to build w/ 1.0.0.

Bug: SpectrumIM/spectrum2#464
Signed-off-by: Sam James <sam@gentoo.org>
@vitalyster
Copy link
Collaborator

Which latest version worked before? I'm not sure I tested anything after 0.11

@ConiKost
Copy link
Contributor

ConiKost commented Feb 4, 2023

Version before, which was working, was 0.11, see: https://packages.gentoo.org/packages/dev-libs/log4cxx

@vitalyster
Copy link
Collaborator

Well, log4cxx break backward compatibility but we need to be compatible with old versions. You can use Debian patches, it seems they fix both log4cxx 0.12+ and swiften 5.0+ issues - https://salsa.debian.org/xmpp-team/spectrum2/-/tree/master/debian/patches

@ConiKost
Copy link
Contributor

Well, log4cxx break backward compatibility but we need to be compatible with old versions.

I am not sure, why you need? Can't be this added for new releases?

@vitalyster
Copy link
Collaborator

Because we need to run Spectrum on Debian stable and other non-rolling distros

@ConiKost
Copy link
Contributor

ConiKost commented Mar 1, 2023

I am not sure, if you are aware, that Debian 12 will be released summer 2023 and includes log4cxx 1.0.0?
I think, it would be a could idea, if somehow both versions could be supported. Maybe some compile flag?

@vitalyster
Copy link
Collaborator

Sure, we had in the past a lot of #ifdefs to support both Swiften 2 and 4. Right now we need the same for Swiften 4/5, log4cxx 0.11/1.0.0. When Debian stable with log4cxx 1.0 will be released we actually can stop support older versions, but not right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants