nix-community / emacs-overlay

Bleeding edge emacs overlay [maintainer=@adisbladis]
503 stars 165 forks source link

stdenv-linux/setup: emacs: command not found when building pdf-tools #419

Closed ParetoOptimalDev closed 1 month ago

ParetoOptimalDev commented 1 month ago

This is from NixOS and only occurs when adding the emacs-overlay import. So this works:

$ nix shell --impure --expr '((import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/c3aa7b8938b17aebd2deecf7be0636000d62a2b9.tar.gz") {}).emacsWithPackages (e: [ e.pdf-tools ])).overrideAttrs (_: { pname = "emacs"; })'

However I get an error when I add the emacs-overlay:

$ nix shell --impure --expr '((import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/c3aa7b8938b17aebd2deecf7be0636000d62a2b9.tar.gz") { overlays = [(import (builtins.fetchTarball {url = "https://github.com/nix-community/emacs-overlay/archive/d2632c3a229d05790ca574640aae9bdeab939bc0.tar.gz"; })) ];}).emacsWithPackages (e: [ e.pdf-tools ])).overrideAttrs (_: { pname = "emacs"; })'
error: builder for '/nix/store/5xvm6nazj2kqikhwq03hr8l5k4k6z3sh-emacs-pdf-tools-20240429.407.drv' failed with exit code 127;
       last 10 log lines:
       > rm -f libsynctex.a
       > ar cru libsynctex.a libsynctex_a-synctex_parser.o libsynctex_a-synctex_parser_utils.o
       > ar: `u' modifier ignored since `D' is the default (see `U')
       > ranlib libsynctex.a
       > gcc -Wall -I/nix/store/sa2vr5rkh19pvy9j4hkb4lk95nlhqpix-glib-2.80.4-dev/include/glib-2.0 -I/nix/store/7lr9qdizm42pf6clysg7syrky0si8aab-glib-2.80.4/lib/glib-2.0/include -I/nix/store/iimbkzh1dvwbxfycdh31acxqwfwv87zr-poppler-glib-24.02.0-dev/include/poppler/glib -I/nix/store/3v10x1zfcd17wlkd87rl1q8gk3d878vw-cairo-1.18.0-dev/include/cairo -I/nix/store/cg0s3ndgdlvxsfpsqdsas9qx4fdpd61b-freetype-2.13.2-dev/include/freetype2 -I/nix/store/cg0s3ndgdlvxsfpsqdsas9qx4fdpd61b-freetype-2.13.2-dev/include -I/nix/store/sa2vr5rkh19pvy9j4hkb4lk95nlhqpix-glib-2.80.4-dev/include -I/nix/store/sa2vr5rkh19pvy9j4hkb4lk95nlhqpix-glib-2.80.4-dev/include/glib-2.0 -I/nix/store/7lr9qdizm42pf6clysg7syrky0si8aab-glib-2.80.4/lib/glib-2.0/include -I/nix/store/iimbkzh1dvwbxfycdh31acxqwfwv87zr-poppler-glib-24.02.0-dev/include/poppler -I/nix/store/0n0vsm5syicn4lz4fn00aaa7kq960x02-libpng-apng-1.6.43-dev/include/libpng16 -g -O2   -o epdfinfo epdfinfo-epdfinfo.o -L/nix/store/7lr9qdizm42pf6clysg7syrky0si8aab-glib-2.80.4/lib -lglib-2.0 -L/nix/store/c7kay00dgqhipkrkm2nh8mfc7xsdv4pg-poppler-glib-24.02.0/lib -L/nix/store/jpa6i63siv75vvwm91h12zhnn4hsrpn6-cairo-1.18.0/lib -L/nix/store/7lr9qdizm42pf6clysg7syrky0si8aab-glib-2.80.4/lib -lpoppler-glib -lgobject-2.0 -lglib-2.0 -lcairo -L/nix/store/c7kay00dgqhipkrkm2nh8mfc7xsdv4pg-poppler-glib-24.02.0/lib -lpoppler -L/nix/store/3rmghpv8fapbmng692rm66b2d46px4bk-libpng-apng-1.6.43/lib -lpng16 libsynctex.a -L/nix/store/zm7nh67qxgyski4j23vyd993kbmw3248-zlib-1.3.1/lib -lz -lm
       > /nix/store/x7yyxvwy1f9hlx72rzrgx069jyf7hxwr-binutils-2.42/bin/ld: epdfinfo-epdfinfo.o: in function `mktempfile':
       > /build/source/server/epdfinfo.c:354:(.text+0xfe6): warning: the use of `tempnam' is dangerous, better use `mkstemp'
       > make[2]: Leaving directory '/build/source/server'
       > make[1]: Leaving directory '/build/source/server'
       > /nix/store/hix7sl0wxajb5aq14afjdvzc3w0i8b14-stdenv-linux/setup: line 1707: emacs: command not found
       For full logs, run 'nix log /nix/store/5xvm6nazj2kqikhwq03hr8l5k4k6z3sh-emacs-pdf-tools-20240429.407.drv'.
error: 1 dependencies of derivation '/nix/store/1jll9w3lnmhaza5ljzj73lwf431a2bfb-emacs-with-packages-29.4.drv' failed to build
full logs ``` $ nix log /nix/store/5xvm6nazj2kqikhwq03hr8l5k4k6z3sh-emacs-pdf-tools-20240429.407.drv warning: The interpretation of store paths arguments ending in `.drv` recently changed. If this command is now failing try again with '/nix/store/5xvm6nazj2kqikhwq03hr8l5k4k6z3sh-emacs-pdf-tools-20240429.407.drv^*' Running phase: unpackPhase @nix { "action": "setPhase", "phase": "unpackPhase" } unpacking source archive /nix/store/gngd2vcq8ifh014ck171bq75q6dcynbs-source source root is source Running phase: patchPhase @nix { "action": "setPhase", "phase": "patchPhase" } Running phase: updateAutotoolsGnuConfigScriptsPhase @nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" } Running phase: configurePhase @nix { "action": "setPhase", "phase": "configurePhase" } no configure script, doing nothing Running phase: buildPhase @nix { "action": "setPhase", "phase": "buildPhase" } make: emacs: No such file or directory Using Emacs make: emacs: No such file or directory make: emacs: No such file or directory make: emacs: No such file or directory cd server && ./autogen.sh Running autoreconf... configure.ac:14: installing './ar-lib' configure.ac:11: installing './compile' configure.ac:61: installing './config.guess' configure.ac:61: installing './config.sub' configure.ac:6: installing './install-sh' configure.ac:6: installing './missing' Makefile.am: installing './depcomp' cd server && ./configure -q Is case-sensitive searching enabled ? yes Is modifying text annotations enabled ? yes Is modifying markup annotations enabled ? yes make -C server make[1]: Entering directory '/build/source/server' make all-am make[2]: Entering directory '/build/source/server' gcc -DHAVE_CONFIG_H -I. -Wall -I/nix/store/sa2vr5rkh19pvy9j4hkb4lk95nlhqpix-glib-2.80.4-dev/include/glib-2.0 -I/nix/store/7lr9qdizm42pf6clysg7syrky0si8aab-glib-2.80.4/lib/glib-2.0/include -I/nix/store/iimbkzh1dvwbxfycdh31acxqwfwv87zr-poppler-glib-24.02.0-dev/include/poppler/glib -I/nix/store/3v10x1zfcd17wlkd87rl1q8gk3d878vw-cairo-1.18.0-dev/include/cairo -I/nix/store/cg0s3ndgdlvxsfpsqdsas9qx4fdpd61b-freetype-2.13.2-dev/include/freetype2 -I/nix/store/cg0s3ndgdlvxsfpsqdsas9qx4fdpd61b-freetype-2.13.2-dev/include -I/nix/store/sa2vr5rkh19pvy9j4hkb4lk95nlhqpix-glib-2.80.4-dev/include -I/nix/store/sa2vr5rkh19pvy9j4hkb4lk95nlhqpix-glib-2.80.4-dev/include/glib-2.0 -I/nix/store/7lr9qdizm42pf6clysg7syrky0si8aab-glib-2.80.4/lib/glib-2.0/include -I/nix/store/iimbkzh1dvwbxfycdh31acxqwfwv87zr-poppler-glib-24.02.0-dev/include/poppler -I/nix/store/0n0vsm5syicn4lz4fn00aaa7kq960x02-libpng-apng-1.6.43-dev/include/libpng16 -g -O2 -MT epdfinfo-epdfinfo.o -MD -MP -MF .deps/epdfinfo-epdfinfo.Tpo -c -o epdfinfo-epdfinfo.o `test -f 'epdfinfo.c' || echo './'`epdfinfo.c epdfinfo.c: In function 'annotation_markup_append_text_region': epdfinfo.c:1576:5: warning: 'poppler_page_get_selection_region' is deprecated: Use poppler_page_get_selected_region instead [-Wdeprecated-declarations] 1576 | poppler_page_get_selection_region (page, 1.0, selection_style, region); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /nix/store/iimbkzh1dvwbxfycdh31acxqwfwv87zr-poppler-glib-24.02.0-dev/include/poppler/glib/poppler.h:251, from epdfinfo.c:28: /nix/store/iimbkzh1dvwbxfycdh31acxqwfwv87zr-poppler-glib-24.02.0-dev/include/poppler/glib/poppler-page.h:75:8: note: declared here 75 | GList *poppler_page_get_selection_region(PopplerPage *page, gdouble scale, PopplerSelectionStyle style, PopplerRectangle *selection) G_GNUC_DEPRECATED_FOR(poppler_page_get_selected_region); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mv -f .deps/epdfinfo-epdfinfo.Tpo .deps/epdfinfo-epdfinfo.Po gcc -DHAVE_CONFIG_H -I. -w -I/nix/store/vsygj2vzwqr9x7rzq4v3prcv2blkggmx-zlib-1.3.1-dev/include -DSYNCTEX_USE_LOCAL_HEADER -g -O2 -MT libsynctex_a-synctex_parser.o -MD -MP -MF .deps/libsynctex_a-synctex_parser.Tpo -c -o libsynctex_a-synctex_parser.o `test -f 'synctex_parser.c' || echo './'`synctex_parser.c mv -f .deps/libsynctex_a-synctex_parser.Tpo .deps/libsynctex_a-synctex_parser.Po gcc -DHAVE_CONFIG_H -I. -w -I/nix/store/vsygj2vzwqr9x7rzq4v3prcv2blkggmx-zlib-1.3.1-dev/include -DSYNCTEX_USE_LOCAL_HEADER -g -O2 -MT libsynctex_a-synctex_parser_utils.o -MD -MP -MF .deps/libsynctex_a-synctex_parser_utils.Tpo -c -o libsynctex_a-synctex_parser_utils.o `test -f 'synctex_parser_utils.c' || echo './'`synctex_parser_utils.c mv -f .deps/libsynctex_a-synctex_parser_utils.Tpo .deps/libsynctex_a-synctex_parser_utils.Po rm -f libsynctex.a ar cru libsynctex.a libsynctex_a-synctex_parser.o libsynctex_a-synctex_parser_utils.o ar: `u' modifier ignored since `D' is the default (see `U') ranlib libsynctex.a gcc -Wall -I/nix/store/sa2vr5rkh19pvy9j4hkb4lk95nlhqpix-glib-2.80.4-dev/include/glib-2.0 -I/nix/store/7lr9qdizm42pf6clysg7syrky0si8aab-glib-2.80.4/lib/glib-2.0/include -I/nix/store/iimbkzh1dvwbxfycdh31acxqwfwv87zr-poppler-glib-24.02.0-dev/include/poppler/glib -I/nix/store/3v10x1zfcd17wlkd87rl1q8gk3d878vw-cairo-1.18.0-dev/include/cairo -I/nix/store/cg0s3ndgdlvxsfpsqdsas9qx4fdpd61b-freetype-2.13.2-dev/include/freetype2 -I/nix/store/cg0s3ndgdlvxsfpsqdsas9qx4fdpd61b-freetype-2.13.2-dev/include -I/nix/store/sa2vr5rkh19pvy9j4hkb4lk95nlhqpix-glib-2.80.4-dev/include -I/nix/store/sa2vr5rkh19pvy9j4hkb4lk95nlhqpix-glib-2.80.4-dev/include/glib-2.0 -I/nix/store/7lr9qdizm42pf6clysg7syrky0si8aab-glib-2.80.4/lib/glib-2.0/include -I/nix/store/iimbkzh1dvwbxfycdh31acxqwfwv87zr-poppler-glib-24.02.0-dev/include/poppler -I/nix/store/0n0vsm5syicn4lz4fn00aaa7kq960x02-libpng-apng-1.6.43-dev/include/libpng16 -g -O2 -o epdfinfo epdfinfo-epdfinfo.o -L/nix/store/7lr9qdizm42pf6clysg7syrky0si8aab-glib-2.80.4/lib -lglib-2.0 -L/nix/store/c7kay00dgqhipkrkm2nh8mfc7xsdv4pg-poppler-glib-24.02.0/lib -L/nix/store/jpa6i63siv75vvwm91h12zhnn4hsrpn6-cairo-1.18.0/lib -L/nix/store/7lr9qdizm42pf6clysg7syrky0si8aab-glib-2.80.4/lib -lpoppler-glib -lgobject-2.0 -lglib-2.0 -lcairo -L/nix/store/c7kay00dgqhipkrkm2nh8mfc7xsdv4pg-poppler-glib-24.02.0/lib -lpoppler -L/nix/store/3rmghpv8fapbmng692rm66b2d46px4bk-libpng-apng-1.6.43/lib -lpng16 libsynctex.a -L/nix/store/zm7nh67qxgyski4j23vyd993kbmw3248-zlib-1.3.1/lib -lz -lm /nix/store/x7yyxvwy1f9hlx72rzrgx069jyf7hxwr-binutils-2.42/bin/ld: epdfinfo-epdfinfo.o: in function `mktempfile': /build/source/server/epdfinfo.c:354:(.text+0xfe6): warning: the use of `tempnam' is dangerous, better use `mkstemp' make[2]: Leaving directory '/build/source/server' make[1]: Leaving directory '/build/source/server' /nix/store/hix7sl0wxajb5aq14afjdvzc3w0i8b14-stdenv-linux/setup: line 1707: emacs: command not found ```
jian-lin commented 1 month ago

I created https://github.com/NixOS/nixpkgs/pull/334968 to fix this.