parinfer-rust
parinfer-rust copied to clipboard
Can't `nix-shell --run "cargo build --release"` on Apple M1
When trying to execute the recommended post-install hook (nix-shell --run "cargo build --release"
) on an M1 running macOS Monterey, I get the following error:
[100%] Building C object src/nvim/CMakeFiles/nvim.dir/viml/parser/parser.c.o
[100%] Building C object src/nvim/CMakeFiles/nvim.dir/window.c.o
[100%] Building C object src/nvim/CMakeFiles/nvim.dir/xdiff/xdiffi.c.o
[100%] Building C object src/nvim/CMakeFiles/nvim.dir/xdiff/xemit.c.o
[100%] Building C object src/nvim/CMakeFiles/nvim.dir/xdiff/xhistogram.c.o
[100%] Building C object src/nvim/CMakeFiles/nvim.dir/xdiff/xpatience.c.o
[100%] Building C object src/nvim/CMakeFiles/nvim.dir/xdiff/xprepare.c.o
[100%] Building C object src/nvim/CMakeFiles/nvim.dir/xdiff/xutils.c.o
[100%] Linking C executable ../../bin/nvim
[100%] Built target nvim
Scanning dependencies of target nvim_runtime_deps
[100%] Built target nvim_runtime_deps
Scanning dependencies of target tty-test
[100%] Building C object test/functional/fixtures/CMakeFiles/tty-test.dir/tty-test.c.o
[100%] Linking C executable ../../../bin/tty-test
[100%] Built target tty-test
Scanning dependencies of target runtime
[100%] Generating syntax/vim/generated.vim
[100%] Generating pack/dist/opt/matchit/doc/tags
make[2]: *** [runtime/CMakeFiles/runtime.dir/build.make:99: runtime/pack/dist/opt/matchit/doc/tags] Killed: 9
make[1]: *** [CMakeFiles/Makefile2:6868: runtime/CMakeFiles/runtime.dir/all] Error 2
make: *** [Makefile:171: all] Error 2
builder for '/nix/store/38q1gcy0p7qbn98cswi49chc4qfwqyn1-neovim-unwrapped-0.4.4.drv' failed with exit code 2
cannot build derivation '/nix/store/knlaxyassljh2wbrf8cmalji0bskm96y-neovim-0.4.4.drv': 1 dependencies couldn't be built
error: build of '/nix/store/knlaxyassljh2wbrf8cmalji0bskm96y-neovim-0.4.4.drv' failed
This is using nix 2.3.16.
The only idea I have is to update the nixpkgs hash to something more recent, are you open to this? https://github.com/eraserhd/parinfer-rust/blob/master/nixpkgs.nix#L2. If yes, I'll experiment and try to find something that works.
This 21.11 archive worked fine for me:
builtins.fetchTarball {
url = "https://github.com/nixos/nixpkgs/archive/21.11.tar.gz";
sha256 = "162dywda2dvfj1248afxc45kcrg83appjd0nmdb541hl7rnncf02";
}
Been behind on this project... I'll convert this to flakes soon, but for now I've committed your update. Thanks!