Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commercial-emacs fails to build #389

Open
bandithedoge opened this issue Feb 21, 2024 · 2 comments
Open

commercial-emacs fails to build #389

bandithedoge opened this issue Feb 21, 2024 · 2 comments

Comments

@bandithedoge
Copy link

~ took 59s
14:00:28 ERROR 1 ❯ nix build github:nix-community/emacs-overlay#commercial-emacs
do you want to allow configuration setting 'extra-substituters' to be set to 'https://nix-community.cachix.org' (y/N)? y
do you want to permanently mark this value as trusted (y/N)? y
do you want to allow configuration setting 'extra-trusted-public-keys' to be set to 'nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyv
RCYg3Fs=' (y/N)? y
do you want to permanently mark this value as trusted (y/N)? y
error: builder for '/nix/store/jvq40qyaffxmhk7h1ab7jb3r05pbsf2p-commercial-emacs-20240221.0.drv' failed with exit code 1;
       last 27 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/b854mq1w4fi4hzz61ybhwbva252d2m56-source
       > source root is source
       > Running phase: patchPhase
       > substituteStream(): WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. (file 'src/Makefile.in')
       > substituteStream(): WARNING: pattern RUN_TEMACS\ =\ ./temacs doesn't match anything in file 'src/Makefile.in'
       > substituteStream(): WARNING: pattern /bin/pwd doesn't match anything in file './lisp/Makefile.in'
       > substituteStream(): WARNING: pattern /bin/pwd doesn't match anything in file './nextstep/Makefile.in'
       > substituteStream(): WARNING: pattern /bin/pwd doesn't match anything in file './oldXMenu/Makefile.in'
       > substituteStream(): WARNING: pattern /bin/pwd doesn't match anything in file './lwlib/Makefile.in'
       > substituteStream(): WARNING: pattern /bin/pwd doesn't match anything in file './doc/emacs/Makefile.in'
       > substituteStream(): WARNING: pattern /bin/pwd doesn't match anything in file './doc/lispref/Makefile.in'
       > substituteStream(): WARNING: pattern /bin/pwd doesn't match anything in file './doc/lispintro/Makefile.in'
       > substituteStream(): WARNING: pattern /bin/pwd doesn't match anything in file './doc/misc/Makefile.in'
       > substituteStream(): WARNING: pattern /bin/pwd doesn't match anything in file './admin/unidata/Makefile.in'
       > substituteStream(): WARNING: pattern /bin/pwd doesn't match anything in file './admin/charsets/Makefile.in'
       > substituteStream(): WARNING: pattern /bin/pwd doesn't match anything in file './nt/Makefile.in'
       > substituteStream(): WARNING: pattern /bin/pwd doesn't match anything in file './lib-src/Makefile.in'
       > substituteStream(): WARNING: pattern /bin/pwd doesn't match anything in file './lib/Makefile.in'
       > substituteStream(): WARNING: pattern /bin/pwd doesn't match anything in file './leim/Makefile.in'
       > substituteStream(): WARNING: pattern /bin/pwd doesn't match anything in file './test/manual/noverlay/Makefile.in'
       > substituteStream(): WARNING: pattern /bin/pwd doesn't match anything in file './test/Makefile.in'
       > substituteStream(): WARNING: pattern /bin/pwd doesn't match anything in file './test/infra/Makefile.in'
       > substituteStream(): WARNING: pattern /bin/pwd doesn't match anything in file './Makefile.in'
       > substituteStream(): WARNING: pattern /bin/pwd doesn't match anything in file './src/Makefile.in'
       > substitute(): ERROR: file 'lisp/loadup.el' does not exist
       > /nix/store/yq9qag5ak3w15nhcqplnhxpny6295l36-stdenv-linux/setup: line 131: pop_var_context: head of shell_variables not a function context
       For full logs, run 'nix log /nix/store/jvq40qyaffxmhk7h1ab7jb3r05pbsf2p-commercial-emacs-20240221.0.drv'.
  • system: "x86_64-linux"
  • host os: Linux 6.7.5-cachyos, NixOS, 24.05 (Uakari), 24.05.20240218.045b51a
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.18.1
  • channels(bandithedoge): ""
  • channels(root): "nixos, nixpkgs"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
@jian-lin
Copy link
Contributor

jian-lin commented Feb 24, 2024

This commit replaces --replace with --replace-warn which is not backported to the stable release (NixOS 23.11).

cc @leungbk


edit:

Oops, what I mention above is not relevant to this issue. Anyway, that commit should be reverted.

@leungbk
Copy link
Member

leungbk commented Feb 24, 2024

This commit replaces --replace with --replace-warn which is not backported to the stable release (NixOS 23.11).

My mistake, I should've confirmed with the stable branch before pushing.

@bandithedoge could you please provide the most recent revision where commercial-emacs worked for you?

The error observed here occurs because lisp/loadup.el does not exist in commercial-emacs. But upon wrapping that only conditionally with

diff --git a/overlays/emacs.nix b/overlays/emacs.nix
index afe0cc8f..da54f4f1 100644
--- a/overlays/emacs.nix
+++ b/overlays/emacs.nix
@@ -33,9 +33,11 @@ let
                                  [ "--enable-check-lisp-object-type" ];
 
               postPatch = old.postPatch + ''
-                substituteInPlace lisp/loadup.el \
-                --replace '(emacs-repository-get-version)' '"${repoMeta.rev}"' \
-                --replace '(emacs-repository-get-branch)' '"master"'
+                if [ -f "lisp/loadup.el" ]; then
+                    substituteInPlace lisp/loadup.el \
+                    --replace '(emacs-repository-get-version)' '"${repoMeta.rev}"' \
+                    --replace '(emacs-repository-get-branch)' '"master"'
+                fi
               '' +
               # XXX: Maybe remove when emacsLsp updates to use Emacs
               # 29.  We already have logic in upstream Nixpkgs to use
-- 
2.43.0

commercial-emacs still does not build with this patch, and instead segfaults. If provided a revision where this is known to build, I can try to bisect and look into this a bit more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants