Problem as encountered
I use z
as an intregral part of my workflow, specifically z.lua
, in general, an alternative cd
with long history and expressive matching & ranking with ‘frecency’. Installed from nixpkgs.
My tools are not behaving, this will be a learning experience.
Normal usage (z.lua
symlinked as z
):
$ z -l | wc -l -bash: /nix/store/03j6z2lbbqv85ajrd1ckbcbns378z6p9-lua-5.2.4/bin/lua: No such file or directory 0
z fails.
$ z.lua -l | wc -l 161
z.lua succeeds.
They point to the same executable. z
is a symlink in the z-lua
package to the z.lua
executable.
~$ realpath `which z z.lua`
/nix/store/q1lf50syn97bjvb96v30fm0bd2s9sdv8-z-lua-1.8.16/bin/z.lua
/nix/store/q1lf50syn97bjvb96v30fm0bd2s9sdv8-z-lua-1.8.16/bin/z.lua
Invoked as z.lua
it can read & print history, and echo usage, but cannot do it’s primary function of changing directory, to a hinted location.
Conclusions
I think I have a few conclusions.
- I need to fix the dependency specification for this package (aforementioned learning)
- I’m curious why invocation as
z.lua
fails to trigger an error, but it seems neigh certain this is a quirk of lua, not nix.
This post may just be a log of my learnings & thinking aloud.
Debugging note:
- Bash has not cached path, this fails in new shells too,
hash -l z z.lua
returns nothing.
Curiosity
I do have 5 distinct version of lua-5.2.4 installed, with differing binaries, shared library file, and pkgconfigs — though pkgconfig differences are only due to differing paths, and the included header files are identical.
Arrived at with lots of fun of chained fd, xargs, md5sum, sort, awk (attempted), & ulitmately pyp / pypyp.