all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Error 255 while preparing to dump
@ 2020-09-02 16:31 Camden Narzt
  2020-09-03 13:54 ` Robert Pluim
  0 siblings, 1 reply; 3+ messages in thread
From: Camden Narzt @ 2020-09-02 16:31 UTC (permalink / raw)
  To: emacs-devel

Hi all, I’m trying (https://github.com/Homebrew/homebrew-core/pull/59448) to update the homebrew (on macOS) package manager’s emacs formula to 27.1, and am encountering some difficulty.

Homebrew has rules that binary files produced as part of the build may not refer to the build environment (snippet from their CI):

=> FAILED
Error: 1 problem in 1 formula detected
emacs:
  * Files were found with references to the Homebrew shims directory.
    The offending files are:
      libexec/emacs/27.1/x86_64-apple-darwin19.5.0/emacs.pdmp


When I examine this file it seems that the pdmp file captures the PATH at the time it is dumped (snippet from my mac):

strings /usr/local/opt/emacs/libexec/emacs/27.1/x86_64-apple-darwin19.6.0/emacs.pdmp | rg -B 13 shims
/sbin
/usr/sbin
/bin
/usr/bin
/usr/local/opt/gnutls/bin
/usr/local/opt/libevent/bin
/usr/local/opt/openssl@1.1/bin
/usr/local/opt/p11-kit/bin
/usr/local/opt/nettle/bin
/usr/local/opt/libtasn1/bin
/usr/local/opt/libidn2/bin
/usr/local/opt/gettext/bin
/usr/local/opt/pkg-config/bin
/usr/local/Homebrew/Library/Homebrew/shims/mac/super

I’m not sure if this is the exec-path variable or PATH or what exactly, but I need to find a way to remove the shims dir at dump time. I read this (https://www.gnu.org/software/emacs/manual/html_node/elisp/Building-Emacs.html) and it seems like I need to add a site-load.el file to lisp before building that will remove the one directory from the PATH or exec-path or whatever that data refers to. However when I try adding a site-load.el file with the following contents, I get the error that follows.

The elisp:

(require 'seq)
(setq exec-path (seq-filter (lambda (haystack) (not (string-match-p (regexp-quote "Homebrew/shims") haystack))) exec-path))
(setenv "PATH" (string-join (seq-filter (lambda (haystack) (not (string-match-p (regexp-quote "Homebrew/shims") haystack))) (split-string (getenv "PATH") ":")) ":"))

The error:

Loading site-load.el (source)...
(require seq) while preparing to dump
make[1]: *** [emacs.pdmp] Error 255
make: *** [src] Error 2

Can anyone who is more knowledgeable about the new portable dumper system please steer me in the right direction?


Cheers,


Camden Narzt


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Error 255 while preparing to dump
  2020-09-02 16:31 Error 255 while preparing to dump Camden Narzt
@ 2020-09-03 13:54 ` Robert Pluim
  2020-09-03 17:34   ` Camden Narzt
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Pluim @ 2020-09-03 13:54 UTC (permalink / raw)
  To: Camden Narzt; +Cc: emacs-devel

>>>>> On Wed, 2 Sep 2020 10:31:36 -0600, Camden Narzt <camden.narzt@gmail.com> said:

    Camden> (require 'seq)
    Camden> (setq exec-path (seq-filter (lambda (haystack) (not (string-match-p (regexp-quote "Homebrew/shims") haystack))) exec-path))
    Camden> (setenv "PATH" (string-join (seq-filter (lambda (haystack) (not (string-match-p (regexp-quote "Homebrew/shims") haystack))) (split-string (getenv "PATH") ":")) ":"))

    Camden> The error:

    Camden> Loading site-load.el (source)...
    Camden> (require seq) while preparing to dump
    Camden> make[1]: *** [emacs.pdmp] Error 255
    Camden> make: *** [src] Error 2

    Camden> Can anyone who is more knowledgeable about the new portable dumper system please steer me in the right direction?

This doesnʼt really have anything to do with the portable dumper. When
dumping the portion of emacs lisp that you can use is fairly limited,
so you canʼt just go loading seq.el. Try something along the lines of
(untested):

(setq exec-path (delete nil
                 (mapcar
                  (lambda (elt)
                    (unless (string-match-p "Homebrew/shims" elt) elt))
                  exec-path)))

I donʼt think you need to do anything with PATH, Emacs doesnʼt store
that anywhere.

Robert



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Error 255 while preparing to dump
  2020-09-03 13:54 ` Robert Pluim
@ 2020-09-03 17:34   ` Camden Narzt
  0 siblings, 0 replies; 3+ messages in thread
From: Camden Narzt @ 2020-09-03 17:34 UTC (permalink / raw)
  To: Robert Pluim; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1479 bytes --]

Thanks, that did the trick. 

Cheers,

Camden Narzt

> On Sep 3, 2020, at 7:54 AM, Robert Pluim <rpluim@gmail.com> wrote:
> 
>>>>>> On Wed, 2 Sep 2020 10:31:36 -0600, Camden Narzt <camden.narzt@gmail.com> said:
> 
>    Camden> (require 'seq)
>    Camden> (setq exec-path (seq-filter (lambda (haystack) (not (string-match-p (regexp-quote "Homebrew/shims") haystack))) exec-path))
>    Camden> (setenv "PATH" (string-join (seq-filter (lambda (haystack) (not (string-match-p (regexp-quote "Homebrew/shims") haystack))) (split-string (getenv "PATH") ":")) ":"))
> 
>    Camden> The error:
> 
>    Camden> Loading site-load.el (source)...
>    Camden> (require seq) while preparing to dump
>    Camden> make[1]: *** [emacs.pdmp] Error 255
>    Camden> make: *** [src] Error 2
> 
>    Camden> Can anyone who is more knowledgeable about the new portable dumper system please steer me in the right direction?
> 
> This doesnʼt really have anything to do with the portable dumper. When
> dumping the portion of emacs lisp that you can use is fairly limited,
> so you canʼt just go loading seq.el. Try something along the lines of
> (untested):
> 
> (setq exec-path (delete nil
>                 (mapcar
>                  (lambda (elt)
>                    (unless (string-match-p "Homebrew/shims" elt) elt))
>                  exec-path)))
> 
> I donʼt think you need to do anything with PATH, Emacs doesnʼt store
> that anywhere.
> 
> Robert


[-- Attachment #2: Type: text/html, Size: 3550 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-03 17:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-02 16:31 Error 255 while preparing to dump Camden Narzt
2020-09-03 13:54 ` Robert Pluim
2020-09-03 17:34   ` Camden Narzt

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.