Any secret way to make viewing config.log easier?

When attempting to build packages, I’ll sometimes get a ‘config.log’ message.

$ `NIXPKGS_ALLOW_UNFREE=1 nix build nixpkgs.pkgsCross.iphone64-simulator.hello
builder for '/nix/store/p8m5wmf3wy1piq2k5r33c74vyablnhpz-hello-2.10-x86_64-apple-ios.drv' failed with exit code 77; last 10 log lines:
  checking for x86_64-apple-ios-strip... x86_64-apple-ios-strip
  checking for a thread-safe mkdir -p... /nix/store/la203av8kn0ys79yykjbwkiip7li95c1-coreutils-8.32/bin/mkdir -p
  checking for gawk... gawk
  checking whether make sets $(MAKE)... yes
  checking whether make supports nested variables... yes
  checking for x86_64-apple-ios-gcc... x86_64-apple-ios-clang
  checking whether the C compiler works... no
  configure: error: in `/private/tmp/nix-build-hello-2.10-x86_64-apple-ios.drv-0/hello-2.10':
  configure: error: C compiler cannot create executables
  See `config.log' for more details
[0 built (1 failed)]

I could of course restructure to a nix-build -K command, go to the folder, and view config.log, but I wonder if there’s an easy way to just have it print or copy it someplace? Would make troubleshooting packages a lot easier.

2 Likes

Try nix-store --read-log /nix/store/p8m5wmf3wy1piq2k5r33c74vyablnhpz-hello-2.10-x86_64-apple-ios.drv

See here for what build options tune if this works (try --keep-failed with nix build).

Thanks. That does add what looks like programmatically readable notes on when the phase changes, but unfortunately it doesn’t look like it provides access to the config.log.