lunarmodules/lua-compat-5.3

luaossl installation fails on alpine docker image

Closed this issue · 8 comments

Trying to install luaossl latest version with both luarocks and alpine apk fails.
Latest version that can be installed with luarocks is 20170903-0

luaossl contains local version of lua-compat 5.3 which should be aligned with v0.6 - see wahern/luaossl@3a2c1dc

Error during installation comes from this library:

vendor/compat53/c-api/compat-5.3.c: In function 'compat53_strerror':
vendor/compat53/c-api/compat-5.3.c:74:3: warning: implicit declaration of function 'strerror_s' [-Wimplicit-function-declaration]
   strerror_s(buff, sz, en);
   ^~~~~~~~~~

Reported also on luaossl: wahern/luaossl#136

Using alpine latest version / 3.6, lua5.1

Dockerfile:

FROM alpine

# Update apk index.
RUN apk update

# Build dependencies.
RUN apk add build-base bash curl unzip

# Install packages necessary for Lua, Luarocks.
RUN apk add lua5.1 lua5.1-dev luarocks5.1
RUN apk add openssl openssl-dev

RUN luarocks-5.1 install luaossl

Result:

$ docker build -t luaossl .
Sending build context to Docker daemon 2.048 kB
Step 1/6 : FROM alpine
 ---> 3fd9065eaf02
Step 2/6 : RUN apk update
 ---> Running in 3e07e75070fe
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-214-g519be0a2d1 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-207-gac61833f9b [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
OK: 9054 distinct packages available
 ---> 78a6dabb0aba
Removing intermediate container 3e07e75070fe
Step 3/6 : RUN apk add build-base bash curl unzip
 ---> Running in 79306c4ac4cf
(1/30) Upgrading musl (1.1.18-r2 -> 1.1.18-r3)
(2/30) Installing pkgconf (1.3.10-r0)
(3/30) Installing ncurses-terminfo-base (6.0_p20171125-r0)
(4/30) Installing ncurses-terminfo (6.0_p20171125-r0)
(5/30) Installing ncurses-libs (6.0_p20171125-r0)
(6/30) Installing readline (7.0.003-r0)
(7/30) Installing bash (4.4.19-r1)
Executing bash-4.4.19-r1.post-install
(8/30) Installing binutils-libs (2.30-r1)
(9/30) Installing binutils (2.30-r1)
(10/30) Installing gmp (6.1.2-r1)
(11/30) Installing isl (0.18-r0)
(12/30) Installing libgomp (6.4.0-r5)
(13/30) Installing libatomic (6.4.0-r5)
(14/30) Installing libgcc (6.4.0-r5)
(15/30) Installing mpfr3 (3.1.5-r1)
(16/30) Installing mpc1 (1.0.3-r1)
(17/30) Installing libstdc++ (6.4.0-r5)
(18/30) Installing gcc (6.4.0-r5)
(19/30) Installing musl-dev (1.1.18-r3)
(20/30) Installing libc-dev (0.7.1-r0)
(21/30) Installing g++ (6.4.0-r5)
(22/30) Installing make (4.2.1-r0)
(23/30) Installing fortify-headers (0.9-r0)
(24/30) Installing build-base (0.5-r0)
(25/30) Installing ca-certificates (20171114-r0)
(26/30) Installing libssh2 (1.8.0-r2)
(27/30) Installing libcurl (7.60.0-r1)
(28/30) Installing curl (7.60.0-r1)
(29/30) Upgrading musl-utils (1.1.18-r2 -> 1.1.18-r3)
(30/30) Installing unzip (6.0-r2)
Executing busybox-1.27.2-r7.trigger
Executing ca-certificates-20171114-r0.trigger
OK: 171 MiB in 39 packages
 ---> 583a4d8b9da5
Removing intermediate container 79306c4ac4cf
Step 4/6 : RUN apk add lua5.1 lua5.1-dev luarocks5.1
 ---> Running in f53cf1233a04
(1/4) Installing lua5.1-libs (5.1.5-r3)
(2/4) Installing lua5.1 (5.1.5-r3)
(3/4) Installing lua5.1-dev (5.1.5-r3)
(4/4) Installing luarocks5.1 (2.4.3-r0)
Executing busybox-1.27.2-r7.trigger
OK: 172 MiB in 43 packages
 ---> a9feff4c83a3
Removing intermediate container f53cf1233a04
Step 5/6 : RUN apk add openssl openssl-dev
 ---> Running in 4c13c2f53b2c
(1/5) Installing libcrypto1.0 (1.0.2o-r0)
(2/5) Installing libssl1.0 (1.0.2o-r0)
(3/5) Installing openssl (1.0.2o-r0)
(4/5) Installing zlib-dev (1.2.11-r1)
(5/5) Installing openssl-dev (1.0.2o-r0)
Executing busybox-1.27.2-r7.trigger
Executing ca-certificates-20171114-r0.trigger
OK: 193 MiB in 48 packages
 ---> eed6414e9b32
Removing intermediate container 4c13c2f53b2c
Step 6/6 : RUN luarocks-5.1 install luaossl
 ---> Running in 92a1972d5aab
Warning: The directory '/root/.cache/luarocks' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and ow
Installing https://luarocks.org/luaossl-20180530-0.src.rock
Hunk 1 found at offset 2...
successfully patched /tmp/luarocks_luaossl-20180530-0-Lgokdg/luaossl-rel-20180530/src/openssl.c
vendor/compat53/c-api/compat-5.3.c: In function 'compat53_strerror':
vendor/compat53/c-api/compat-5.3.c:74:3: warning: implicit declaration of function 'strerror_s' [-Wimplicit-function-declaration]
   strerror_s(buff, sz, en);
   ^~~~~~~~~~
Applying patch config.h.diff...
gcc -O2 -fPIC -I/usr/include -c src/openssl.c -o src/openssl.o -D_REENTRANT -D_THREAD_SAFE -DCOMPAT53_PREFIX=luaossl -D_GNU_SOURCE -I/usr/include -I/usr/include
gcc -O2 -fPIC -I/usr/include -c vendor/compat53/c-api/compat-5.3.c -o vendor/compat53/c-api/compat-5.3.o -D_REENTRANT -D_THREAD_SAFE -DCOMPAT53_PREFIX=luaossl -D_GNU_SOURCE
gcc -shared -o _openssl.so -L/usr/lib src/openssl.o vendor/compat53/c-api/compat-5.3.o -L/usr/lib -L/usr/lib -Wl,-rpath,/usr/lib: -Wl,-rpath,/usr/lib: -lssl -lcrypto -lpthr
No existing manifest. Attempting to rebuild...
luaossl 20180530-0 is now installed in /usr/local (license: MIT/X11)

 ---> 06bb9bcb952b
Removing intermediate container 92a1972d5aab
Successfully built 06bb9bcb952b
Successfully tagged luaossl:latest

Probably related to #41 and fixed in daebe77.

@siffiejoe thanks for looking. seems like this fix was not merged

seems like this fix was not merged

It hasn't been merged into luaossl as there hasn't been a compat-5.3 release since that commit.

@siffiejoe I can help out by pushing a 0.6.1 bugfix release (also, I just noticed 0.6 wasn't pushed to luarocks.org). Would you be fine with that?

@hishamhm I've tagged a new version so that @daurnimator can go ahead and update luaossl. I'll upload new rockspecs later. I didn't do that for 0.6 because there were no changes to the Lua module or to the backported C modules. It was new additions to the C API only.

Thanks @siffiejoe!

@siffiejoe thank you!

closing it since wahern/luaossl#136 was closed