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

Building dependencies fails #10

Closed
jklmnn opened this issue Feb 6, 2019 · 13 comments
Closed

Building dependencies fails #10

jklmnn opened this issue Feb 6, 2019 · 13 comments

Comments

@jklmnn
Copy link

jklmnn commented Feb 6, 2019

When building with dependencies mtxclient fails to build.

System:

  • Nheko version: 6ab12b2 and a671bd6
  • Installation method: local build
  • Operating System: Debian Stretch
  • Qt version: 5.7.1
  • C++ compiler: GCC 6.3
  • Desktop Environment: KDE Plasma 5.8.6

Actual behavior

Running the commands from the readme:

cmake -Hdeps -B.deps
cmake --build .deps

The second command fails with

/.../nheko/.deps/build/mtxclient/lib/crypto/client.cpp: In function ‘std::__cxx11::string mtx::crypto::base642bin(const string&)’:
/.../nheko/.deps/build/mtxclient/lib/crypto/client.cpp:611:42: error: ‘sodium_base64_VARIANT_ORIGINAL’ was not declared in this scope
                                          sodium_base64_VARIANT_ORIGINAL);
                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/.../nheko/.deps/build/mtxclient/lib/crypto/client.cpp:611:72: error: ‘sodium_base642bin’ was not declared in this scope
                                          sodium_base64_VARIANT_ORIGINAL);
                                                                        ^
/.../nheko/.deps/build/mtxclient/lib/crypto/client.cpp: In function ‘std::__cxx11::string mtx::crypto::bin2base64(const string&)’:
/.../nheko/.deps/build/mtxclient/lib/crypto/client.cpp:626:63: error: ‘sodium_base64_VARIANT_ORIGINAL’ was not declared in this scope
           create_buffer(sodium_base64_encoded_len(bin.size(), sodium_base64_VARIANT_ORIGINAL));
                                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/.../nheko/.deps/build/mtxclient/lib/crypto/client.cpp:626:93: error: ‘sodium_base64_encoded_len’ was not declared in this scope
           create_buffer(sodium_base64_encoded_len(bin.size(), sodium_base64_VARIANT_ORIGINAL));
                                                                                             ^
/.../nheko/.deps/build/mtxclient/lib/crypto/client.cpp:632:57: error: ‘sodium_bin2base64’ was not declared in this scope
                           sodium_base64_VARIANT_ORIGINAL);
                                                         ^
CMakeFiles/matrix_client.dir/build.make:110: recipe for target 'CMakeFiles/matrix_client.dir/lib/crypto/client.cpp.o' failed

Expected behavior

Nheko and all its dependencies compile.

Steps to reproduce

git clone https://github.com/Nheko-Reborn/nheko.git && cd nheko && cmake -Hdeps -B.deps && cmake --build .deps 

Logs

https://pastebin.com/ZxNHS1Uq

@jklmnn
Copy link
Author

jklmnn commented Feb 6, 2019

Debian Buster doesn't seem to be affected.

@redsky17
Copy link
Member

redsky17 commented Feb 6, 2019

Can you tell me what version of libsodium you have installed? And when you installed it, did you install libsodium or libsodium-dev?

@jklmnn
Copy link
Author

jklmnn commented Feb 7, 2019

I have installed:

  • libsodium-dev in version 1.0.11-2
  • libsodium18 in version 1.0.11-2

Installing libsodium23 and libsodium-dev in version 1.0.16-2~bpo9+1 fixed the error.
Although I would have expected cmake to catch this earlier with a dependency error instead of a build error.

@jklmnn
Copy link
Author

jklmnn commented Feb 7, 2019

Also I get an error that my boost is too old although I have run cmake -Hdeps -B.deps -DUSE_BUNDLED_BOOST=ON. Is there something I need to supply to cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=.deps/usr for it to find the bundled boost?
Sorry for scope creeping this issue, but I don't want to open a new one for each minor issue I encounter.

@redsky17
Copy link
Member

redsky17 commented Feb 7, 2019

For the libsodium issue, it sounds like there is a minimum version requirement then. I can definitely incorporate that in the cmake script once I figure out what version that is. It'll end up as an issue on Nheko-Reborn/mtxclient rather than nheko itself.

Regarding the boost issue, could you share your build log when you use -DUSE_BUNDLED_BOOST=ON? Typically, when I want to use the bundled boost, I leave that flag off altogether instead of specifying on. I'm not sure if the build script checks the value of the flag, just that the flag was provided in the first place.

@jklmnn
Copy link
Author

jklmnn commented Feb 7, 2019

I tried both, using the flag and leaving it, both yields the same result. The build dep log is here (call was git clone https://github.com/Nheko-Reborn/nheko.git && cd nheko && cmake -Hdeps -B.deps && cmake --build .deps).
When calling cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=.deps/usr afterwards I get

-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Found LMDB: /usr/include  
Build type set to 'Release'
-- Version: 0.6.2-6ab12b2
CMake Error at /usr/share/cmake-3.7/Modules/FindBoost.cmake:1831 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.62.0

  Boost include path: /usr/include

  Detected version of Boost is too old.  Requested version was 1.66 (or
  newer).
Call Stack (most recent call first):
  CMakeLists.txt:246 (find_package)


-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8") 
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.0j") 
-- Found OLM: /tmp/nheko/.deps/usr/include  
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29") 
-- Found cmark: /tmp/nheko/.deps/usr/include  
-- Configuring incomplete, errors occurred!
See also "/tmp/nheko/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/nheko/build/CMakeFiles/CMakeError.log".

CMakeError.log
CMakeOutput.log

@redsky17
Copy link
Member

redsky17 commented Feb 7, 2019

I think the key component here is from your pastebin log:

CMake Warning at /usr/share/cmake-3.7/Modules/FindBoost.cmake:761 (message):
  Imported targets not available for Boost version 106800

Boost 1.68 requires CMake 3.13 or newer. I think this is resulting in CMake somehow defaulting to an older version of Boost that it's compatible with, which doesn't work with nheko because it too old. Could you update your CMake and try again?

It looks like I will need to update this line in CMakeLists

cmake_minimum_required(VERSION 3.1)

@redsky17
Copy link
Member

redsky17 commented Feb 8, 2019

From reading https://github.com/jedisct1/libsodium/blob/31ccbdec96aae4ecc705b0f7925cf0d092c49088/ChangeLog

It looks like the minimum required version of libsodium is 1.0.14 (That appears to be the version that adds sodium_bin2base64 that is missing in your logs). I'll be sure to update the cmake files to reflect this.

@jklmnn
Copy link
Author

jklmnn commented Feb 8, 2019

I have currently installed cmake 3.7.2-1. After upgrading to 3.13.2-1~bpo9+1 I rerun and the warning you pointed out seems to be missing from the log. Yet when building nheko it still tries to use my system boost.

@redsky17
Copy link
Member

redsky17 commented Feb 8, 2019

Your log from building the dependencies looks good to me. Can you share the log for the nheko build itself and the command you used to configure it?

@jklmnn
Copy link
Author

jklmnn commented Feb 8, 2019

The configure command is in the first line of the log (git clone https://github.com/Nheko-Reborn/nheko.git && cd nheko && cmake -Hdeps -B.deps && cmake --build .deps).
The build has the output:

$ cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=.deps/usr
Build type set to 'Release'
-- Version: 0.6.2-83d2d6d
CMake Error at /usr/share/cmake-3.13/Modules/FindBoost.cmake:2100 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.62.0

  Boost include path: /usr/include

  Detected version of Boost is too old.  Requested version was 1.66 (or
  newer).
Call Stack (most recent call first):
  CMakeLists.txt:250 (find_package)


-- Configuring incomplete, errors occurred!
See also "/tmp/nheko/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/nheko/build/CMakeFiles/CMakeError.log".

CMakeOutput.log
CMakeError.log

@redsky17
Copy link
Member

I've been playing around with this a little more. Can you specify -DBOOST_ROOT=.deps/usr in the cmake command? I think it should pick up the included boost version when you do that:

cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=.deps/usr -DBOOST_ROOT=.deps/usr

@jklmnn
Copy link
Author

jklmnn commented Feb 13, 2019

Thanks, that fixed it!

deepbluev7 added a commit that referenced this issue Dec 17, 2022
Backtrace:

Thread 1 "nheko" received signal SIGSEGV, Segmentation fault.
containerWidget (w=w@entry=0x0) at /usr/src/debug/dev-qt/qtwidgets-5.15.7/qtbase-everywhere-src-5.15.7/src/widgets/styles/qstylesheetstyle.cpp:2467
2467        if (const QAbstractScrollArea *sa = qobject_cast<const QAbstractScrollArea *>(w->parentWidget())) {
(gdb) bt
 #0  containerWidget(QWidget const*) (w=w@entry=0x0) at /usr/src/debug/dev-qt/qtwidgets-5.15.7/qtbase-everywhere-src-5.15.7/src/widgets/styles/qstylesheetstyle.cpp:2467
 #1  0x00007ffff4aa0ad6 in QStyleSheetStyle::drawPrimitive(QStyle::PrimitiveElement, QStyleOption const*, QPainter*, QWidget const*) const (this=0x555559917900, pe=<optimized out>, opt=0x55555ea4b5c0, p=0x7fffffffcfd0, w=0x0) at /usr/src/debug/dev-qt/qtwidgets-5.15.7/qtbase-everywhere-src-5.15.7/src/widgets/styles/qstylesheetstyle.cpp:4452
 #2  0x00007fff61d4a86b in KQuickStyleItem::paint(QPainter*) (this=this@entry=0x55555ea4a1e0, painter=painter@entry=0x7fffffffcfd0) at /usr/src/debug/kde-frameworks/qqc2-desktop-style-5.101.0/qqc2-desktop-style-5.101.0/plugin/kquickstyleitem.cpp:1667
 #3  0x00007fff61d4b22a in KQuickStyleItem::updatePolish() (this=0x55555ea4a1e0) at /usr/src/debug/kde-frameworks/qqc2-desktop-style-5.101.0/qqc2-desktop-style-5.101.0/plugin/kquickstyleitem.cpp:1928
 #4  0x00007ffff57717c2 in QQuickWindowPrivate::polishItems() (this=0x55555ea2e760) at /usr/src/debug/dev-qt/qtdeclarative-5.15.7-r1/qtdeclarative-everywhere-src-5.15.7/src/quick/items/qquickwindow.cpp:393
 #5  0x00007ffff570f4ef in QSGThreadedRenderLoop::polishAndSync(QSGThreadedRenderLoop::Window*, bool) (this=this@entry=0x5555598eb770, w=w@entry=0x7fffe000aef0, inExpose=inExpose@entry=true) at /usr/src/debug/dev-qt/qtdeclarative-5.15.7-r1/qtdeclarative-everywhere-src-5.15.7/src/quick/scenegraph/qsgthreadedrenderloop.cpp:1576
 #6  0x00007ffff5710a8e in QSGThreadedRenderLoop::handleExposure(QQuickWindow*) (this=0x5555598eb770, window=<optimized out>) at /usr/src/debug/dev-qt/qtdeclarative-5.15.7-r1/qtdeclarative-everywhere-src-5.15.7/src/quick/scenegraph/qsgthreadedrenderloop.cpp:1374
 #7  0x00007ffff43d2b45 in QWindow::event(QEvent*) (this=0x7fffe0006eb0, ev=<optimized out>) at /usr/src/debug/dev-qt/qtgui-5.15.7-r1/qtbase-everywhere-src-5.15.7/src/gui/kernel/qwindow.cpp:2450
 #8  0x00007ffff49ee481 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x7fffe0006eb0, e=0x7fffffffd460) at /usr/src/debug/dev-qt/qtwidgets-5.15.7/qtbase-everywhere-src-5.15.7/src/widgets/kernel/qapplication.cpp:3637
 #9  0x00007ffff3e2d618 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x7fffe0006eb0, event=0x7fffffffd460) at /usr/src/debug/dev-qt/qtcore-5.15.7/qtbase-everywhere-src-5.15.7/src/corelib/kernel/qcoreapplication.cpp:1064
 #10 0x00007ffff43c8368 in QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent*) (e=0x55555f648b30) at /usr/src/debug/dev-qt/qtgui-5.15.7-r1/qtbase-everywhere-src-5.15.7/src/gui/kernel/qguiapplication.cpp:3261
 #11 0x00007ffff43a55ab in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) (flags=flags@entry=...) at /usr/src/debug/dev-qt/qtgui-5.15.7-r1/qtbase-everywhere-src-5.15.7/src/gui/kernel/qwindowsysteminterface.cpp:1169
 #12 0x00007fffef102622 in xcbSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>) at /usr/src/debug/dev-qt/qtgui-5.15.7-r1/qtbase-everywhere-src-5.15.7/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp:105
 #13 0x00007ffff386d030 in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0
 #14 0x00007ffff386d2d8 in  () at /usr/lib64/libglib-2.0.so.0
 #15 0x00007ffff386d36f in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0
 #16 0x00007ffff3e80e55 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x5555596a4770, flags=...) at /usr/src/debug/dev-qt/qtcore-5.15.7/qtbase-everywhere-src-5.15.7/src/corelib/kernel/qeventdispatcher_glib.cpp:423
 #17 0x00007ffff3e2c00b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fffffffd700, flags=..., flags@entry=...) at /usr/src/debug/dev-qt/qtcore-5.15.7/qtbase-everywhere-src-5.15.7/include/QtCore/../../src/corelib/global/qflags.h:69
 #18 0x00007ffff3e344ea in QCoreApplication::exec() () at /usr/src/debug/dev-qt/qtcore-5.15.7/qtbase-everywhere-src-5.15.7/include/QtCore/../../src/corelib/global/qflags.h:121
 #19 0x00005555594a5c43 in main(int, char**) (argc=2, argv=0x7fffffffdab8) at /home/nicolas/Dokumente/devel/open-source/nheko/src/main.cpp:401
(gdb) p w
$1 = (const QWidget *) 0x0
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

No branches or pull requests

3 participants