Nix Docker buildLayeredImage musl -static build issue

Hi,

I try to replicate building docker images from nix from https://www.youtube.com/watch?v=WP_oAmV6C2U

I encountered the issues in the last step.
I have two Redis images based on multilayer one as in below.

redis-multi.nix

{ pkgs ? import <nixpkgs>{}
, name ? "nix-redis-layered"
, redis ? pkgs.redis
}:

let
  inherit (pkgs.dockerTools) buildLayeredImage;

in buildLayeredImage {
  inherit name;
  tag = "latest";

  contents = with pkgs; [
    redis
  ];

  config = {
    Cmd = [ "/bin/redis-server" ];
    WorkingDir = "/data";
    Volumes = {
      "/data" = {};
    };
  };
  created = "now";

  maxLayers = 100;

}

And minimal build

redis-multi-mini.nix

{ pkgs ? import <nixpkgs> {}
}:

import ./redis-multi.nix {
  inherit pkgs;

  name =  "nix-redis-layered-minimal";
#  tag = "latest";

  redis = pkgs.redis.overrideAttrs (old: {
    makeFlags = old.makeFlags ++ ["USE_SYSTEMD=no"];
#    buildInputs = [ pkgs.glibc.static ];
    preBuild = ''
      set -x
      makeFlagsArray=(PREFIX="$out"
                      CC="${pkgs.musl.dev}/bin/musl-gcc -static"
                      CFLAGS="-I${pkgs.musl.dev}/include"
                      LDFLAGS="-L${pkgs.musl.dev}/lib")
      '';
      postInstall = "rm -f $out/bin/redis-{benchmark,check-*,cli}";
    });
}

Running
nix-build redis-multi-mini.nix

I encounter the issue below.

    CC lolwut.o
    CC lolwut5.o
    CC lolwut6.o
    CC acl.o
    CC gopher.o
    CC tracking.o
    CC connection.o
    CC tls.o
    CC sha256.o
    CC timeout.o
    CC setcpuaffinity.o
    CC monotonic.o
    CC mt19937-64.o
    CC redis-cli.o
    CC cli_common.o
    CC redis-benchmark.o
    CC redis-benchmark.o
    LINK redis-benchmark
/nix/store/5ddb4j8z84p6sjphr0kh6cbq5jd12ncs-binutils-2.35.1/bin/ld: cannot find -lssl
/nix/store/5ddb4j8z84p6sjphr0kh6cbq5jd12ncs-binutils-2.35.1/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:359: redis-benchmark] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/build/redis-6.2.5/src'
make: *** [Makefile:6: all] Error 2
+ exitHandler
+ exitCode=2
+ set +e
+ '[' -n '' ']'
+ ((  2 != 0  ))
+ runHook failureHook
+ local hookName=failureHook
+ shift
+ local 'hooksSlice=failureHooks[@]'
+ local hook
+ for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"}
+ _eval '_callImplicitHook 0 failureHook'
+ declare -F '_callImplicitHook 0 failureHook'
+ eval '_callImplicitHook 0 failureHook'
++ _callImplicitHook 0 failureHook
++ local def=0
++ local hookName=failureHook
++ declare -F failureHook
++ type -p failureHook
++ '[' -n '' ']'
++ return 0
+ return 0
+ '[' -n '' ']'
+ exit 2
error: builder for '/nix/store/jsi9fpiars3kwy43k1h6b7hl5na330dq-redis-6.2.5.drv' failed with exit code 2;
       last 10 log lines:
       > ++ _callImplicitHook 0 failureHook
       > ++ local def=0
       > ++ local hookName=failureHook
       > ++ declare -F failureHook
       > ++ type -p failureHook
       > ++ '[' -n '' ']'
       > ++ return 0
       > + return 0
       > + '[' -n '' ']'
       > + exit 2
       For full logs, run 'nix log /nix/store/jsi9fpiars3kwy43k1h6b7hl5na330dq-redis-6.2.5.drv'.
error: 1 dependencies of derivation '/nix/store/jalr1c669zvs1gcxjgqdr22m6k7m8r44-closure.drv' failed to build
error: 1 dependencies of derivation '/nix/store/j8nh1lx8f5filwvkvpahmjdgj640g7kl-nix-redis-layered-minimal-conf.json.drv' failed to build
error: 1 dependencies of derivation '/nix/store/2shpmnz3xs5l06fig2hnbmcdbv5vw88l-stream-nix-redis-layered-minimal.drv' failed to build
error: 1 dependencies of derivation '/nix/store/awchbx4r24r4bp21ryvadicnk2vqw6qg-nix-redis-layered-minimal.tar.gz.drv' failed to build

The problem seems to be related to CC="${pkgs.musl.dev}/bin/musl-gcc -static"

if I try to link statically -static during the compilation nix can’t find path to -lssl and -lcrypto

Any idea how to fix this?

1 Like

you are currently missing a static library version of openssl.
An easier way to get a static version of packages is to use the pkgsStatic namespace.
I just found that there is an issue with the redis package:

nix-build -A pkgsStatic.redis
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating examples/Makefile
config.status: creating shlib/Makefile
config.status: creating config.h
config.status: executing default commands
building
build flags: SHELL=/nix/store/1flh34xxg9q3fpc88xyp2qynxpkfg8py-bash-4.4-p23/bin/bash
rm -f readline.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O readline.c
rm -f vi_mode.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O vi_mode.c
rm -f funmap.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O funmap.c
rm -f keymaps.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O keymaps.c
rm -f parens.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O parens.c
rm -f search.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O search.c
rm -f rltty.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O rltty.c
rm -f complete.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O complete.c
rm -f bind.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O bind.c
rm -f isearch.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O isearch.c
rm -f display.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O display.c
rm -f signals.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O signals.c
rm -f util.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O util.c
rm -f kill.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O kill.c
rm -f undo.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O undo.c
rm -f macro.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O macro.c
rm -f input.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O input.c
rm -f callback.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O callback.c
rm -f terminal.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O terminal.c
rm -f text.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O text.c
rm -f nls.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O nls.c
rm -f misc.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O misc.c
rm -f history.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O history.c
rm -f histexpand.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O histexpand.c
rm -f histfile.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O histfile.c
rm -f histsearch.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O histsearch.c
rm -f shell.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O shell.c
rm -f mbutil.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O mbutil.c
rm -f tilde.o
x86_64-unknown-linux-musl-gcc -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O -DREADLINE_LIBRARY -c ./tilde.c
rm -f colors.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O colors.c
rm -f parse-colors.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O parse-colors.c
rm -f xmalloc.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O xmalloc.c
rm -f xfree.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O xfree.c
rm -f compat.o
x86_64-unknown-linux-musl-gcc -c -DHAVE_CONFIG_H -DCROSS_COMPILING   -I. -I. -DRL_LIBRARY_VERSION='"6.3"' -g -O compat.c
rm -f libreadline.a
x86_64-unknown-linux-musl-ar cr libreadline.a readline.o vi_mode.o funmap.o keymaps.o parens.o search.o rltty.o complete.o bind.o isearch.o display.o signals.o util.o kill.o undo.o macro.o input.o callback.o terminal.o text.o nls.o misc.o history.o histexpand.o histfile.o histsearch.o shell.o mbutil.o tilde.o colors.o parse-colors.o xmalloc.o xfree.o compat.o
test -n "x86_64-unknown-linux-musl-ranlib" && x86_64-unknown-linux-musl-ranlib libreadline.a
rm -f libhistory.a
x86_64-unknown-linux-musl-ar cr libhistory.a history.o histexpand.o histfile.o histsearch.o shell.o mbutil.o xmalloc.o xfree.o
test -n "x86_64-unknown-linux-musl-ranlib" && x86_64-unknown-linux-musl-ranlib libhistory.a
installing
install flags: SHELL=/nix/store/1flh34xxg9q3fpc88xyp2qynxpkfg8py-bash-4.4-p23/bin/bash pkgconfigdir=/nix/store/0dsbfdavyjxj2zdj1hrpjyd6sgvxxm2k-readline-6.3p08-x86_64-unknown-linux-musl-dev/lib/pkgconfig m4datadir=/nix/store/0dsbfdavyjxj2zdj1hrpjyd6sgvxxm2k-readline-6.3p08-x86_64-unknown-linux-musl-dev/share/aclocal aclocaldir=/nix/store/0dsbfdavyjxj2zdj1hrpjyd6sgvxxm2k-readline-6.3p08-x86_64-unknown-linux-musl-dev/share/aclocal install
/nix/store/1flh34xxg9q3fpc88xyp2qynxpkfg8py-bash-4.4-p23/bin/bash ./support/mkinstalldirs /nix/store/0dsbfdavyjxj2zdj1hrpjyd6sgvxxm2k-readline-6.3p08-x86_64-unknown-linux-musl-dev/include \
        /nix/store/0dsbfdavyjxj2zdj1hrpjyd6sgvxxm2k-readline-6.3p08-x86_64-unknown-linux-musl-dev/include/readline /nix/store/x1y6syhvyg08nqnbasw0kf6x1971y7hb-readline-6.3p08-x86_64-unknown-linux-musl/lib \
        /nix/store/6x2p5zbylgczzh3rv75ljkykl2f1hhc7-readline-6.3p08-x86_64-unknown-linux-musl-info/share/info /nix/store/5m8pkkdk2mcn4qkbbnrlflanyrawjvbp-readline-6.3p08-x86_64-unknown-linux-musl-man/share/man/man3 /nix/store/5qdhnarjk4pdh50v3g6k1fklwq9kpfms-readline-6.3p08-x86_64-unknown-linux-musl-doc/share/doc/readline
mkdir -p -- /nix/store/0dsbfdavyjxj2zdj1hrpjyd6sgvxxm2k-readline-6.3p08-x86_64-unknown-linux-musl-dev/include /nix/store/0dsbfdavyjxj2zdj1hrpjyd6sgvxxm2k-readline-6.3p08-x86_64-unknown-linux-musl-dev/include/readline /nix/store/x1y6syhvyg08nqnbasw0kf6x1971y7hb-readline-6.3p08-x86_64-unknown-linux-musl/lib /nix/store/6x2p5zbylgczzh3rv75ljkykl2f1hhc7-readline-6.3p08-x86_64-unknown-linux-musl-info/share/info /nix/store/5m8pkkdk2mcn4qkbbnrlflanyrawjvbp-readline-6.3p08-x86_64-unknown-linux-musl-man/share/man/man3 /nix/store/5qdhnarjk4pdh50v3g6k1fklwq9kpfms-readline-6.3p08-x86_64-unknown-linux-musl-doc/share/doc/readline
for f in readline.h chardefs.h keymaps.h history.h tilde.h rlstdc.h rlconf.h rltypedefs.h; do \
        /nix/store/lglxa6zjxag1dy0d0lygb34jwv1s65g6-coreutils-8.32/bin/install -c -m 644 ./$f /nix/store/0dsbfdavyjxj2zdj1hrpjyd6sgvxxm2k-readline-6.3p08-x86_64-unknown-linux-musl-dev/include/readline ; \
done
/nix/store/lglxa6zjxag1dy0d0lygb34jwv1s65g6-coreutils-8.32/bin/install -c -m 644 ./CHANGES ./INSTALL ./README /nix/store/5qdhnarjk4pdh50v3g6k1fklwq9kpfms-readline-6.3p08-x86_64-unknown-linux-musl-doc/share/doc/readline
( if test -d doc ; then \
        cd doc && \
        make  infodir=/nix/store/6x2p5zbylgczzh3rv75ljkykl2f1hhc7-readline-6.3p08-x86_64-unknown-linux-musl-info/share/info DESTDIR= install; \
  fi )
make[1]: Entering directory '/build/readline-6.3/doc'
/nix/store/1flh34xxg9q3fpc88xyp2qynxpkfg8py-bash-4.4-p23/bin/bash ../support/mkdirs /nix/store/6x2p5zbylgczzh3rv75ljkykl2f1hhc7-readline-6.3p08-x86_64-unknown-linux-musl-info/share/info /nix/store/5m8pkkdk2mcn4qkbbnrlflanyrawjvbp-readline-6.3p08-x86_64-unknown-linux-musl-man/share/man/man3
if test -n "" ; then \
        /nix/store/1flh34xxg9q3fpc88xyp2qynxpkfg8py-bash-4.4-p23/bin/bash ../support/mkdirs  ; \
fi
if test -f readline.info; then \
        /nix/store/lglxa6zjxag1dy0d0lygb34jwv1s65g6-coreutils-8.32/bin/install -c -m 644 readline.info /nix/store/6x2p5zbylgczzh3rv75ljkykl2f1hhc7-readline-6.3p08-x86_64-unknown-linux-musl-info/share/info/readline.info; \
else \
        /nix/store/lglxa6zjxag1dy0d0lygb34jwv1s65g6-coreutils-8.32/bin/install -c -m 644 ./readline.info /nix/store/6x2p5zbylgczzh3rv75ljkykl2f1hhc7-readline-6.3p08-x86_64-unknown-linux-musl-info/share/info/readline.info; \
fi
if test -f rluserman.info; then \
        /nix/store/lglxa6zjxag1dy0d0lygb34jwv1s65g6-coreutils-8.32/bin/install -c -m 644 rluserman.info /nix/store/6x2p5zbylgczzh3rv75ljkykl2f1hhc7-readline-6.3p08-x86_64-unknown-linux-musl-info/share/info/rluserman.info; \
else \
        /nix/store/lglxa6zjxag1dy0d0lygb34jwv1s65g6-coreutils-8.32/bin/install -c -m 644 ./rluserman.info /nix/store/6x2p5zbylgczzh3rv75ljkykl2f1hhc7-readline-6.3p08-x86_64-unknown-linux-musl-info/share/info/rluserman.info; \
fi
if test -f history.info; then \
        /nix/store/lglxa6zjxag1dy0d0lygb34jwv1s65g6-coreutils-8.32/bin/install -c -m 644 history.info /nix/store/6x2p5zbylgczzh3rv75ljkykl2f1hhc7-readline-6.3p08-x86_64-unknown-linux-musl-info/share/info/history.info; \
else \
        /nix/store/lglxa6zjxag1dy0d0lygb34jwv1s65g6-coreutils-8.32/bin/install -c -m 644 ./history.info /nix/store/6x2p5zbylgczzh3rv75ljkykl2f1hhc7-readline-6.3p08-x86_64-unknown-linux-musl-info/share/info/history.info; \
fi
if /nix/store/1flh34xxg9q3fpc88xyp2qynxpkfg8py-bash-4.4-p23/bin/bash -c 'install-info --version' >/dev/null 2>&1; then \
        install-info --dir-file=/nix/store/6x2p5zbylgczzh3rv75ljkykl2f1hhc7-readline-6.3p08-x86_64-unknown-linux-musl-info/share/info/dir \
                /nix/store/6x2p5zbylgczzh3rv75ljkykl2f1hhc7-readline-6.3p08-x86_64-unknown-linux-musl-info/share/info/readline.info ; \
        install-info --dir-file=/nix/store/6x2p5zbylgczzh3rv75ljkykl2f1hhc7-readline-6.3p08-x86_64-unknown-linux-musl-info/share/info/dir \
                /nix/store/6x2p5zbylgczzh3rv75ljkykl2f1hhc7-readline-6.3p08-x86_64-unknown-linux-musl-info/share/info/history.info ; \
        install-info --dir-file=/nix/store/6x2p5zbylgczzh3rv75ljkykl2f1hhc7-readline-6.3p08-x86_64-unknown-linux-musl-info/share/info/dir \
                /nix/store/6x2p5zbylgczzh3rv75ljkykl2f1hhc7-readline-6.3p08-x86_64-unknown-linux-musl-info/share/info/rluserman.info ; \
else true; fi
/nix/store/lglxa6zjxag1dy0d0lygb34jwv1s65g6-coreutils-8.32/bin/install -c -m 644 ./readline.3 /nix/store/5m8pkkdk2mcn4qkbbnrlflanyrawjvbp-readline-6.3p08-x86_64-unknown-linux-musl-man/share/man/man3/readline.3
/nix/store/lglxa6zjxag1dy0d0lygb34jwv1s65g6-coreutils-8.32/bin/install -c -m 644 ./history.3 /nix/store/5m8pkkdk2mcn4qkbbnrlflanyrawjvbp-readline-6.3p08-x86_64-unknown-linux-musl-man/share/man/man3/history.3
if test -n "" ; then \
        if test -f readline.html; then \
                /nix/store/lglxa6zjxag1dy0d0lygb34jwv1s65g6-coreutils-8.32/bin/install -c -m 644 readline.html /readline.html; \
        else \
                /nix/store/lglxa6zjxag1dy0d0lygb34jwv1s65g6-coreutils-8.32/bin/install -c -m 644 ./readline.html /readline.html; \
        fi ; \
        if test -f history.html; then \
                /nix/store/lglxa6zjxag1dy0d0lygb34jwv1s65g6-coreutils-8.32/bin/install -c -m 644 history.html /history.html; \
        else \
                /nix/store/lglxa6zjxag1dy0d0lygb34jwv1s65g6-coreutils-8.32/bin/install -c -m 644 ./history.html /history.html; \
        fi ; \
        if test -f rluserman.html; then \
                /nix/store/lglxa6zjxag1dy0d0lygb34jwv1s65g6-coreutils-8.32/bin/install -c -m 644 rluserman.html /rluserman.html; \
        else \
                /nix/store/lglxa6zjxag1dy0d0lygb34jwv1s65g6-coreutils-8.32/bin/install -c -m 644 ./rluserman.html /rluserman.html; \
        fi ; \
fi
make[1]: Leaving directory '/build/readline-6.3/doc'
( cd examples ; make  DESTDIR= install )
make[1]: Entering directory '/build/readline-6.3/examples'
/nix/store/1flh34xxg9q3fpc88xyp2qynxpkfg8py-bash-4.4-p23/bin/bash ../support/mkdirs /nix/store/x1y6syhvyg08nqnbasw0kf6x1971y7hb-readline-6.3p08-x86_64-unknown-linux-musl/share/readline
mkdir /nix/store/x1y6syhvyg08nqnbasw0kf6x1971y7hb-readline-6.3p08-x86_64-unknown-linux-musl/share
mkdir /nix/store/x1y6syhvyg08nqnbasw0kf6x1971y7hb-readline-6.3p08-x86_64-unknown-linux-musl/share/readline
make[1]: Leaving directory '/build/readline-6.3/examples'
mv /nix/store/x1y6syhvyg08nqnbasw0kf6x1971y7hb-readline-6.3p08-x86_64-unknown-linux-musl/lib/libreadline.a /nix/store/x1y6syhvyg08nqnbasw0kf6x1971y7hb-readline-6.3p08-x86_64-unknown-linux-musl/lib/libreadline.old
mv: cannot stat '/nix/store/x1y6syhvyg08nqnbasw0kf6x1971y7hb-readline-6.3p08-x86_64-unknown-linux-musl/lib/libreadline.a': No such file or directory
make: [Makefile:238: install-static] Error 1 (ignored)
/nix/store/lglxa6zjxag1dy0d0lygb34jwv1s65g6-coreutils-8.32/bin/install -c -m 644 libreadline.a /nix/store/x1y6syhvyg08nqnbasw0kf6x1971y7hb-readline-6.3p08-x86_64-unknown-linux-musl/lib/libreadline.a
test -n "x86_64-unknown-linux-musl-ranlib" && x86_64-unknown-linux-musl-ranlib /nix/store/x1y6syhvyg08nqnbasw0kf6x1971y7hb-readline-6.3p08-x86_64-unknown-linux-musl/lib/libreadline.a
mv /nix/store/x1y6syhvyg08nqnbasw0kf6x1971y7hb-readline-6.3p08-x86_64-unknown-linux-musl/lib/libhistory.a /nix/store/x1y6syhvyg08nqnbasw0kf6x1971y7hb-readline-6.3p08-x86_64-unknown-linux-musl/lib/libhistory.old
mv: cannot stat '/nix/store/x1y6syhvyg08nqnbasw0kf6x1971y7hb-readline-6.3p08-x86_64-unknown-linux-musl/lib/libhistory.a': No such file or directory
make: [Makefile:241: install-static] Error 1 (ignored)
/nix/store/lglxa6zjxag1dy0d0lygb34jwv1s65g6-coreutils-8.32/bin/install -c -m 644 libhistory.a /nix/store/x1y6syhvyg08nqnbasw0kf6x1971y7hb-readline-6.3p08-x86_64-unknown-linux-musl/lib/libhistory.a
test -n "x86_64-unknown-linux-musl-ranlib" && x86_64-unknown-linux-musl-ranlib /nix/store/x1y6syhvyg08nqnbasw0kf6x1971y7hb-readline-6.3p08-x86_64-unknown-linux-musl/lib/libhistory.a
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/x1y6syhvyg08nqnbasw0kf6x1971y7hb-readline-6.3p08-x86_64-unknown-linux-musl
x86_64-unknown-linux-musl-strip is /nix/store/4b58ai4pnl1vxixv4mrp7w8bazi24f99-x86_64-unknown-linux-musl-binutils-2.35.1/bin/x86_64-unknown-linux-musl-strip
stripping (with command x86_64-unknown-linux-musl-strip and flags -S) in /nix/store/x1y6syhvyg08nqnbasw0kf6x1971y7hb-readline-6.3p08-x86_64-unknown-linux-musl/lib
patching script interpreter paths in /nix/store/x1y6syhvyg08nqnbasw0kf6x1971y7hb-readline-6.3p08-x86_64-unknown-linux-musl
checking for references to /build/ in /nix/store/x1y6syhvyg08nqnbasw0kf6x1971y7hb-readline-6.3p08-x86_64-unknown-linux-musl...
shrinking RPATHs of ELF executables and libraries in /nix/store/0dsbfdavyjxj2zdj1hrpjyd6sgvxxm2k-readline-6.3p08-x86_64-unknown-linux-musl-dev
x86_64-unknown-linux-musl-strip is /nix/store/4b58ai4pnl1vxixv4mrp7w8bazi24f99-x86_64-unknown-linux-musl-binutils-2.35.1/bin/x86_64-unknown-linux-musl-strip
patching script interpreter paths in /nix/store/0dsbfdavyjxj2zdj1hrpjyd6sgvxxm2k-readline-6.3p08-x86_64-unknown-linux-musl-dev
checking for references to /build/ in /nix/store/0dsbfdavyjxj2zdj1hrpjyd6sgvxxm2k-readline-6.3p08-x86_64-unknown-linux-musl-dev...
shrinking RPATHs of ELF executables and libraries in /nix/store/5m8pkkdk2mcn4qkbbnrlflanyrawjvbp-readline-6.3p08-x86_64-unknown-linux-musl-man
gzipping man pages under /nix/store/5m8pkkdk2mcn4qkbbnrlflanyrawjvbp-readline-6.3p08-x86_64-unknown-linux-musl-man/share/man/
x86_64-unknown-linux-musl-strip is /nix/store/4b58ai4pnl1vxixv4mrp7w8bazi24f99-x86_64-unknown-linux-musl-binutils-2.35.1/bin/x86_64-unknown-linux-musl-strip
patching script interpreter paths in /nix/store/5m8pkkdk2mcn4qkbbnrlflanyrawjvbp-readline-6.3p08-x86_64-unknown-linux-musl-man
checking for references to /build/ in /nix/store/5m8pkkdk2mcn4qkbbnrlflanyrawjvbp-readline-6.3p08-x86_64-unknown-linux-musl-man...
shrinking RPATHs of ELF executables and libraries in /nix/store/5qdhnarjk4pdh50v3g6k1fklwq9kpfms-readline-6.3p08-x86_64-unknown-linux-musl-doc
x86_64-unknown-linux-musl-strip is /nix/store/4b58ai4pnl1vxixv4mrp7w8bazi24f99-x86_64-unknown-linux-musl-binutils-2.35.1/bin/x86_64-unknown-linux-musl-strip
patching script interpreter paths in /nix/store/5qdhnarjk4pdh50v3g6k1fklwq9kpfms-readline-6.3p08-x86_64-unknown-linux-musl-doc
checking for references to /build/ in /nix/store/5qdhnarjk4pdh50v3g6k1fklwq9kpfms-readline-6.3p08-x86_64-unknown-linux-musl-doc...
shrinking RPATHs of ELF executables and libraries in /nix/store/6x2p5zbylgczzh3rv75ljkykl2f1hhc7-readline-6.3p08-x86_64-unknown-linux-musl-info
x86_64-unknown-linux-musl-strip is /nix/store/4b58ai4pnl1vxixv4mrp7w8bazi24f99-x86_64-unknown-linux-musl-binutils-2.35.1/bin/x86_64-unknown-linux-musl-strip
patching script interpreter paths in /nix/store/6x2p5zbylgczzh3rv75ljkykl2f1hhc7-readline-6.3p08-x86_64-unknown-linux-musl-info
checking for references to /build/ in /nix/store/6x2p5zbylgczzh3rv75ljkykl2f1hhc7-readline-6.3p08-x86_64-unknown-linux-musl-info...
copying 5 paths...
copying path '/nix/store/x1y6syhvyg08nqnbasw0kf6x1971y7hb-readline-6.3p08-x86_64-unknown-linux-musl' from 'ssh-ng://nix@nardole.r'...
copying path '/nix/store/0dsbfdavyjxj2zdj1hrpjyd6sgvxxm2k-readline-6.3p08-x86_64-unknown-linux-musl-dev' from 'ssh-ng://nix@nardole.r'...
copying path '/nix/store/5m8pkkdk2mcn4qkbbnrlflanyrawjvbp-readline-6.3p08-x86_64-unknown-linux-musl-man' from 'ssh-ng://nix@nardole.r'...
copying path '/nix/store/5qdhnarjk4pdh50v3g6k1fklwq9kpfms-readline-6.3p08-x86_64-unknown-linux-musl-doc' from 'ssh-ng://nix@nardole.r'...
copying path '/nix/store/6x2p5zbylgczzh3rv75ljkykl2f1hhc7-readline-6.3p08-x86_64-unknown-linux-musl-info' from 'ssh-ng://nix@nardole.r'...
building '/nix/store/j06qggfsxm9xrh48maxpfy3c4f1z55ms-lua-static-x86_64-unknown-linux-musl-5.2.4.drv' on 'ssh-ng://nix@nardole.r'...
copying 1 paths...
copying path '/nix/store/4fyvynv4i11705q0v4v67239ffdhfb1x-lua-setup-hook.sh' to 'ssh-ng://nix@nardole.r'...
building '/nix/store/j06qggfsxm9xrh48maxpfy3c4f1z55ms-lua-static-x86_64-unknown-linux-musl-5.2.4.drv'...
unpacking sources
unpacking source archive /nix/store/4swz1aly58ych4x1b14g7p4w37avn2si-lua-5.2.4.tar.gz
source root is lua-5.2.4
setting SOURCE_DATE_EPOCH to timestamp 1424910717 of file lua-5.2.4/README
patching sources
updateAutotoolsGnuConfigScriptsPhase
configuring
building
build flags: SHELL=/nix/store/1flh34xxg9q3fpc88xyp2qynxpkfg8py-bash-4.4-p23/bin/bash INSTALL_TOP=/nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4 INSTALL_MAN=/nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4/share/man/man1 R=5.2.4 LDFLAGS=-fPIC V=5.2 PLAT=linux CC=x86_64-unknown-linux-musl-cc RANLIB=x86_64-unknown-linux-musl-ranlib MYLIBS=-lncurses CFLAGS=-O2\ -fPIC\ -DLUA_COMPAT_ALL\ \$\(SYSCFLAGS\) AR=x86_64-unknown-linux-musl-ar\ rcu
cd src && make linux
make[1]: Entering directory '/build/lua-5.2.4/src'
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
make[2]: Entering directory '/build/lua-5.2.4/src'
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lapi.o lapi.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lcode.o lcode.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lctype.o lctype.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o ldebug.o ldebug.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o ldo.o ldo.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o ldump.o ldump.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lfunc.o lfunc.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lgc.o lgc.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o llex.o llex.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lmem.o lmem.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lobject.o lobject.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lopcodes.o lopcodes.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lparser.o lparser.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lstate.o lstate.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lstring.o lstring.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o ltable.o ltable.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o ltm.o ltm.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lundump.o lundump.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lvm.o lvm.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lzio.o lzio.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lauxlib.o lauxlib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lbaselib.o lbaselib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lbitlib.o lbitlib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lcorolib.o lcorolib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o ldblib.o ldblib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o liolib.o liolib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lmathlib.o lmathlib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o loslib.o loslib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lstrlib.o lstrlib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o ltablib.o ltablib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o loadlib.o loadlib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o linit.o linit.c
x86_64-unknown-linux-musl-ar rcu liblua.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o lmathlib.o loslib.o lstrlib.o ltablib.o loadlib.o linit.o
x86_64-unknown-linux-musl-ar: `u' modifier ignored since `D' is the default (see `U')
x86_64-unknown-linux-musl-ranlib liblua.a
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lua.o lua.c
x86_64-unknown-linux-musl-cc -o lua -fPIC lua.o liblua.a -lm -Wl,-E -ldl -lreadline -lncurses
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o luac.o luac.c
x86_64-unknown-linux-musl-cc -o luac -fPIC luac.o liblua.a -lm -Wl,-E -ldl -lreadline -lncurses
make[2]: Leaving directory '/build/lua-5.2.4/src'
make[1]: Leaving directory '/build/lua-5.2.4/src'
installing
install flags: SHELL=/nix/store/1flh34xxg9q3fpc88xyp2qynxpkfg8py-bash-4.4-p23/bin/bash INSTALL_TOP=/nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4 INSTALL_MAN=/nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4/share/man/man1 R=5.2.4 LDFLAGS=-fPIC V=5.2 PLAT=linux CC=x86_64-unknown-linux-musl-cc RANLIB=x86_64-unknown-linux-musl-ranlib MYLIBS=-lncurses CFLAGS=-O2\ -fPIC\ -DLUA_COMPAT_ALL\ \$\(SYSCFLAGS\) AR=x86_64-unknown-linux-musl-ar\ rcu TO_BIN=lua\ luac INSTALL_DATA=cp\ -d TO_LIB=liblua.a install
cd src && mkdir -p /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4/bin /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4/include /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4/lib /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4/share/man/man1 /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4/share/lua/5.2 /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4/lib/lua/5.2
cd src && install -p -m 0755 lua luac /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4/bin
cd src && cp -d lua.h luaconf.h lualib.h lauxlib.h lua.hpp /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4/include
cd src && cp -d liblua.a /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4/lib
cd doc && cp -d lua.1 luac.1 /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4/share/man/man1
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4
shrinking /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4/bin/luac
patchelf: cannot find section '.dynamic'. The input file is most likely statically linked
shrinking /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4/bin/lua
patchelf: cannot find section '.dynamic'. The input file is most likely statically linked
rewriting symlink /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4/lib/pkgconfig/lua5.2.pc to be relative to /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4
rewriting symlink /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4/lib/pkgconfig/lua52.pc to be relative to /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4
rewriting symlink /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4/lib/pkgconfig/lua-5.2.pc to be relative to /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4
gzipping man pages under /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4/share/man/
x86_64-unknown-linux-musl-strip is /nix/store/4b58ai4pnl1vxixv4mrp7w8bazi24f99-x86_64-unknown-linux-musl-binutils-2.35.1/bin/x86_64-unknown-linux-musl-strip
stripping (with command x86_64-unknown-linux-musl-strip and flags -S) in /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4/lib  /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4/bin
patching script interpreter paths in /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4
checking for references to /build/ in /nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4...
patchelf: cannot find section '.dynamic'. The input file is most likely statically linked
patchelf: cannot find section '.dynamic'. The input file is most likely statically linked
copying 1 paths...
copying path '/nix/store/xb997q2a0qpwjrdrq3aihm7ma9y6a1rw-lua-static-x86_64-unknown-linux-musl-5.2.4' from 'ssh-ng://nix@nardole.r'...
building '/nix/store/9jyigqknc3yrjr01lwfz3m46q93l3zvr-redis-static-x86_64-unknown-linux-musl-6.2.5.drv' on 'ssh-ng://nix@nardole.r'...
copying path '/nix/store/8hsch56wx002rfdpklawybgrnc1l8swq-openssl-static-x86_64-unknown-linux-musl-1.1.1l' from 'https://cache.nixos.org'...
copying path '/nix/store/6y53r9szlilw6lb0qqb3c973fk5868k5-redis-6.2.5.tar.gz' from 'https://cache.nixos.org'...
copying path '/nix/store/vaysl3f5kzpkddxvwssw6al24nw3wxa8-x86_64-unknown-linux-musl-pkg-config-wrapper-0.29.2' from 'https://cache.nixos.org'...
copying path '/nix/store/hpzqzr2wxdd4dsa297r2j4sgyzsia84x-openssl-static-x86_64-unknown-linux-musl-1.1.1l-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/bf0mlbqhb26gsxcdp3jgib5awwdjyg5y-openssl-static-x86_64-unknown-linux-musl-1.1.1l-dev' from 'https://cache.nixos.org'...
copying 0 paths...
building '/nix/store/9jyigqknc3yrjr01lwfz3m46q93l3zvr-redis-static-x86_64-unknown-linux-musl-6.2.5.drv'...
unpacking sources
unpacking source archive /nix/store/6y53r9szlilw6lb0qqb3c973fk5868k5-redis-6.2.5.tar.gz
source root is redis-6.2.5
...
    CC geohash.o
    CC geohash_helper.o
    CC childinfo.o
    CC defrag.o
    CC siphash.o
    CC rax.o
    CC t_stream.o
    CC listpack.o
    CC localtime.o
    CC lolwut.o
    CC lolwut5.o
    CC lolwut6.o
    CC acl.o
    CC gopher.o
    CC tracking.o
    CC connection.o
    CC tls.o
    CC sha256.o
    CC timeout.o
    CC setcpuaffinity.o
    CC monotonic.o
    CC mt19937-64.o
    CC redis-cli.o
    CC cli_common.o
    CC redis-benchmark.o
    LINK redis-benchmark
x86_64-unknown-linux-musl-gcc: error: ../deps/hiredis/libhiredis.a: No such file or directory
x86_64-unknown-linux-musl-gcc: error: ../deps/hiredis/libhiredis_ssl.a: No such file or directory
make[1]: *** [Makefile:359: redis-benchmark] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/build/redis-6.2.5/src'
make: *** [Makefile:6: all] Error 2
error: build of '/nix/store/9jyigqknc3yrjr01lwfz3m46q93l3zvr-redis-static-x86_64-unknown-linux-musl-6.2.5.drv' on 'ssh-ng://nix@nardole.r' failed: error: builder for '/nix/store/9jyigqknc3yrjr01lwfz3m46q93l3zvr-redis-static-x86_64-unknown-linux-musl-6.2.5.drv' failed with exit code 2;
              last 10 log lines:
              >     CC redis-cli.o
              >     CC cli_common.o
              >     CC redis-benchmark.o
              >     LINK redis-benchmark
              > x86_64-unknown-linux-musl-gcc: error: ../deps/hiredis/libhiredis.a: No such file or directory
              > x86_64-unknown-linux-musl-gcc: error: ../deps/hiredis/libhiredis_ssl.a: No such file or directory
              > make[1]: *** [Makefile:359: redis-benchmark] Error 1
              > make[1]: *** Waiting for unfinished jobs....
              > make[1]: Leaving directory '/build/redis-6.2.5/src'
              > make: *** [Makefile:6: all] Error 2
              For full logs, run 'nix log /nix/store/9jyigqknc3yrjr01lwfz3m46q93l3zvr-redis-static-x86_64-unknown-linux-musl-6.2.5.drv'.

But it might be a lot easier to fix it this way.

1 Like

pkgsStatic.redis build is fixed here: pkgsStatic.redis: fix build by Mic92 · Pull Request #138961 · NixOS/nixpkgs · GitHub

2 Likes

Thank you for your reply @Mic92

Please can you help and provide an example or documentation link on how to use pkgsStatic?

I am not aware of documentation. It’s an overlay over nixpkgs that enables static compilation.
So if you want the static version of the hello version you write pkgsStatic.hello instead of just hello. All packages in nixpkgs are also available through the pkgsStatic attribute set.

I tried to use redis = pkgs.pkgsStatic.redis.overrideAttrs (old: {

But encountered compilation error.

nix-build  redis-multi-mini.nix                                                                             23.9s
these 8 derivations will be built:
  /nix/store/05h09k0idi02y7hwcissgmv51nyfcgbw-lua-static-x86_64-unknown-linux-musl-5.2.4.drv
  /nix/store/9bwvz5pvhl8dj8wn6f5n5dfbjlaxzgwk-redis-static-x86_64-unknown-linux-musl-6.2.5.drv
  /nix/store/9pk6lkj3s92mqka5g2rdfsr4dy0q6hmd-nix-redis-layered-minimal-customisation-layer.drv
  /nix/store/yjzfnsgislpdapq8nvxr1rw4is5rimkw-closure.drv
  /nix/store/briwc2wjf78h2x12qa8mk17cizdzwsp7-closure-paths.drv
  /nix/store/ry8ain1gi4070a98bddshgkcnwwc0b6p-nix-redis-layered-minimal-conf.json.drv
  /nix/store/j4k9infvgsyvh6g4cmrnas7252jgcs35-stream-nix-redis-layered-minimal.drv
  /nix/store/fbcip7g5gjszazv1mb10gb5z4pr48z5k-nix-redis-layered-minimal.tar.gz.drv
building '/nix/store/05h09k0idi02y7hwcissgmv51nyfcgbw-lua-static-x86_64-unknown-linux-musl-5.2.4.drv'...
unpacking sources
unpacking source archive /nix/store/4swz1aly58ych4x1b14g7p4w37avn2si-lua-5.2.4.tar.gz
source root is lua-5.2.4
setting SOURCE_DATE_EPOCH to timestamp 1424910717 of file lua-5.2.4/README
patching sources
updateAutotoolsGnuConfigScriptsPhase
configuring
building
build flags: SHELL=/nix/store/wv35g5lff84rray15zlzarcqi9fxzz84-bash-4.4-p23/bin/bash INSTALL_TOP=/nix/store/cg09c6g4gqr67kgml6w98lniz68qshkd-lua-static-x86_64-unknown-linux-musl-5.2.4 INSTALL_MAN=/nix/store/cg09c6g4gqr67kgml6w98lniz68qshkd-lua-static-x86_64-unknown-linux-musl-5.2.4/share/man/man1 R=5.2.4 LDFLAGS=-fPIC V=5.2 PLAT=linux CC=x86_64-unknown-linux-musl-cc RANLIB=x86_64-unknown-linux-musl-ranlib CFLAGS=-O2\ -fPIC\ -DLUA_COMPAT_ALL\ \$\(SYSCFLAGS\) AR=x86_64-unknown-linux-musl-ar\ rcu
cd src && make linux
make[1]: Entering directory '/build/lua-5.2.4/src'
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
make[2]: Entering directory '/build/lua-5.2.4/src'
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lapi.o lapi.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lcode.o lcode.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lctype.o lctype.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o ldebug.o ldebug.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o ldo.o ldo.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o ldump.o ldump.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lfunc.o lfunc.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lgc.o lgc.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o llex.o llex.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lmem.o lmem.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lobject.o lobject.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lopcodes.o lopcodes.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lparser.o lparser.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lstate.o lstate.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lstring.o lstring.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o ltable.o ltable.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o ltm.o ltm.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lundump.o lundump.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lvm.o lvm.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lzio.o lzio.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lauxlib.o lauxlib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lbaselib.o lbaselib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lbitlib.o lbitlib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lcorolib.o lcorolib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o ldblib.o ldblib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o liolib.o liolib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lmathlib.o lmathlib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o loslib.o loslib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o lstrlib.o lstrlib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o ltablib.o ltablib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o loadlib.o loadlib.c
x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o linit.o linit.c
x86_64-unknown-linux-musl-cc -shared -lm -Wl,-E -ldl -lreadline  -Wl,-soname,liblua.so.5.2 -o liblua.so.5.2.4 lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o lmathlib.o loslib.o lstrlib.o ltablib.o loadlib.o linit.o 
/nix/store/a1l57qpyyr8rpxxk26lldv42fcjvps6h-x86_64-unknown-linux-musl-binutils-2.35.1/bin/x86_64-unknown-linux-musl-ld: /nix/store/ifl55k2a5ngxgah3fr8isf8xgad09jlw-x86_64-unknown-linux-musl-stage-final-gcc-10.3.0/lib/gcc/x86_64-unknown-linux-musl/10.3.0/crtbeginT.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a shared object
/nix/store/a1l57qpyyr8rpxxk26lldv42fcjvps6h-x86_64-unknown-linux-musl-binutils-2.35.1/bin/x86_64-unknown-linux-musl-ld: /nix/store/ifl55k2a5ngxgah3fr8isf8xgad09jlw-x86_64-unknown-linux-musl-stage-final-gcc-10.3.0/lib/gcc/x86_64-unknown-linux-musl/10.3.0/crtend.o: relocation R_X86_64_32 against `.ctors' can not be used when making a shared object; recompile with -fPIC
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:189: liblua.so] Error 1
make[2]: Leaving directory '/build/lua-5.2.4/src'
make[1]: *** [Makefile:106: linux] Error 2
make[1]: Leaving directory '/build/lua-5.2.4/src'
make: *** [Makefile:55: linux] Error 2
error: builder for '/nix/store/05h09k0idi02y7hwcissgmv51nyfcgbw-lua-static-x86_64-unknown-linux-musl-5.2.4.drv' failed with exit code 2;
       last 10 log lines:
       > x86_64-unknown-linux-musl-cc -O2 -fPIC -DLUA_COMPAT_ALL -DLUA_USE_LINUX   -c -o linit.o linit.c
       > x86_64-unknown-linux-musl-cc -shared -lm -Wl,-E -ldl -lreadline  -Wl,-soname,liblua.so.5.2 -o liblua.so.5.2.4 lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o lmathlib.o loslib.o lstrlib.o ltablib.o loadlib.o linit.o
       > /nix/store/a1l57qpyyr8rpxxk26lldv42fcjvps6h-x86_64-unknown-linux-musl-binutils-2.35.1/bin/x86_64-unknown-linux-musl-ld: /nix/store/ifl55k2a5ngxgah3fr8isf8xgad09jlw-x86_64-unknown-linux-musl-stage-final-gcc-10.3.0/lib/gcc/x86_64-unknown-linux-musl/10.3.0/crtbeginT.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a shared object
       > /nix/store/a1l57qpyyr8rpxxk26lldv42fcjvps6h-x86_64-unknown-linux-musl-binutils-2.35.1/bin/x86_64-unknown-linux-musl-ld: /nix/store/ifl55k2a5ngxgah3fr8isf8xgad09jlw-x86_64-unknown-linux-musl-stage-final-gcc-10.3.0/lib/gcc/x86_64-unknown-linux-musl/10.3.0/crtend.o: relocation R_X86_64_32 against `.ctors' can not be used when making a shared object; recompile with -fPIC
       > collect2: error: ld returned 1 exit status
       > make[2]: *** [Makefile:189: liblua.so] Error 1
       > make[2]: Leaving directory '/build/lua-5.2.4/src'
       > make[1]: *** [Makefile:106: linux] Error 2
       > make[1]: Leaving directory '/build/lua-5.2.4/src'
       > make: *** [Makefile:55: linux] Error 2
       For full logs, run 'nix log /nix/store/05h09k0idi02y7hwcissgmv51nyfcgbw-lua-static-x86_64-unknown-linux-musl-5.2.4.drv'.
error: 1 dependencies of derivation '/nix/store/9bwvz5pvhl8dj8wn6f5n5dfbjlaxzgwk-redis-static-x86_64-unknown-linux-musl-6.2.5.drv' failed to build
error: 1 dependencies of derivation '/nix/store/yjzfnsgislpdapq8nvxr1rw4is5rimkw-closure.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ry8ain1gi4070a98bddshgkcnwwc0b6p-nix-redis-layered-minimal-conf.json.drv' failed to build
error: 1 dependencies of derivation '/nix/store/j4k9infvgsyvh6g4cmrnas7252jgcs35-stream-nix-redis-layered-minimal.drv' failed to build
error: 1 dependencies of derivation '/nix/store/fbcip7g5gjszazv1mb10gb5z4pr48z5k-nix-redis-layered-minimal.tar.gz.drv' failed to build

I am not really sure what your override looks like and what nixpkgs version you use, but since I recently just fixed the static build make sure you use a commit that already has my fix.
This nixpkgs revision works on my machine:

$  nix-build -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/5cdf7377c1af74b3a609fd8e523707b488250070.tar.gz '<nixpkgs>' -A pkgsStatic.redis