hawck icon indicating copy to clipboard operation
hawck copied to clipboard

Installation instructions for Ubuntu lacking + install error

Open felagund opened this issue 2 years ago • 8 comments

Hello, thank you for theprogram, its promise sounds great!

When following the installation insttructions in the readme, I got this prompt: Screenshot_20220102_195222

I selected "don't touch keymap" but I would appreciate if the readme told me to that that is what I am supposed to do.

Then when I tried to install it, it failed:

FAILED: tests/hawck-tests.p/tests-main.cpp.o 
c++ -Itests/hawck-tests.p -Itests -I../tests -Isrc -I../src -I../src/include-ext -I/usr/include/lua5.3 -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++17 -g -Wno-reorder -DMESON_COMPILE=1 -O2 -pthread -MD -MQ tests/hawck-tests.p/tests-main.cpp.o -MF tests/hawck-tests.p/tests-main.cpp.o.d -o tests/hawck-tests.p/tests-main.cpp.o -c ../tests/tests-main.cpp
In file included from /usr/include/signal.h:328,
                 from ../src/include-ext/catch2/catch.hpp:4907,
                 from ../tests/tests-main.cpp:2:
../src/include-ext/catch2/catch.hpp:7485:58: error: call to non-‘constexpr’ function ‘long int sysconf(int)’
 7485 |     constexpr static std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
      |                                                          ^~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from ../src/include-ext/catch2/catch.hpp:4907,
                 from ../tests/tests-main.cpp:2:
/usr/include/unistd.h:640:17: note: ‘long int sysconf(int)’ declared here
  640 | extern long int sysconf (int __name) __THROW;
      |                 ^~~~~~~
In file included from ../tests/tests-main.cpp:2:
../src/include-ext/catch2/catch.hpp:7544:45: error: size of array ‘altStackMem’ is not an integral constant-expression
 7544 |     char FatalConditionHandler::altStackMem[sigStackSize] = {};
      |                                             ^~~~~~~~~~~~
[36/39] Compiling C++ object tests/hawck-tests.p/.._src_Permissions.cpp.o
ninja: build stopped: subcommand failed.

(no idea what to do about that:-))

Adn then the readme says: When you've started the computer back up again, run the following commands:

but no command follow the colon. What are we supposed to run?

felagund avatar Jan 02 '22 19:01 felagund

Yep: +1: I have never even seen that message in relation to hawck, but not being able to make it work has caused me come into the issues to look, and still not figure it out. There is obviously something missing from, or out of sequence in, the instruction set that is failing some of us.

BETLOG avatar Feb 16 '22 00:02 BETLOG

I reproduced the error in OpenSUSE Tumbleweed.

➜  Hawck git:(master) ✗ ./install.sh 
~/Hawck/build ~/Hawck
Directory already configured.

Just run your build command (e.g. ninja) and Meson will regenerate as necessary.
If ninja fails, run "ninja reconfigure" or "meson --reconfigure"
to force Meson to regenerate.

If build failures persist, run "meson setup --wipe" to rebuild from scratch
using the same options as passed when configuring the build.
To change option values, run "meson configure" instead.
[0/1] Regenerating build files.
The Meson build system
Version: 0.61.3
Source dir: /home/blaster/Hawck
Build dir: /home/blaster/Hawck/build
Build type: native build
Project name: Hawck
Project version: 0.7.1
C compiler for the host machine: cc (gcc 11.2.1 "cc (SUSE Linux) 11.2.1 20220316 [revision 6a1150d1524aeda3381b2171712e1a6611d441d6]")
C linker for the host machine: cc ld.bfd 2.38.20220304-3
C++ compiler for the host machine: c++ (gcc 11.2.1 "c++ (SUSE Linux) 11.2.1 20220316 [revision 6a1150d1524aeda3381b2171712e1a6611d441d6]")
C++ linker for the host machine: c++ ld.bfd 2.38.20220304-3
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (1.8.0)
Dependency lua found: NO found 5.4.4 but need: '<5.4' ; matched: '>=5.3'
Found CMake: /usr/bin/cmake (3.23.0)
Run-time dependency lua found: NO (tried pkgconfig and cmake)
Dependency lua5.3 found: YES 5.3.6 (cached)
Dependency threads found: YES unknown (cached)
Dependency libnotify found: YES 0.7.9 (cached)
Configuring hawck_config.h using configuration
Run-time dependency catch2 found: NO (tried pkgconfig and cmake)
Message: Downloading Catch2 header file ...
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: https://github.com/mesonbuild/meson/issues/9300
Configuring hawck-inputd.service using configuration
Configuring hawck-macrod.service using configuration
Configuring hawck-user-setup.sh using configuration
Configuring hawck-install.sh using configuration
Build targets in project: 3

Hawck 0.7.1

  Configuration
    redirect_std     : no
    use_meson_install: no
    development_build: no
    with_systemd     : yes

  Installation paths
    prefix           : /usr
    hawck_share_dir  : /usr/share
    hawck_cfg_dir    : /etc
    modules_load_dir : /etc/modules-load.d
    udev_rules_dir   : /etc/udev/rules.d

  User defined options
    backend          : ninja
    prefix           : /usr
    cpp_args         : -O2

Found ninja-1.10.2 at /usr/bin/ninja
Cleaning... 0 files.
[1/2] Compiling C++ object tests/hawck-tests.p/tests-main.cpp.o
FAILED: tests/hawck-tests.p/tests-main.cpp.o 
c++ -Itests/hawck-tests.p -Itests -I../tests -Isrc -I../src -I../src/include-ext -I/usr/include/lua5.3 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++17 -g -Wno-reorder -DMESON_COMPILE=1 -O2 -pthread -MD -MQ tests/hawck-tests.p/tests-main.cpp.o -MF tests/hawck-tests.p/tests-main.cpp.o.d -o tests/hawck-tests.p/tests-main.cpp.o -c ../tests/tests-main.cpp
In file included from /usr/include/signal.h:328,
                 from ../src/include-ext/catch2/catch.hpp:4907,
                 from ../tests/tests-main.cpp:2:
../src/include-ext/catch2/catch.hpp:7485:58: error: call to non-‘constexpr’ function ‘long int sysconf(int)’
 7485 |     constexpr static std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
      |                                                          ^~~~~~~~~~~
In file included from /usr/include/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from ../src/include-ext/catch2/catch.hpp:4907,
                 from ../tests/tests-main.cpp:2:
/usr/include/unistd.h:640:17: note: ‘long int sysconf(int)’ declared here
  640 | extern long int sysconf (int __name) __THROW;
      |                 ^~~~~~~
In file included from ../tests/tests-main.cpp:2:
../src/include-ext/catch2/catch.hpp:7544:45: error: size of array ‘altStackMem’ is not an integral constant-expression
 7544 |     char FatalConditionHandler::altStackMem[sigStackSize] = {};
      |                                             ^~~~~~~~~~~~
ninja: build stopped: subcommand failed.

dottorblaster avatar Apr 09 '22 11:04 dottorblaster

Solved the error in my case using the package manager, installing the test framework.

sudo zypper in Catch2-devel

dottorblaster avatar Apr 09 '22 11:04 dottorblaster

does this look like the *buntu equiv?

catch/focal 1.12.1-1ubuntu1 amd64 C++ Automated Test Cases in Headers

BETLOG avatar Apr 09 '22 23:04 BETLOG

@BETLOG I think the correct ones are catch2 and catch2-dev but IDK if those come in Ubuntu honestly, I have to grep the interwebs :-)

dottorblaster avatar Apr 10 '22 20:04 dottorblaster

https://github.com/snyball/Hawck/blob/60aafac2d8e5a6ec314dd41383daa5f4658caca5/tests/meson.build#L4-L20

What is this???

Please use https://wrapdb.mesonbuild.com/

meson wrap install catch2

It is considerably more up to date, it uses Meson's builtin dependency fallback handler so that you aren't running mysterious shell scripts during configure, it respects caching, it respects wrap-mode...

:)

eli-schwartz avatar Apr 11 '22 01:04 eli-schwartz

https://github.com/snyball/Hawck/blob/60aafac2d8e5a6ec314dd41383daa5f4658caca5/tests/meson.build#L4-L20

What is this???

Please use https://wrapdb.mesonbuild.com/


meson wrap install catch2

It is considerably more up to date, it uses Meson's builtin dependency fallback handler so that you aren't running mysterious shell scripts during configure, it respects caching, it respects wrap-mode...

:)

Yeah, that downloading code is ugly and hacky. The wrapdb thing seems like a much better option.

snyball avatar Apr 11 '22 01:04 snyball

To be fair, the wrapdb has been the recommended solution in the general case since 2015.

But.

catch2 was only added to the wrapdb in October 2018, while commit 04acd45a3177b628c6b01600f736273f03d8d7e0 implemented a custom downloader a couple months before that.

(It doesn't ever seem to have been updated since then. The WrapDB allows transparently updating.)

eli-schwartz avatar Apr 11 '22 01:04 eli-schwartz

Still hitting this on Ubuntu 22.04:

../src/include-ext/catch2/catch.hpp:7485:58: error: call to non-‘constexpr’ function ‘long int sysconf(int)’

According to https://github.com/tplgy/cppcodec/issues/74 an upgrade from Catch2 2.3.0 to 2.13.9 fixes it, so I first tried to change meson.build but for some reason I got undefined reference to Catch::AssertionHandler::AssertionHandler(...)

I then tried with the built-in ubuntu 22.04 package (2.13.8) and that worked!

sudo apt install catch2
rm -r src/include-ext/catch2
./install.sh

eddy-geek avatar Jan 04 '23 09:01 eddy-geek

Fixed in 730d5f4af60d16d6dfc3d2d60871abf86fa20ed3 (which just removes the ill-advised downloading code.)

snyball avatar Jan 04 '23 09:01 snyball