LuaRocks 3.0.4 on FreeBSD - unzip not found

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

LuaRocks 3.0.4 on FreeBSD - unzip not found

Russell Haley
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
Reply | Threaded
Open this post in threaded view
|

Re: LuaRocks 3.0.4 on FreeBSD - unzip not found

Daurnimator
On Thu, 8 Nov 2018 at 17:34, Russell Haley <[hidden email]> wrote:
> 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?

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?

Reply | Threaded
Open this post in threaded view
|

Re: LuaRocks 3.0.4 on FreeBSD - unzip not found

Petr Štetiar
In reply to this post by Russell Haley
Russell Haley <[hidden email]> [2018-11-07 22:33:50]:

Hi,

> 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.

> 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

Reply | Threaded
Open this post in threaded view
|

Re: LuaRocks 3.0.4 on FreeBSD - unzip not found

Dirk Laurie-2
Op Do., 8 Nov. 2018 om 14:38 het Petr Štetiar <[hidden email]> geskryf:

>
> Russell Haley <[hidden email]> [2018-11-07 22:33:50]:
>
> Hi,
>
> > 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.

Reply | Threaded
Open this post in threaded view
|

Re: LuaRocks 3.0.4 on FreeBSD - unzip not found

Petr Štetiar
Dirk Laurie <[hidden email]> [2018-11-08 14:44:10]:

> Op Do., 8 Nov. 2018 om 14:38 het Petr Štetiar <[hidden email]> geskryf:
> >
> > 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

Reply | Threaded
Open this post in threaded view
|

Re: LuaRocks 3.0.4 on FreeBSD - unzip not found

Russell Haley


On Thu, Nov 8, 2018 at 5:02 AM Petr Štetiar <[hidden email]> wrote:
Dirk Laurie <[hidden email]> [2018-11-08 14:44:10]:

> Op Do., 8 Nov. 2018 om 14:38 het Petr Štetiar <[hidden email]> geskryf:
> >
> > 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


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