I am new to Nix and wanted to use it in an imperative way initially, using
nix profile. One test case I had was building a recent version of Emacs with useful features like tree-sitter (works), vterm (works), and native compilation (works, maybe?). I did this like so:
$ nix registry add flake:emacs-overlay github:nix-community/emacs-overlay $ nix profile install emacs-overlay#emacsGit
This is on an M2 Mac, using the Determinate Systems installer. Building Emacs succeeds and attempts to native compile, but gives a lot of warnings like this in the
⛔ Warning (comp): aarch64-apple-darwin-gcc-11.3.0: warning: could not understand version ‘13.00.00’ ⛔ Warning (comp): ld: warning: object file (/var/folders/l8/lb3w7yxs01g_sm723x50r_dh0000gn/T//ccvNXG4s.o) was built for newer macOS version (13.0) than being linked (11.0) ⛔ Warning (comp): ld: warning: could not create compact unwind for _F6e69782d2d70726f66696c652d7061746873_nix__profile_paths_0: register 22 saved somewhere other than in frame ⛔ Warning (comp): ld: warning: ignoring file /nix/store/cf3kc56v1f51x68v6yvmjn1rzwfd864i-libSystem-11.0.0/lib/dylib1.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64 ⛔ Warning (comp): aarch64-apple-darwin-gcc-11.3.0: warning: could not understand version ‘13.00.00’
/var/folders/l8/lb3w7yxs01g_sm723x50r_dh0000gn/T/ccvNXG4s.o does not appear to exist. I’m not sure if it’s supposed to be temporary.)
How can I debug this? My first questions are:
- Why is
/nix/store/cf3kc56v1f51x68v6yvmjn1rzwfd864i-libSystem-11.0.0/lib/dylib1.oan x86-64 version? I confirmed it is with
file- can I tell Nix to build that for arm64 instead?
- Why is this building with gcc 11? My system GCC (well, clang) is the default one from macOS’s developer tools. Again, can I tell Nix to use a matching version here?
- What is going on with the object files being built for an older macOS? Is this the same problem as 2?
Emacs itself appears usable but some of these warnings are a little concerning to me, and I’d love to understand more about how to dig into them.