Unable to install (compile) Emacs 30.2 nix-darwin

I have in my home.nix

  home.packages = with pkgs; [
    ...
    emacs
    ...
];

and when I darwin-rebuild build --flake ., it gives

warning: Git tree '/Users/amberwing/nix-config' is dirty
error: Cannot build '/nix/store/z1sqm1h5ry2kal3kpqgx2pcf6y0yqhv2-emacs-30.2.drv'.
       Reason: builder failed with exit code 2.
       Output paths:
         /nix/store/dx8yfsy9dm1szrbp93n8yicvrvi8w7db-emacs-30.2
       Last 25 log lines:
       > 20 errors generated.
       > 20 errors generated.
       > make[2]: *** [Makefile:459: nsmenu.o] Error 1
       > make[2]: *** [Makefile:459: nsselect.o] Error 1
       > 20 errors generated.
       > make[2]: *** [Makefile:459: nsimage.o] Error 1
       > 20 errors generated.
       > make[2]: *** [Makefile:459: macfont.o] Error 1
       > 20 errors generated.
       > make[2]: *** [Makefile:459: nsxwidget.o] Error 1
       > make[2]: Leaving directory '/nix/var/nix/builds/nix-18528-1076258433/emacs/src'
       > make[1]: *** [Makefile:554: src] Error 2
       > make[1]: Leaving directory '/nix/var/nix/builds/nix-18528-1076258433/emacs'
       > make[1]: Entering directory '/nix/var/nix/builds/nix-18528-1076258433/emacs'
       > ***
       > *** "make all" failed with exit status 2.
       > ***
       > *** You could try to:
       > *** - run "make bootstrap", which might fix the problem
       > *** - run "make V=1", which displays the full commands invoked by make,
       > ***   to further investigate the problem
       > ***
       > make[1]: *** [Makefile:418: advice-on-failure] Error 2
       > make[1]: Leaving directory '/nix/var/nix/builds/nix-18528-1076258433/emacs'
       > make: *** [Makefile:374: all] Error 2
       For full logs, run:
         nix log /nix/store/z1sqm1h5ry2kal3kpqgx2pcf6y0yqhv2-emacs-30.2.drv
error: Cannot build '/nix/store/cn0qx4xybsigbr1kha7vzgl5v37nvn0c-home-manager-applications.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/lrz2gbl64d6hbxa67w55pbcisbaaavl8-home-manager-applications
error: Cannot build '/nix/store/xcffj74b80gnxfk2jifxk3fpqpqz9k6b-home-manager-fonts.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/h9dchvwkwmrqmh58z22kcnlsp3xfyx50-home-manager-fonts
error: Cannot build '/nix/store/q5hq9cj96x5vgdjp2n93ybpk1mkm6ir9-home-manager-path.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/409v4afyx21sbzka0f3j6kcl5j1f5442-home-manager-path
error: Build failed due to failed dependency
error: Build failed due to failed dependency
error: Build failed due to failed dependency
error: Cannot build '/nix/store/hz1jl260swba9nh1brjkjac1mr9kr4i4-activation-script.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/9d14vhlzffg1jylqysrjs1ff88a3f63c-activation-script
error: Cannot build '/nix/store/d9a3myzb4zcbf1lp8k30j8ba6ilvpvji-hm_LibraryFonts.homemanagerfontsversion.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/258bzvpmz8ci72akg6jiij0jc0bgzs4g-hm_LibraryFonts.homemanagerfontsversion
error: Cannot build '/nix/store/6qxw1rwspbw6sid55jhs68zd244n980v-home-manager-generation.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/8x9dnyg38daa4xqdjxzaxl81r7qmpixd-home-manager-generation
error: Cannot build '/nix/store/rcf1py09xb4xp19cn5jps5l0jpnlhlqg-user-environment.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/s3635zjg620rpj334vz9vzfaijbi8gps-user-environment
error: Build failed due to failed dependency
error: Build failed due to failed dependency
error: Cannot build '/nix/store/4grj29bh9xf8ggrpwfdf9mrfv08qln2w-activation-amberwing.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/yc6wm6n9zz0w0q6n9k17nl2fmnrmglby-activation-amberwing
error: Cannot build '/nix/store/x07vchm1z5jb2bv0a9ssk7cx4366p58w-etc.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/gl8jldc7v01n469yh9wyvs48rzjgsxrr-etc
error: Build failed due to failed dependency
error: Cannot build '/nix/store/bz4crz47ypww4gblykxwzga82cfiinc9-darwin-system-26.11.6a77112.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/jfhpp1wnyj2bkap8dbib0g60vxal80fk-darwin-system-26.11.6a77112
error: Build failed due to failed dependency
amberwing@lunarythia-macbook:~/ 

Running nix log just gives a lot of unable to find bool:


  633 |   bool will_dump_ : 1;
      |   ^
./lisp.h:634:3: error: unknown type name 'bool'
  634 |   bool will_bootstrap_ : 1;
      |   ^
./lisp.h:638:3: error: unknown type name 'bool'
  638 |   bool will_dump_with_pdumper_ : 1;
      |   ^
./lisp.h:641:3: error: unknown type name 'bool'
  641 |   bool dumped_with_pdumper_ : 1;
      |   ^
./lisp.h:653:8: error: unknown type name 'bool'
  653 | INLINE bool
      |        ^
./lisp.h:663:8: error: unknown type name 'bool'
  663 | INLINE bool
      |        ^
./lisp.h:673:8: error: unknown type name 'bool'
  673 | INLINE bool
      |        ^
./lisp.h:683:8: error: unknown type name 'bool'
  683 | INLINE bool
      |        ^
./lisp.h:693:8: error: unknown type name 'bool'
  693 | INLINE bool
      |        ^
./lisp.h:699:10: error: use of undeclared identifier 'false'
  699 |   return false;
      |          ^~~~~
./lisp.h:703:8: error: unknown type name 'bool'
  703 | INLINE bool
      |        ^
./lisp.h:709:10: error: use of undeclared identifier 'false'
  709 |   return false;
      |          ^~~~~
./lisp.h:716:8: error: unknown type name 'bool'
  716 | INLINE bool
      |        ^
./lisp.h:722:10: error: use of undeclared identifier 'true'
  722 |   return true;
      |          ^~~~
./lisp.h:772:2: error: parameter 'TAGGEDP' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
  772 | (TAGGEDP) (Lisp_Object a, enum Lisp_Type tag)
      |  ^
  773 | {
fatal error: too many errors emitted, stopping now [-ferror-limit=]
In file included from nsmenu.m:26:
In file included from ./config.h:3478:
./conf_post.h:61:9: error: unknown type name 'bool'
   61 | typedef bool bool_bf;
      |         ^
In file included from nsselect.m:28:
In file included from ./config.h:3478:
./conf_post.h:61:9: error: unknown type name 'bool'
   61 | typedef bool bool_bf;
      |         ^
In file included from nsmenu.m:28:
./lisp.h:245:26: error: unknown type name 'bool'
  245 | DEFINE_GDB_SYMBOL_BEGIN (bool, USE_LSB_TAG)
      |                          ^
./lisp.h:594:56: error: use of undeclared identifier 'false'
  594 | enum CHECK_LISP_OBJECT_TYPE { CHECK_LISP_OBJECT_TYPE = false };
      |                                                        ^~~~~
./lisp.h:628:8: error: unknown type name 'bool'
  628 | extern bool initialized;
      |        ^
./lisp.h:633:3: error: unknown type name 'bool'
  633 |   bool will_dump_ : 1;
      |   ^
In file included from nsselect.m:30:
./lisp.h:245:26: error: unknown type name 'bool'
  245 | DEFINE_GDB_SYMBOL_BEGIN (bool, USE_LSB_TAG)
      |                          ^
./lisp.h:594:56: error: use of undeclared identifier 'false'
  594 | enum CHECK_LISP_OBJECT_TYPE { CHECK_LISP_OBJECT_TYPE = false };
      |                                                        ^~~~~
./lisp.h:634:3: error: unknown type name 'bool'
  634 |   bool will_bootstrap_ : 1;
      |   ^
./lisp.h:628:8: error: unknown type name 'bool'
  628 | extern bool initialized;
      |        ^
./lisp.h:638:3: error: unknown type name 'bool'
  638 |   bool will_dump_with_pdumper_ : 1;
      |   ^./lisp.h:633:3: 
error: unknown type name 'bool'
  633 |   bool will_dump_ : 1;
      |   ^
./lisp.h:641:3: error: unknown type name 'bool'
./lisp.h:634:3: error: unknown type name 'bool'  
641 |   bool dumped_with_pdumper_ : 1;  
634       | |     ^b
ool will_bootstrap_ :./lisp.h:653:8: error: unknown type name 'bool'
  653 | INLINE bool
      |        ^
./lisp.h:663:8: error: unknown type name 'bool'
  663 | INLINE bool
      |        ^
./lisp.h:673:8: error: unknown type name 'bool'
  673 | INLINE bool
      |        ^
./lisp.h:683:8: error: unknown type name 'bool'
  683 | INLINE bool
      |        ^
./lisp.h:693:8: error: unknown type name 'bool'
  693 | INLINE bool
      |        ^
./lisp.h:699:10: error: use of undeclared identifier 'false'
  699 |   return false;
      |          ^~~~~
./lisp.h:703:8: error: unknown type name 'bool'
  703 | INLINE bool
      |        ^
./lisp.h:709:10: error: use of undeclared identifier 'false'
  709 |   return false;
      |          ^~~~~
 1;
      |   ^
./lisp.h:716:8: error: unknown type name 'bool'
  716 | INLINE bool
      |        ^
./lisp.h:722:10: error: use of undeclared identifier 'true'
./lisp.h:638:3: error: unknown type name 'bool'
  638 |   bool will_dump_with_pdumper_ : 1;
      |   ^
./lisp.h:641:3: error: unknown type name 'bool'
  641 |   bool dumped_with_pdumper_ : 1;
      |   ^
./lisp.h:653:8: error: unknown type name 'bool'
  653 | INLINE bool
      |        ^
./lisp.h:663:8: error: unknown type name 'bool'
  663 | INLINE bool
      |        ^
./lisp.h:673:8: error: unknown type name 'bool'
  673 | INLINE bool
      |        ^
  722 |   return ./lisp.h:t683:8: error: unknown type name 'bool'
  683 | INLINE bool
      |        ^
./lisp.h:693:8: error: unknown type name 'bool'
  rue;
      |          ^~~~
In file included from nsimage.m:30:
In file included from ./config.h:3478:
./conf_post.h:61:9: error: unknown type name 'bool'
   61 | typedef bool bool_bf;
      |         ^
693 | INLINE bool
      |        ^
./lisp.h:772:2: error: parameter 'TAGGEDP' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
  772 | (TAGGEDP) (Lisp_Object a, enum Lisp_Type tag)
      |  ^
  773 | {
fatal error: too many errors emitted, stopping now [-ferror-limit=]
./lisp.h:699:10: error: use of undeclared identifier 'false'
  699 |   return false;
      |          ^~~~~
./lisp.h:703:8: error: unknown type name 'bool'
  703 | INLINE bool
      |        ^
./lisp.h:709:10: error: use of undeclared identifier 'false'
  709 |   return false;
      |          ^~~~~
./lisp.h:716:8: error: unknown type name 'bool'
  716 | INLINE bool
      |        ^
./lisp.h:722:10: error: use of undeclared identifier 'true'
  722 |   return true;
      |          ^~~~
./lisp.h:772:2: error: parameter 'TAGGEDP' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
  772 | (TAGGEDP) (Lisp_Object a, enum Lisp_Type tag)
      |  ^
  773 | {
fatal error: too many errors emitted, stopping now [-ferror-limit=]
In file included from nsimage.m:32:
./lisp.h:245:26: error: unknown type name 'bool'
  245 | DEFINE_GDB_SYMBOL_BEGIN (bool, USE_LSB_TAG)
      |                          ^
./lisp.h:594:56: error: use of undeclared identifier 'false'
  594 | enum CHECK_LISP_OBJECT_TYPE { CHECK_LISP_OBJECT_TYPE = false };
      |                                                        ^~~~~
./lisp.h:628:8: error: unknown type name 'bool'
  628 | extern bool initialized;
      |        ^
./lisp.h:633:3: error: unknown type name 'bool'
  633 |   bool will_dump_ : 1;
      |   ^
./lisp.h:634:3: error: unknown type name 'bool'
  634 |   bool will_bootstrap_ : 1;
      |   ^
./lisp.h:638:3: error: unknown type name 'bool'
  638 |   bool will_dump_with_pdumper_ : 1;
      |   ^
./lisp.h:641:3: error: unknown type name 'bool'
  641 |   bool dumped_with_pdumper_ : 1;
      |   ^
./lisp.h:653:8: error: unknown type name 'bool'
  653 | INLINE bool
      |        ^
./lisp.h:663:8: error: unknown type name 'bool'
  663 | INLINE bool
      |        ^
./lisp.h:673:8: error: unknown type name 'bool'
  673 | INLINE bool
      |        ^
./lisp.h:683:8: error: unknown type name 'bool'
  683 | INLINE bool
      |        ^
./lisp.h:693:8: error: unknown type name 'bool'
  693 | INLINE bool
      |        ^
./lisp.h:699:10: error: use of undeclared identifier 'false'
  699 |   return false;
      |          ^~~~~
./lisp.h:703:8: error: unknown type name 'bool'
  703 | INLINE bool
      |        ^
./lisp.h:709:10: error: use of undeclared identifier 'false'
  709 |   return false;
      |          ^~~~~
./lisp.h:716:8: error: unknown type name 'bool'
  716 | INLINE bool
      |        ^
./lisp.h:722:10: error: use of undeclared identifier 'true'
  722 |   return true;
      |          ^~~~
./lisp.h:772:2: error: parameter 'TAGGEDP' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
  772 | (TAGGEDP) (Lisp_Object a, enum Lisp_Type tag)
      |  ^
  773 | {
fatal error: too many errors emitted, stopping now [-ferror-limit=]
  CC       nsxwidget.o
  CC       terminfo.o
In file included from macfont.m:22:
In file included from ./config.h:3478:
./conf_post.h:61:9: error: unknown type name 'bool'
   61 | typedef bool bool_bf;
      |         ^
In file included from macfont.m:24:
./lisp.h:245:26: error: unknown type name 'bool'
  245 | DEFINE_GDB_SYMBOL_BEGIN (bool, USE_LSB_TAG)
      |                          ^
./lisp.h:594:56: error: use of undeclared identifier 'false'
  594 | enum CHECK_LISP_OBJECT_TYPE { CHECK_LISP_OBJECT_TYPE = false };
      |                                                        ^~~~~
./lisp.h:628:8: error: unknown type name 'bool'
  628 | extern bool initialized;
      |        ^
./lisp.h:633:3: error: unknown type name 'bool'
  633 |   bool will_dump_ : 1;
      |   ^
./lisp.h:634:3: error: unknown type name 'bool'
  634 |   bool will_bootstrap_ : 1;
      |   ^
./lisp.h:638:3: error: unknown type name 'bool'
  638 |   bool will_dump_with_pdumper_ : 1;
      |   ^
./lisp.h:641:3: error: unknown type name 'bool'
  641 |   bool dumped_with_pdumper_ : 1;
      |   ^
./lisp.h:653:8: error: unknown type name 'bool'
  653 | INLINE bool
      |        ^
./lisp.h:663:8: error: unknown type name 'bool'
  663 | INLINE bool
      |        ^
./lisp.h:673:8: error: unknown type name 'bool'
  673 | INLINE bool
      |        ^
./lisp.h:683:8: error: unknown type name 'bool'
  683 | INLINE bool
      |        ^
./lisp.h:693:8: error: unknown type name 'bool'
  693 | INLINE bool
      |        ^
./lisp.h:699:10: error: use of undeclared identifier 'false'
  699 |   return false;
      |          ^~~~~
./lisp.h:703:8: error: unknown type name 'bool'
  703 | INLINE bool
      |        ^
./lisp.h:709:10: error: use of undeclared identifier 'false'
  709 |   return false;
      |          ^~~~~
./lisp.h:716:8: error: unknown type name 'bool'
  716 | INLINE bool
      |        ^
./lisp.h:722:10: error: use of undeclared identifier 'true'
  722 |   return true;
      |          ^~~~
./lisp.h:772:2: error: parameter 'TAGGEDP' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
  772 | (TAGGEDP) (Lisp_Object a, enum Lisp_Type tag)
      |  ^
  773 | {
fatal error: too many errors emitted, stopping now [-ferror-limit=]
  CC       lastfile.o
In file included from nsxwidget.m:20:
In file included from ./config.h:3478:
./conf_post.h:61:9: error: unknown type name 'bool'
   61 | typedef bool bool_bf;
      |         ^
In file included from nsxwidget.m:22:
./lisp.h:245:26: error: unknown type name 'bool'
  245 | DEFINE_GDB_SYMBOL_BEGIN (bool, USE_LSB_TAG)
      |                          ^
./lisp.h:594:56: error: use of undeclared identifier 'false'
  594 | enum CHECK_LISP_OBJECT_TYPE { CHECK_LISP_OBJECT_TYPE = false };
      |                                                        ^~~~~
./lisp.h:628:8: error: unknown type name 'bool'
  628 | extern bool initialized;
      |        ^
./lisp.h:633:3: error: unknown type name 'bool'
  633 |   bool will_dump_ : 1;
      |   ^
./lisp.h:634:3: error: unknown type name 'bool'
  634 |   bool will_bootstrap_ : 1;
      |   ^
./lisp.h:638:3: error: unknown type name 'bool'
  638 |   bool will_dump_with_pdumper_ : 1;
      |   ^
./lisp.h:641:3: error: unknown type name 'bool'
  641 |   bool dumped_with_pdumper_ : 1;
      |   ^
./lisp.h:653:8: error: unknown type name 'bool'
  653 | INLINE bool
      |        ^
./lisp.h:663:8: error: unknown type name 'bool'
  663 | INLINE bool
      |        ^
./lisp.h:673:8: error: unknown type name 'bool'
  673 | INLINE bool
      |        ^
./lisp.h:683:8: error: unknown type name 'bool'
  683 | INLINE bool
      |        ^
./lisp.h:693:8: error: unknown type name 'bool'
  693 | INLINE bool
      |        ^
./lisp.h:699:10: error: use of undeclared identifier 'false'
  699 |   return false;
      |          ^~~~~
./lisp.h:703:8: error: unknown type name 'bool'
  703 | INLINE bool
      |        ^
./lisp.h:709:10: error: use of undeclared identifier 'false'
  709 |   return false;
      |          ^~~~~
./lisp.h:716:8: error: unknown type name 'bool'
  716 | INLINE bool
      |        ^
./lisp.h:722:10: error: use of undeclared identifier 'true'
  722 |   return true;
      |          ^~~~
./lisp.h:772:2: error: parameter 'TAGGEDP' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
  772 | (TAGGEDP) (Lisp_Object a, enum Lisp_Type tag)
      |  ^
  773 | {
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [Makefile:459: nsterm.o] Error 1
make[2]: *** Waiting for unfinished jobs....
20 errors generated.
make[2]: *** [Makefile:459: nsfns.o] Error 1
20 errors generated.
20 errors generated.
make[2]: *** [Makefile:459: nsmenu.o] Error 1
make[2]: *** [Makefile:459: nsselect.o] Error 1
20 errors generated.
make[2]: *** [Makefile:459: nsimage.o] Error 1
20 errors generated.
make[2]: *** [Makefile:459: macfont.o] Error 1
20 errors generated.
make[2]: *** [Makefile:459: nsxwidget.o] Error 1
make[2]: Leaving directory '/nix/var/nix/builds/nix-18528-1076258433/emacs/src'
make[1]: *** [Makefile:554: src] Error 2
make[1]: Leaving directory '/nix/var/nix/builds/nix-18528-1076258433/emacs'
make[1]: Entering directory '/nix/var/nix/builds/nix-18528-1076258433/emacs'
***
*** "make all" failed with exit status 2.
***
*** You could try to:
*** - run "make bootstrap", which might fix the problem
*** - run "make V=1", which displays the full commands invoked by make,
***   to further investigate the problem
***
make[1]: *** [Makefile:418: advice-on-failure] Error 2
make[1]: Leaving directory '/nix/var/nix/builds/nix-18528-1076258433/emacs'
make: *** [Makefile:374: all] Error 2

I am unable to attach a .txt file of the full output

Pretty sure you are just on a nixpkgs commit for which emacs.aarch64-darwin is broken.

Most recent builds are passing; so changing your nixpkgs revision (update/rollback) will probably fix this.

1 Like

Ah I see, despite my having run nix flake update right before this, it still is using that broken build you linked. I suppose I can’t do much but wait then. In the meantime, thank you!

As a sidenote, https://hydra.nixos.org/job/nixpkgs/unstable/anki.aarch64-darwin/all anki has not build on darwin in over a month. Should I report this to the nixpkgs repo or to somewhere else?

Thank you.

Looks like that is a known issue: anki: "Segmentation fault: 11" on macOS · Issue #40956 · NixOS/nixpkgs · GitHub

I’m guessing they’re referring to this: Issue · GitHub

2 Likes

This was caused by changing the emacs build to use git rather than the tarball of the release. This needed to run autoconf which had been upgraded.

This PR emacs: enable strictDeps by jian-lin · Pull Request #529355 · NixOS/nixpkgs · GitHub fixed that and the build is now there in nixpkgs-unstable

2 Likes

As it turns out, I had nixpkgs.url set to nixpkgs/nixos-unstable (because I also have a nixOS vm to try out nixos) and nixos-unstable is 4 days old. I just set it to nixpkgs-unstable instead and it works now.

What is meant to be the difference between them?

As I understand it, nixpkgs-unstable is intended for users who just need the package sets. nixos-unstable is intended for users that need a bootable system. Hydra does builds of the master branch regularly, and if certain tests pass then the channels get updated, with the tests differing between channels.

4 Likes

That makes sense. So I could probably have two inputs into my flake for each branch and use the nixos one for nixOS and nixpkgs for mac, roughly like this below?

{
	inputs = {
		nixpkgs.url = "nixpkgs/nixpkgs-unstable";
		nixos.url = "nixpkgs/nixos-unstable";
		nix-darwin = {
			url = "github:nix-darwin/nix-darwin/master";
			inputs.nixpkgs.follows = "nixpkgs";
		};

		...
	}
	outputs = { nixos, nix-darwin }@inputs: {
		nixosConfigurations.meowx = nixos.lib.nixosSystem {
			...
		};
		darwinConfigurations.macnix = nix-darwin.lib.darwinSystem {
			...
		};
	}
}

Sure, you can do that.

2 Likes