Closed mrkkrp closed 4 years ago
I have more than 17 dependencies: https://github.com/grahamc/nixos-config/blob/master/packages/emacs/default.nix#L37
This is different. You use emacsWithPackages
, whereas I try to define a Emacs Lisp package itself with its own dependencies. It is as if magit
had 17+ dependencies and failed to build.
The problem appears to be something wrong in calculating the EMACSLOADPATH, where each plugin is included many times:
unpackPhase = ''
env | grep EMACSLOADPATH | tr : '\n' | sort | uniq -c | sort -nr
'';
with 16 dependencies:
63 /nix/store/z6vpclw5qy8mhshln5xqvx4lpa1a49lp-emacs-swiper-20200105.1958/share/emacs/site-lisp
63 /nix/store/x044jrmzv37ymnm85mjg66gi62c5nfhf-emacs-avy-20191106.1234/share/emacs/site-lisp
63 /nix/store/wjvyy9n1jhipk4dx59r43vbnhn39ixcd-emacs-ace-popup-menu-20190713.1337/share/emacs/site-lisp
63 /nix/store/s369q2b6r2g2p44y84sdap3cfj8p939l-emacs-f-20191110.1357/share/emacs/site-lisp
63 /nix/store/qm24rw44f5j7ysdj4px8h86h4yvc5sn9-emacs-ace-window-20191022.1203/share/emacs/site-lisp
63 /nix/store/q8i9kxr0hcczwhccxpg3b66yrx698x5w-emacs-auctex-12.2.0/share/emacs/site-lisp
63 /nix/store/q4wphgsh4cm2f7ixgrvjffhjbcv3xncq-emacs-direnv-20191016.1907/share/emacs/site-lisp
63 /nix/store/pll7a87qw27xyipxvjfq0798wi4ndyia-emacs-26.3/share/emacs/site-lisp
63 /nix/store/lxd3a0r5fvjr69g0iva6jvk70b9jzsn3-emacs-yaml-mode-20191127.2314/share/emacs/site-lisp
63 /nix/store/lkk1b8c4rn1fzcbn14d2lxfldp172pfn-emacs-counsel-20200105.1947/share/emacs/site-lisp
63 /nix/store/iglhwyjc6jpra6kx1hwr6kb6a73x2526-emacs-ztree-20191108.2234/share/emacs/site-lisp
63 /nix/store/d6zp6kanhi36q4a7wq6qnnzvk22s11wg-emacs-cyphejor-20190713.1339/share/emacs/site-lisp
63 /nix/store/bxbzc1widlzjbw9y5s9m3158zc9mqdch-emacs-aggressive-indent-20190828.1828/share/emacs/site-lisp
63 /nix/store/9ja2rbl0apmb1q5slb9az7y3yn735aqx-emacs-zygospore-20140703.852/share/emacs/site-lisp
63 /nix/store/58ralp4c2pnqwjjrxi0vm6d2nhh5j586-emacs-dash-20191109.1327/share/emacs/site-lisp
63 /nix/store/4y35kqnrkaxcqfsa0rrq8lx2mhx54hi5-emacs-zenburn-theme-20200105.1010/share/emacs/site-lisp
63 /nix/store/4s7qznw8q62p9dn84wy2l8wld9bpipg5-emacs-s-20180406.808/share/emacs/site-lisp
63 /nix/store/3mf3xcr8r2qr8p5gfyigrxvdb96rhgz4-emacs-char-menu-20190713.1343/share/emacs/site-lisp
63 /nix/store/21b3f1h6jrvw68f2i5ycc04gd5cbwkzp-emacs-avy-menu-20190713.1348/share/emacs/site-lisp
63 /nix/store/1z74f3rp27bpdhl9hrb56v7pndyhcsgq-emacs-ivy-20200105.1946/share/emacs/site-lisp
62 /nix/store/q7d8zj1lyqbldvzkdfq92lz6yw5dgqdw-emacs-zzz-to-char-20190713.1344/share/emacs/site-lisp
with 8:
30 /nix/store/z6vpclw5qy8mhshln5xqvx4lpa1a49lp-emacs-swiper-20200105.1958/share/emacs/site-lisp
30 /nix/store/x044jrmzv37ymnm85mjg66gi62c5nfhf-emacs-avy-20191106.1234/share/emacs/site-lisp
30 /nix/store/wjvyy9n1jhipk4dx59r43vbnhn39ixcd-emacs-ace-popup-menu-20190713.1337/share/emacs/site-lisp
30 /nix/store/qm24rw44f5j7ysdj4px8h86h4yvc5sn9-emacs-ace-window-20191022.1203/share/emacs/site-lisp
30 /nix/store/q8i9kxr0hcczwhccxpg3b66yrx698x5w-emacs-auctex-12.2.0/share/emacs/site-lisp
30 /nix/store/pll7a87qw27xyipxvjfq0798wi4ndyia-emacs-26.3/share/emacs/site-lisp
30 /nix/store/lkk1b8c4rn1fzcbn14d2lxfldp172pfn-emacs-counsel-20200105.1947/share/emacs/site-lisp
30 /nix/store/bxbzc1widlzjbw9y5s9m3158zc9mqdch-emacs-aggressive-indent-20190828.1828/share/emacs/site-lisp
30 /nix/store/3mf3xcr8r2qr8p5gfyigrxvdb96rhgz4-emacs-char-menu-20190713.1343/share/emacs/site-lisp
30 /nix/store/21b3f1h6jrvw68f2i5ycc04gd5cbwkzp-emacs-avy-menu-20190713.1348/share/emacs/site-lisp
29 /nix/store/1z74f3rp27bpdhl9hrb56v7pndyhcsgq-emacs-ivy-20200105.1946/share/emacs/site-lisp
with 4:
18 /nix/store/x044jrmzv37ymnm85mjg66gi62c5nfhf-emacs-avy-20191106.1234/share/emacs/site-lisp
18 /nix/store/wjvyy9n1jhipk4dx59r43vbnhn39ixcd-emacs-ace-popup-menu-20190713.1337/share/emacs/site-lisp
18 /nix/store/qm24rw44f5j7ysdj4px8h86h4yvc5sn9-emacs-ace-window-20191022.1203/share/emacs/site-lisp
18 /nix/store/pll7a87qw27xyipxvjfq0798wi4ndyia-emacs-26.3/share/emacs/site-lisp
18 /nix/store/bxbzc1widlzjbw9y5s9m3158zc9mqdch-emacs-aggressive-indent-20190828.1828/share/emacs/site-lisp
18 /nix/store/21b3f1h6jrvw68f2i5ycc04gd5cbwkzp-emacs-avy-menu-20190713.1348/share/emacs/site-lisp
17 /nix/store/q8i9kxr0hcczwhccxpg3b66yrx698x5w-emacs-auctex-12.2.0/share/emacs/site-lisp
with 2:
15 /nix/store/x044jrmzv37ymnm85mjg66gi62c5nfhf-emacs-avy-20191106.1234/share/emacs/site-lisp
15 /nix/store/wjvyy9n1jhipk4dx59r43vbnhn39ixcd-emacs-ace-popup-menu-20190713.1337/share/emacs/site-lisp
15 /nix/store/pll7a87qw27xyipxvjfq0798wi4ndyia-emacs-26.3/share/emacs/site-lisp
15 /nix/store/21b3f1h6jrvw68f2i5ycc04gd5cbwkzp-emacs-avy-menu-20190713.1348/share/emacs/site-lisp
14 /nix/store/qm24rw44f5j7ysdj4px8h86h4yvc5sn9-emacs-ace-window-20191022.1203/share/emacs/site-lisp
with 1:
6 /nix/store/qm24rw44f5j7ysdj4px8h86h4yvc5sn9-emacs-ace-window-20191022.1203/share/emacs/site-lisp
6 /nix/store/pll7a87qw27xyipxvjfq0798wi4ndyia-emacs-26.3/share/emacs/site-lisp
5 /nix/store/x044jrmzv37ymnm85mjg66gi62c5nfhf-emacs-avy-20191106.1234/share/emacs/site-lisp
Could it be that if two plugins depend on the same package it's simply included several times?
Perhaps some filtering here
is necessary. Although this differs from my local nixpkgs checkout and looks like it may already be correct.
Appears to be fixed by #82604.
Describe the bug
It appears that when a Emacs package starts to have more than 17 dependent packages something related to implicit hooks goes wrong. Consider the following:
In this form
nix-build
fails:Looking at the
/nix/store/ikywdrvfib46c2rwiphig16bppv8csv4-stdenv-linux/setup
file, I found that it first sees thatsrc
points to a directory. So it tries to strip the hash from the directory name and copy it.basename
invocation inside ofstripHash
fails. When I added an explicit invocation ofbasename
, it reported line 82, this is inside of_callImplicitHook
function definition. I have no idea what is going on here.Interestingly, if I delete just one dependent package from the list,
nix-build
starts to pass:It would be nice if we could fix this bug. I understand that this many dependencies is unusual for Emacs packages, but I'm experimenting with defining my configuration as a package which depends on packages that I use, so finally I can use
emacsWithPackages
and get Emacs with my configuration included and pre-built.To Reproduce
You can use the snippet from above. I used
b2935fbeceaea0b64df4401545d7c8ea29102120
of nixpkgs.Metadata
"x86_64-linux"
Linux 5.4.25, NixOS, 20.03.git.b2935fbecea (Markhor)
yes
yes
nix-env (Nix) 2.4pre7250_94c93437
"nixos-18.09.2337.5d972dd2c94"
"nixos-19.03.173651.ca6b6595392"
/home/mark/nixpkgs