Executables in /usr/local/libexec cannot be run (toolbox question)

I am playing around with harelang.org in a toolbx container on Fedora Silverblue 42.

Everything is fine, except for the hare tool subcommand(s). These are executables to be installed into (and launched by the hare build driver from) LIBEXECDIR. Since I installed hare to prefix /usr/local (i.e. ran all make invocations without overriding the defaults), LIBEXECDIR is in fact /usr/local/libexec in my toolbx container.

An example tool I want to use is ~sircmpwn/hare-update - Tool for assisting in updating Hare codebases affected by breaking changes - sourcehut git, which has a single exectuable file to install: hare-update, and it ends up in /usr/local/libexec/hare/hare-update:

⬢ [me@toolbx ~]$ ls -lZ /usr/local/libexec/hare/hare-update 
-rwxr-xr-x. 1 root root system_u:object_r:container_file_t:s0:c1022,c1023 1900192 16. Jul 20:05 /usr/local/libexec/hare/hare-update

But, if I now try to invoke it via hare tool, I get:

⬢ [jm@toolbx ~]$ hare tool update -h
Error: Command not found

The only way I got it to run, was to add /usr/local/libexec/hare to PATH:

⬢ [jm@toolbx ~]$ PATH="/usr/local/libexec/hare:$PATH" hare tool update -h
hare tool update: assist in upgrading a codebase to a newer Hare release

Usage: hare tool update [-hdlyV] [-t <version>] [files...]

-h: print this help text
-d: output a unified diff of the changes
-l: list available Hare versions
-t <version>: select target Hare version
-y: accept the default answers for each prompt (use with caution)
-V: skip VCS safety check

But this can’t be the correct solution? What am I doing wrong?

I tried installing hare and hare-update according to their instructions into a new toolbx, and it just worked immediately.

I believe something might be wrong with your installation of hare. Something you can do is to install strace and run strace hare tool update -h. It will give you a trace of everything hare tries to do, and you should see if it was looking for hare-update at the right location.

3 Likes

Thanks for testing on your end. I tried strace, but the output showed just that it tried to find hare-update in all paths of my $PATH and then gave up, because it was in none of them.

So, I reinstalled hare in a fresh toolbox also following the instructions very closely, and now it works. The only sensible explanation I have is that maybe I forgot to cp configs/linux.mk config.mk for hare yesterday. I just found that it contains a line to set TOOLDIR=$(LIBEXECDIR)/hare (https://git.sr.ht/~sircmpwn/hare/tree/421159dc8f15398c437518e69170ed3c6753efc7/item/configs/linux.mk#L8).

Thanks for the info that it worked for you after following the install instructions closely. That was the solution! :slight_smile:

1 Like