Nitrokey / nitrokey-app

Nitrokey's Application (Win, Linux, Mac)
https://www.nitrokey.com/
287 stars 55 forks source link

Cannot build without Catch2/cppcodec being available #463

Open daringer opened 3 years ago

daringer commented 3 years ago

Expected behaviour

It's possible to build w/o Catch2 / cppcodec

Current behaviour

cppcodec and Catch2 not available, leads to the output below during a default build. If cppcodec is available and Catch2 is not, then the build fails due to a missing Catch2.

Steps for reproduction

make sure cppcodec is not available and try to build

Logs

[ 60%] Building CXX object CMakeFiles/nitrokey-app.dir/src/systemutils.cpp.o
/run/build/nitrokey-app/src/hotpslot.cpp:38:10: fatal error: cppcodec/base32_crockford.hpp: No such file or directory
   38 | #include <cppcodec/base32_crockford.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/nitrokey-app.dir/build.make:200: CMakeFiles/nitrokey-app.dir/src/hotpslot.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/run/build/nitrokey-app/src/ui/mainwindow.cpp:505:10: fatal error: cppcodec/hex_upper.hpp: No such file or directory
  505 | #include <cppcodec/hex_upper.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/nitrokey-app.dir/build.make:239: CMakeFiles/nitrokey-app.dir/src/ui/mainwindow.cpp.o] Error 1
^Cmake: *** [Makefile:2: local-install] Interrupt
jeremiah commented 3 years ago

This hits me too. Trying to build the app for Debian based systems but get the same error.

Scanning dependencies of target nitrokey-app
[ 22%] Building CXX object CMakeFiles/nitrokey-app.dir/src/ui/nitrokey-applet.cpp.o
[ 25%] Building CXX object CMakeFiles/nitrokey-app.dir/src/ui/aboutdialog.cpp.o
[ 27%] Building CXX object CMakeFiles/nitrokey-app.dir/src/main.cpp.o
[ 32%] Building CXX object CMakeFiles/nitrokey-app.dir/src/hotpslot.cpp.o
[ 32%] Building CXX object CMakeFiles/nitrokey-app.dir/nitrokey-app_autogen/mocs_compilation.cpp.o
[ 35%] Building CXX object CMakeFiles/nitrokey-app.dir/src/ui/mainwindow.cpp.o
[ 37%] Building CXX object CMakeFiles/nitrokey-app.dir/src/ui/pindialog.cpp.o
[ 40%] Building CXX object CMakeFiles/nitrokey-app.dir/src/core/SecureString.cpp.o
/home/jeremiah/packaging/nitrokey-app-v1.4.2/src/hotpslot.cpp:38:10: fatal error: cppcodec/base32_crockford.hpp: No such file or directory
   38 | #include <cppcodec/base32_crockford.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/nitrokey-app.dir/build.make:200: CMakeFiles/nitrokey-app.dir/src/hotpslot.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/jeremiah/packaging/nitrokey-app-v1.4.2/src/ui/mainwindow.cpp:505:10: fatal error: cppcodec/hex_upper.hpp: No such file or directory
  505 | #include <cppcodec/hex_upper.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/nitrokey-app.dir/build.make:239: CMakeFiles/nitrokey-app.dir/src/ui/mainwindow.cpp.o] Error 1
/home/jeremiah/packaging/nitrokey-app-v1.4.2/src/main.cpp: In function ‘void configureRandomGenerator()’:
/home/jeremiah/packaging/nitrokey-app-v1.4.2/src/main.cpp:179:75: warning: ‘void qsrand(uint)’ is deprecated: use QRandomGenerator instead [-Wdeprecated-declarations]
  179 |     qsrand(static_cast<uint> (local.currentMSecsSinceEpoch() % 2000000000));
      |                                                                           ^
In file included from /usr/include/x86_64-linux-gnu/qt5/QtGui/qtguiglobal.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qtwidgetsglobal.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qmainwindow.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QMainWindow:1,
                 from /home/jeremiah/packaging/nitrokey-app-v1.4.2/src/ui/mainwindow.h:28,
                 from /home/jeremiah/packaging/nitrokey-app-v1.4.2/src/main.cpp:23:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:1278:81: note: declared here
 1278 | Q_CORE_EXPORT QT_DEPRECATED_VERSION_X_5_15("use QRandomGenerator instead") void qsrand(uint seed);
      |                                                                                 ^~~~~~
make[1]: *** [CMakeFiles/Makefile2:116: CMakeFiles/nitrokey-app.dir/all] Error 2
make: *** [Makefile:171: all] Error 2

Weird because I can build 1.4.1 without issues.

jeremiah commented 3 years ago

I guess the solution is perhaps to include cppcodec in official releases of nitrokey-app. Otherwise, one has to use the git submodule to pull it in or download cppcode separately as cppcode is not packaged for Debian. It's not listed as a dependency in the README either.

szszszsz commented 3 years ago

I am not sure I understand the problem. @daringer Why do you need that? For general case the Readme clearly states that submodules are required:

@jeremiah Nothing has changed since v1.4.1 though - could you confirm?

Readme indeed is missing dependencies list.

daringer commented 3 years ago

@daringer Why do you need that? For general case the Readme clearly states that submodules are required:

well, the obvious reason is that building without tests might be a nice-to-have.

Generally, revisited this and I believe the issue is simply the source-packaging I was using - you are totally right, the README clearly states the need for sub modules. But for the flatpak release I was using the .tgz provided in "releases" and inside this archive the sub-modules (i.e., cppcodec, but also libnitrokey) are not included.

Means for the git repository itself this is not an issue, but for the source-releases nitrokey-app should either include cppcodec or provide a way to build without it...

jeremiah commented 3 years ago

@szszszsz The only change from 1.4.1 to 1.4.2 I believe is the addition of bash auto-completion.