nix-pills icon indicating copy to clipboard operation
nix-pills copied to clipboard

Nix Pill 8.1 fails on Darwin

Open pasunboneleve opened this issue 7 years ago • 4 comments

8.1. Packaging GNU hello world

I've seen mentioned before that gcc doesn't work on Darwin... Still, it is a reasonable ask that Nix Pills should allow people to get acquainted with the Nix package manager on Darwin.

This might be related to #75.

checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/private/var/folders/2h/5_69bnz57rj50vsx7_51th700000gn/T/nix-build-hello.drv-0/hello-2.10':
configure: error: C compiler cannot create executables
See `config.log' for more details
There seems to be no Makefile in this directory.
You must run ./configure before running 'make'.
make: *** [GNUmakefile:108: abort-due-to-no-makefile] Error 1
There seems to be no Makefile in this directory.
You must run ./configure before running 'make'.
make: *** [GNUmakefile:108: abort-due-to-no-makefile] Error 1
builder for '/nix/store/i7x2hhz5q85qrqq1p7n4kqhbh3n34i0r-hello.drv' failed with exit code 2
error: build of '/nix/store/i7x2hhz5q85qrqq1p7n4kqhbh3n34i0r-hello.drv' failed

pasunboneleve avatar Aug 20 '18 12:08 pasunboneleve

same problem. I will close #88

cmal avatar Nov 15 '18 06:11 cmal

and the autotools version also failed:

$ nix-build hello.nix
these derivations will be built:
  /nix/store/d84l57agx3rmw00lxs8gjlw8srmx1bh9-hello.drv
building '/nix/store/d84l57agx3rmw00lxs8gjlw8srmx1bh9-hello.drv'...
/nix/store/vv3xqdggviqqbvym25jf2pwv575y9j1r-builder.sh: line 7: tar: No such file or directory
builder for '/nix/store/d84l57agx3rmw00lxs8gjlw8srmx1bh9-hello.drv' failed with exit code 127
error: build of '/nix/store/d84l57agx3rmw00lxs8gjlw8srmx1bh9-hello.drv' failed

cmal avatar Nov 15 '18 06:11 cmal

There is a note about hello.nix that is adapted for Darwin but for some reason the code is missing. In a locally built version of the pills the example is present though, so looks like the HTML that ends up on nixos.org is somehow processed?

liff avatar Dec 11 '18 16:12 liff

I'm not an autoconf expert, so just following along here. However, this is what the tutorial currently suggests:

https://github.com/NixOS/nix-pills/blob/d745db6a41075939c316f82648cfec9c92dd0c95/pills/08/hello-nix-darwin.txt#L8

if we change that to:

bintools = clang.bintools.bintools_bin; 

it compiles (and runs) fine for me. 👍

dfee avatar Nov 07 '22 00:11 dfee