NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.97k stars 13.98k forks source link

Cross-compiling redis with armv7l-unknown-linux-gnueabi fails #51517

Closed furrycatherder closed 1 year ago

furrycatherder commented 5 years ago

Issue description

sean@kodenine ~/d/nixbmc> cat default.nix
with import <nixpkgs> {
  crossSystem.config = "armv7l-unknown-linux-gnueabi";
};

callPackage <nixpkgs/nixos/lib/make-squashfs.nix> {
  storeContents = [ redis busybox ];
}

sean@kodenine ~/d/nixbmc> nix build
builder for '/nix/store/zhc824aq2hvgqa54l7mzirv9n1zqdlc5-redis-5.0.1-armv7l-unknown-linux-gnueabi.drv' failed with exit code 2; last 10 log lines:
  make[1]: [Makefile:184: persist-settings] Error 2 (ignored)
      CC adlist.o
  In file included from adlist.c:34:0:
  zmalloc.h:50:10: fatal error: jemalloc/jemalloc.h: No such file or directory
   #include <jemalloc/jemalloc.h>
            ^~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  make[1]: *** [Makefile:232: adlist.o] Error 1
  make[1]: Leaving directory '/build/redis-5.0.1/src'
  make: *** [Makefile:6: all] Error 2
cannot build derivation '/nix/store/prsxb48b7lk947cnrg95fldxpd97m84h-closure-info-armv7l-unknown-linux-gnueabi.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/simacjs7x1iw02dy3508386vv0wq2hgn-squashfs.img-armv7l-unknown-linux-gnueabi.drv': 1 dependencies couldn't be built
[0 built (1 failed)]
error: build of '/nix/store/simacjs7x1iw02dy3508386vv0wq2hgn-squashfs.img-armv7l-unknown-linux-gnueabi.drv' failed

Steps to reproduce

See above default.nix.

Technical details

Mic92 commented 5 years ago

There are several problems, one hiredis it does not find the ar:

https://github.com/redis/hiredis/pull/632

Then redis compiles the Makefile without passing hostcc to the configure flag:

MAKE jemalloc
cd jemalloc && ./configure --with-version=5.1.0-0-g0 --with-lg-quantum=3 --with-jemalloc-prefix=je_ --enable-cc-silence CFLAGS="-std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops " LDFLAGS=""
configure: WARNING: unrecognized options: --enable-cc-silence
checking for xsltproc... false
checking for gcc... aarch64-unknown-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/tmp/nix-build-redis-5.0.1-aarch64-unknown-linux-gnu.drv-0/redis-5.0.1/deps/jemalloc':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
make: *** [Makefile:80: jemalloc] Error 1
Mic92 commented 5 years ago

The AR problem is fixed upstream now, but I have no time too look at the rest. I think they should be all fixable.

vikanezrimaya commented 5 years ago

Should be fixed by #67694, which was written by me and just merged by @matthewbauer :smiley_cat:

stale[bot] commented 4 years ago

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.