Discussion:
LuaRocks 3.0.4 on FreeBSD - unzip not found
Russell Haley
2018-11-08 06:33:50 UTC
Permalink
Hello LuaRocks Team,

I am attempting to bring the FreeBSD LuaRocks port up to date and I've run
into a snag with the 3.0.4 release. The unzip command is not being found by
Luarocks on FreeBSD 11.1:

Error: Failed unpacking rock file:
/tmp/luarocks_luarocks-rock-luasec-0.7-1-9983171/luasec-0.7-1.src.rock:
'unzip -n' program not found. Make sure unzip is installed and is available
in your PATH (or you may want to edit the 'variables.UNZIP' value in file
'/usr/local/etc/luarocks/config-5.3.lua')

I tried with and without modifications to the config-5.3.lua file. My
output is here: https://pastebin.com/Q43REgCX

I uninstalled 3.0.4 and re-installed 3.0.1 and there was no problem
installing luasec.

Do you have any suggestions or insight? Let me know if there is something
more you need from me, or if you'd like this issue reported through github?

Embarrassingly, this was originally caught by someone else testing the
patch, meaning I didn't even bother testing the luarocks installation
feature before I put up the patch on the review board. A true face-palm
moment on my part. :-/

Thanks,
Russ
Daurnimator
2018-11-08 06:56:06 UTC
Permalink
Error: Failed unpacking rock file: /tmp/luarocks_luarocks-rock-luasec-0.7-1-9983171/luasec-0.7-1.src.rock: 'unzip -n' program not found. Make sure unzip is installed and is available in your PATH (or you may want to edit the 'variables.UNZIP' value in file '/usr/local/etc/luarocks/config-5.3.lua')
I tried with and without modifications to the config-5.3.lua file. My output is here: https://pastebin.com/Q43REgCX
I uninstalled 3.0.4 and re-installed 3.0.1 and there was no problem installing luasec.
Do you have any suggestions or insight? Let me know if there is
something more you need from me, or if you'd like this issue reported
through github?

It looks like luarocks tests for the unzip binary by running `unzip
-h`. (See https://github.com/luarocks/luarocks/blob/c3360b669fcf2917ce89176ed8d62fc5d6e330e6/src/luarocks/fs/unix/tools.lua#L144
)
It was added in this commit
https://github.com/luarocks/luarocks/commit/c3360b669fcf2917ce89176ed8d62fc5d6e330e6
which says it was intended to produce better error messages.

What happens when you run `unzip -h`? What is the exit code?
Petr Štetiar
2018-11-08 12:37:46 UTC
Permalink
Russell Haley <***@gmail.com> [2018-11-07 22:33:50]:

Hi,
Post by Russell Haley
I tried with and without modifications to the config-5.3.lua file. My
output is here: https://pastebin.com/Q43REgCX
It seems like that FreeBSD version is shipping with custom unzip[1]
implementation, which doesn't have `-h` commandline option, option which is
being used by LuaRocks to find out if the unzip utility is installed.
Post by Russell Haley
Do you have any suggestions or insight? Let me know if there is something
more you need from me, or if you'd like this issue reported through github?
Maybe you should try to install unzip from FreeBSD ports, `pkg install unzip` ?

1. https://www.freebsd.org/cgi/man.cgi?query=unzip&apropos=0&sektion=1&manpath=FreeBSD+11.1-RELEASE&arch=default&format=ascii

-- ynezz
Dirk Laurie
2018-11-08 12:44:10 UTC
Permalink
Post by Petr Å tetiar
Hi,
Post by Russell Haley
I tried with and without modifications to the config-5.3.lua file. My
output is here: https://pastebin.com/Q43REgCX
It seems like that FreeBSD version is shipping with custom unzip[1]
implementation, which doesn't have `-h` commandline option, option which is
being used by LuaRocks to find out if the unzip utility is installed.
Maybe LuaRocks could use `unzip -v` instead of `unzip -h` for this purpose.
Petr Štetiar
2018-11-08 13:02:28 UTC
Permalink
Post by Dirk Laurie
Post by Petr Å tetiar
It seems like that FreeBSD version is shipping with custom unzip[1]
implementation, which doesn't have `-h` commandline option, option which is
being used by LuaRocks to find out if the unzip utility is installed.
Maybe LuaRocks could use `unzip -v` instead of `unzip -h` for this purpose.
Hm, I don't think so, as it seems, that this FreeBSDish unzip would exit[1]
with 0 return code only after succesful file unzip, but maybe I'm reading it
wrong :-)

1. https://github.com/freebsd/freebsd/blob/1d6e4247415d264485ee94b59fdbc12e0c566fd0/usr.bin/unzip/unzip.c#L1065

-- ynezz
Russell Haley
2018-11-09 04:08:02 UTC
Permalink
Post by Petr Å tetiar
Post by Dirk Laurie
Post by Petr Å tetiar
It seems like that FreeBSD version is shipping with custom unzip[1]
implementation, which doesn't have `-h` commandline option, option
which is
Post by Dirk Laurie
Post by Petr Å tetiar
being used by LuaRocks to find out if the unzip utility is installed.
Maybe LuaRocks could use `unzip -v` instead of `unzip -h` for this
purpose.
Hm, I don't think so, as it seems, that this FreeBSDish unzip would exit[1]
with 0 return code only after succesful file unzip, but maybe I'm reading it
wrong :-)
1.
https://github.com/freebsd/freebsd/blob/1d6e4247415d264485ee94b59fdbc12e0c566fd0/usr.bin/unzip/unzip.c#L1065
-- ynezz
Thanks Daurnimator et all! The version of unzip provided with the base
FreeBSD install does not support -h (nor does it support -v for version).
However, the version in ports/archivers provides the correct functionality
for both -h and -v. I did have that ports version installed in
/usr/local/bin but /usr/bin takes precedence in my path. So my plan now is
to add archivers/unzip as a port dependency and patch the config file.
(unless there's a better suggestion).

Thanks for the help!
Russ

Loading...