homebrew-emacs-plus icon indicating copy to clipboard operation
homebrew-emacs-plus copied to clipboard

Could not install emacs-plus@28 because tar can't find xz

Open gcoladon opened this issue 2 years ago • 25 comments

Please make sure to follow these steps (and mark the checkboxes):

  • [X] run brew update and try to reproduce the issue again
  • [X] run brew doctor, fix all issues and try to reproduce your issue again
  • except, there are dozens of things being complained about, and none of them seem relevant to me
  • [X] run brew config and brew doctor and include their output

What you were trying to do

brew install emacs-plus@28 --with-native-comp --with-modern-doom3-icon

What happened (include command output)

$ brew install emacs-plus@28 --with-native-comp --with-modern-doom3-icon 
==> Downloading https://ftp.gnu.org/gnu/emacs/emacs-28.1.tar.xz
Already downloaded: /Users/greg/Library/Caches/Homebrew/downloads/81fae34a5dbd8042af6a70512829e9d4a11e31e7067bf4da5c5bded31f757129--emacs-28.1.tar.xz
==> Installing emacs-plus@28 from d12frosted/emacs-plus
tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
Error: Failure while executing; `tar --extract --no-same-owner --file /Users/greg/Library/Caches/Homebrew/downloads/81fae34a5dbd8042af6a70512829e9d4a11e31e7067bf4da5c5bded31f757129--emacs-28.1.tar.xz --directory /private/tmp/d20220726-18980-6dggq8` exited with 2. Here's the output:
tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
$
Command output

$ brew install emacs-plus@28 --with-native-comp --with-modern-doom3-icon ==> Downloading https://ftp.gnu.org/gnu/emacs/emacs-28.1.tar.xz Already downloaded: /Users/greg/Library/Caches/Homebrew/downloads/81fae34a5dbd8042af6a70512829e9d4a11e31e7067bf4da5c5bded31f757129--emacs-28.1.tar.xz ==> Installing emacs-plus@28 from d12frosted/emacs-plus tar (child): xz: Cannot exec: No such file or directory tar (child): Error is not recoverable: exiting now tar: Child returned status 2 tar: Error is not recoverable: exiting now Error: Failure while executing; tar --extract --no-same-owner --file /Users/greg/Library/Caches/Homebrew/downloads/81fae34a5dbd8042af6a70512829e9d4a11e31e7067bf4da5c5bded31f757129--emacs-28.1.tar.xz --directory /private/tmp/d20220726-18980-6dggq8 exited with 2. Here's the output: tar (child): xz: Cannot exec: No such file or directory tar (child): Error is not recoverable: exiting now tar: Child returned status 2 tar: Error is not recoverable: exiting now (mlenv) gregs-newbook:homebrew-core greg$

Output of brew config

$ brew config
HOMEBREW_VERSION: 3.5.6-47-g1af0bcd
ORIGIN: https://github.com/Homebrew/brew
HEAD: 1af0bcde2010db28c8f2e5d6433dc215b033006d
Last commit: 26 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 32a174609ecf962443c662f05be52c42264a9927
Core tap last commit: 4 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: vi
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.8 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.8_1/bin/ruby
CPU: octa-core 64-bit westmere
Clang: 13.1.6 build 1316
Git: 2.29.2 => /usr/local/bin/git
Curl: 7.79.1 => /usr/bin/curl
macOS: 12.5-x86_64
CLT: 13.4.0.0.1.1651278267
Xcode: N/A
Rosetta 2: true

Output of brew doctor

$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  ilmbase

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
  /usr/local/lib/libcord.1.dylib
  /usr/local/lib/libdvdcss.2.dylib
  /usr/local/lib/libffi.6.dylib
  /usr/local/lib/libgc.1.dylib
  /usr/local/lib/libgmp.10.dylib
  /usr/local/lib/libguile-2.2.1.dylib
  /usr/local/lib/libltdl.7.dylib
  /usr/local/lib/libnnz11.dylib
  /usr/local/lib/libociei.dylib
  /usr/local/lib/libocijdbc11.dylib
  /usr/local/lib/libunistring.2.dylib

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
  /usr/local/include/gc.h
  /usr/local/include/gc/cord.h
  /usr/local/include/gc/cord_pos.h
  /usr/local/include/gc/ec.h
  /usr/local/include/gc/gc.h
  /usr/local/include/gc/gc_backptr.h
  /usr/local/include/gc/gc_config_macros.h
  /usr/local/include/gc/gc_gcj.h
  /usr/local/include/gc/gc_inline.h
  /usr/local/include/gc/gc_mark.h
  /usr/local/include/gc/gc_pthread_redirects.h
  /usr/local/include/gc/gc_tiny_fl.h
  /usr/local/include/gc/gc_typed.h
  /usr/local/include/gc/gc_version.h
  /usr/local/include/gc/javaxfc.h
  /usr/local/include/gc/leak_detector.h
  /usr/local/include/gmp.h
  /usr/local/include/libltdl/lt_dlloader.h
  /usr/local/include/libltdl/lt_error.h
  /usr/local/include/libltdl/lt_system.h
  /usr/local/include/ltdl.h
  /usr/local/include/unicase.h
  /usr/local/include/uniconv.h
  /usr/local/include/unictype.h
  /usr/local/include/unigbrk.h
  /usr/local/include/unilbrk.h
  /usr/local/include/uniname.h
  /usr/local/include/uninorm.h
  /usr/local/include/unistdio.h
  /usr/local/include/unistr.h
  /usr/local/include/unistring/cdefs.h
  /usr/local/include/unistring/iconveh.h
  /usr/local/include/unistring/inline.h
  /usr/local/include/unistring/localcharset.h
  /usr/local/include/unistring/stdbool.h
  /usr/local/include/unistring/stdint.h
  /usr/local/include/unistring/version.h
  /usr/local/include/unistring/woe32dll.h
  /usr/local/include/unitypes.h
  /usr/local/include/uniwbrk.h
  /usr/local/include/uniwidth.h

Warning: Unbrewed '.la' files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected '.la' files:
  /usr/local/lib/libcord.la
  /usr/local/lib/libffi.la
  /usr/local/lib/libgc.la
  /usr/local/lib/libgmp.la
  /usr/local/lib/libguile-2.2.la
  /usr/local/lib/libltdl.la
  /usr/local/lib/libunistring.la

Warning: Unbrewed '.pc' files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected '.pc' files:
  /usr/local/lib/pkgconfig/bdw-gc.pc
  /usr/local/lib/pkgconfig/guile-2.2.pc
  /usr/local/lib/pkgconfig/libffi.pc

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
  /usr/local/lib/libffi.a
  /usr/local/lib/libgmp.a
  /usr/local/lib/libguile-2.2.a
  /usr/local/lib/libltdl.a
  /usr/local/lib/libunistring.a

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  libtool
  gmp
  w3m
  ghostscript
  libunistring
  bdw-gc
  emacs
  libdvdcss
  gawk
  autoconf

gcoladon avatar Jul 27 '22 02:07 gcoladon

I should add, xz is installed and working just fine:

$ which xz
/usr/local/bin/xz
$ xz --version
xz (XZ Utils) 5.2.5
liblzma 5.2.5
$

So, I'm really not sure why tar can't find it.

gcoladon avatar Jul 27 '22 03:07 gcoladon

Same problem:

$ brew install emacs-plus --with-native-comp --with-modern-doom3-icon
==> Downloading https://ftp.gnu.org/gnu/emacs/emacs-28.1.tar.xz
Already downloaded: /Users/ajl/Library/Caches/Homebrew/downloads/81fae34a5dbd8042af6a70512829e9d4a11e31e7067bf4da5c5bded31f757129--emacs-28.1.tar.xz
==> Installing emacs-plus@28 from d12frosted/emacs-plus
==> Patching
==> Applying fix-window-role.patch
patching file src/nsterm.m
Hunk #1 succeeded at 8583 (offset -185 lines).
==> Applying system-appearance.patch
patching file src/frame.h
patching file src/nsfns.m
Hunk #1 succeeded at 1315 (offset 59 lines).
patching file src/nsterm.m
Hunk #1 succeeded at 1878 (offset -11 lines).
Hunk #2 succeeded at 5389 (offset -6 lines).
Hunk #3 succeeded at 5635 (offset -6 lines).
Hunk #4 succeeded at 5685 (offset -6 lines).
Hunk #5 succeeded at 5911 (offset -6 lines).
Hunk #6 succeeded at 8916 (offset 14 lines).
Hunk #7 succeeded at 10072 (offset 14 lines).
==> Applying fix-MAC_LIBS-inference-on-Intel.patch
patching file configure.ac
Hunk #1 succeeded at 3843 (offset -282 lines).
==> ./autogen.sh
==> ./configure --enable-locallisppath=/opt/homebrew/share/emacs/site-lisp --infodir=/opt/homebrew/Cellar/emacs-plus@28/28.1/share/info/emacs --pre
==> gmake
==> gmake install
Last 15 lines from /Users/ajl/Library/Logs/Homebrew/emacs-plus@28/04.gmake:
usage: gzip [-vcD] [-1-9] [file ...]
usage: gzip [-vcD] [-1-9] [file ...]
usage: gzip [-vcD] [-1-9] [file ...]
usage: gzip [-vcD] [-1-9] [file ...]
usage: gzip [-vcD] [-1-9] [file ...]
usage: gzip [-vcD] [-1-9] [file ...]
usage: gzip [-vcD] [-1-9] [file ...]
usage: gzip [-vcD] [-1-9] [file ...]
usage: gzip [-vcD] [-1-9] [file ...]
usage: gzip [-vcD] [-1-9] [file ...]
usage: gzip [-vcD] [-1-9] [file ...]
usage: gzip [-vcD] [-1-9] [file ...]
usage: gzip [-vcD] [-1-9] [file ...]
usage: gzip [-vcD] [-1-9] [file ...]
gmake: *** [Makefile:605: install-arch-indep] Error 1

Do not report this issue to Homebrew/brew or Homebrew/core!

These open issues may also help:
Could not install emacs-plus@28 because tar can't find xz  https://github.com/d12frosted/homebrew-emacs-plus/issues/481
Could not install with ``brew install emacs-plus@29 --with-native-comp --with-elrumo2-icon`` https://github.com/d12frosted/homebrew-emacs-plus/issues/473

$ tar --version
tar (GNU tar) 1.34
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.

$ xz --version
xz (XZ Utils) 5.2.5
liblzma 5.2.5

$ which tar
/opt/homebrew/opt/gnu-tar/libexec/gnubin/tar

$ which xz
/opt/homebrew/bin/xz

$ sw_vers
ProductName:	macOS
ProductVersion:	12.4
BuildVersion:	21F79

$ brew --version
Homebrew 3.5.6
Homebrew/homebrew-core (git revision af6f88f21d5; last commit 2022-07-29)

ajlive avatar Jul 29 '22 22:07 ajlive

I got it easily fixed by

brew install xz

successfully built!

BonZai-y avatar Jul 30 '22 19:07 BonZai-y

When I tried that, I got

$ brew install xz 
Warning: xz 5.2.5_1 is already installed and up-to-date.
To reinstall 5.2.5_1, run:
  brew reinstall xz
$ 

When I reinstalled, I still got this error:

==> Installing emacs-plus@28 from d12frosted/emacs-plus
tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
Error: Failure while executing; `tar --extract --no-same-owner --file /Users/greg/Library/Caches/Homebrew/downloads/81fae34a5dbd8042af6a70512829e9d4a11e31e7067bf4da5c5bded31f757129--emacs-28.1.tar.xz --directory /private/tmp/d20220730-26659-hhpmbg` exited with 2. Here's the output:
tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

gcoladon avatar Jul 31 '22 04:07 gcoladon

Could the recipe go in two steps, first xz unzip the file, and then let tar take it from there?

Would it be straightforward for me to try to change the formula to do it this way, to see if it works?

gcoladon avatar Aug 01 '22 00:08 gcoladon

I think the most straightforward way to deal with it is to add xz to dependencies.

On Mon, Aug 1, 2022 at 03:27, Greg @.***> wrote:

Could the recipe go in two steps, first xz unzip the file, and then let tar take it from there?

Would it be straightforward for me to try to change the formula to do it this way, to see if it works?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were assigned.Message ID: @.***>

d12frosted avatar Aug 01 '22 04:08 d12frosted

@gcoladon I am not available till the next week, so don't have ability to create PR and properly test the fix. But in theory you just need to add xz as dependency in emacs-plus@29 like this:

https://github.com/d12frosted/homebrew-emacs-plus/blob/f6e6186eecfdaaa4f85783741b9457ee58c00318/Formula/emacs-plus%4029.rb#L30

In the worst case something like this is needed:

https://github.com/d12frosted/homebrew-emacs-plus/blob/f6e6186eecfdaaa4f85783741b9457ee58c00318/Formula/emacs-plus%4029.rb#L146

You can use --verbose flag to get some logs related to PATH manipulations in Emacs+29 formula.

d12frosted avatar Aug 04 '22 07:08 d12frosted

Thank you @d12frosted , I would be up for trying this but I have no idea how brew formulae work, so I don't know how to invoke my modified version of the formula once changed, but I don't want to waste your time by asking you more about how basic things in brew like this work.

gcoladon avatar Aug 06 '22 03:08 gcoladon

You can add depends_on "xz" => :build this to /Formula/[email protected] and run brew install --formula ./Formula/[email protected].

nstfkc avatar Aug 06 '22 15:08 nstfkc

I have this issue as well. I accidentally did an brew upgrade on both M1 and intel based Macbook and both aren't working now. Hopefully the fix gets pulled in soon.

kujohn avatar Aug 08 '22 23:08 kujohn

OK I added a dependency on xz to the formula, and it does in fact get past the 'can't find xz' problem. But now I'm getting this problem:

==> Patching
==> Applying fix-window-role.patch
patching file src/nsterm.m
Hunk #1 succeeded at 8583 (offset -185 lines).
==> Applying system-appearance.patch
patching file src/frame.h
patching file src/nsfns.m
Hunk #1 succeeded at 1315 (offset 59 lines).
patching file src/nsterm.m
Hunk #1 succeeded at 1878 (offset -11 lines).
Hunk #2 succeeded at 5389 (offset -6 lines).
Hunk #3 succeeded at 5635 (offset -6 lines).
Hunk #4 succeeded at 5685 (offset -6 lines).
Hunk #5 succeeded at 5911 (offset -6 lines).
Hunk #6 succeeded at 8916 (offset 14 lines).
Hunk #7 succeeded at 10072 (offset 14 lines).
==> ./autogen.sh
==> ./configure --enable-locallisppath=/usr/local/share/emacs/site-lisp --infodir=/usr/local/Cellar/emacs-plus@28/2
==> gmake
Last 15 lines from /Users/greg/Library/Logs/Homebrew/emacs-plus@28/03.gmake:
Loading loadup.el (source)...
Dump mode: pbootstrap
Using load-path (/private/tmp/emacs-plusA28-20220808-64118-f1dvd7/emacs-28.1/lisp /private/tmp/emacs-plusA28-20220808-64118-f1dvd7/emacs-28.1/lisp/emacs-lisp /private/tmp/emacs-plusA28-20220808-64118-f1dvd7/emacs-28.1/lisp/progmodes /private/tmp/emacs-plusA28-20220808-64118-f1dvd7/emacs-28.1/lisp/language /private/tmp/emacs-plusA28-20220808-64118-f1dvd7/emacs-28.1/lisp/international /private/tmp/emacs-plusA28-20220808-64118-f1dvd7/emacs-28.1/lisp/textmodes /private/tmp/emacs-plusA28-20220808-64118-f1dvd7/emacs-28.1/lisp/vc)
Loading emacs-lisp/byte-run...
Loading emacs-lisp/backquote...
Loading subr...
Loading version...
Loading widget...
Loading custom...
Loading emacs-lisp/map-ynp...
Loading international/mule...
Loading international/mule-conf...
gmake[1]: *** [Makefile:868: bootstrap-emacs.pdmp] Illegal instruction: 4
gmake[1]: Leaving directory '/private/tmp/emacs-plusA28-20220808-64118-f1dvd7/emacs-28.1/src'
gmake: *** [Makefile:449: src] Error 2

Do not report this issue to Homebrew/brew or Homebrew/core!

I will look around to see if this is another known problem there's a fix for.

gcoladon avatar Aug 09 '22 01:08 gcoladon

yes, after adding the xz dependency the problem goes away. Now I'm running into this issue #473 and hope that the fix will be merged soon to let me use native compilation again

ingorichter avatar Aug 09 '22 05:08 ingorichter

thanks to @vsinha it's in the master now.

d12frosted avatar Aug 09 '22 05:08 d12frosted

@gcoladon though I am not sure what is the reason for the last error you encountered since nativecomp is broken at the moment due to new gcc release, try building without it

d12frosted avatar Aug 09 '22 05:08 d12frosted

building without nativecomp is working for me now

ingorichter avatar Aug 09 '22 06:08 ingorichter

I get the Illegal Instruction error above when I try without native comp. When I try with native comp, I get

(mlenv) gregs-newbook:Formula greg$ # brew install --formula [email protected] --with-native-comp
...
checking for gcc_jit_context_acquire in -lgccjit... no
configure: error: ELisp native compiler was requested, but libgccjit was not found.
Please try installing libgccjit or a similar package.
If you are sure you want Emacs be compiled without ELisp native compiler,
pass the --without-native-compilation option to configure.

Do not report this issue to Homebrew/brew or Homebrew/core!

(mlenv) gregs-newbook:Formula greg$ brew install libgccjit
Warning: libgccjit 12.1.0 is already installed and up-to-date.
To reinstall 12.1.0, run:
  brew reinstall libgccjit
(mlenv) gregs-newbook:Formula greg$ 

gcoladon avatar Aug 09 '22 06:08 gcoladon

@gcoladon did you pull the changes from homebrew-emacs-plus? I see you manually pass the formula.

d12frosted avatar Aug 09 '22 06:08 d12frosted

@gcoladon did you pull the changes from homebrew-emacs-plus? I see you manually pass the formula.

Good point, I hadn't. When I try from outside the repo, it looks like its getting the new formula, but it has the old error:

(mlenv) gregs-newbook:~ greg$ brew install emacs-plus@28
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 3 taps (homebrew/cask-versions, homebrew/cask and d12frosted/emacs-plus).
==> New Casks
imhex

You have 29 outdated formulae and 2 outdated casks installed.
You can upgrade them with brew upgrade
or list them with brew outdated.

==> Downloading https://ftp.gnu.org/gnu/emacs/emacs-28.1.tar.xz
Already downloaded: /Users/greg/Library/Caches/Homebrew/downloads/81fae34a5dbd8042af6a70512829e9d4a11e31e7067bf4da5c5bded31f757129--emacs-28.1.tar.xz
==> Installing emacs-plus@28 from d12frosted/emacs-plus
tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
Error: Failure while executing; `tar --extract --no-same-owner --file /Users/greg/Library/Caches/Homebrew/downloads/81fae34a5dbd8042af6a70512829e9d4a11e31e7067bf4da5c5bded31f757129--emacs-28.1.tar.xz --directory /private/tmp/d20220808-81778-1e13jfp` exited with 2. Here's the output:
tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
(mlenv) gregs-newbook:~ greg$ 

gcoladon avatar Aug 09 '22 06:08 gcoladon

Do I need to brew upgrade emacs-plus@28 to get the recently updated formula? Nevermind, that didn't work since I don't have emacs-plus@28 installed.

gcoladon avatar Aug 09 '22 06:08 gcoladon

@gcoladon brew update should be enough. And I see it was run 🤔 not sure why you still see the error related to xz.

d12frosted avatar Aug 09 '22 06:08 d12frosted

As a workaround, can you please try removing this line and building again using brew install --formula [email protected]?

https://github.com/d12frosted/homebrew-emacs-plus/blob/e8da39f6abc3524871421f06244f0a726553517f/Formula/emacs-plus%4028.rb#L8

d12frosted avatar Aug 09 '22 07:08 d12frosted

OK, I tried that, I get the illegal instruction error:

$ git pull 
Fast-forward
 Formula/[email protected]                           |  3 ++-
 Formula/[email protected]                           |  2 ++
 .../emacs-28/fix-MAC_LIBS-inference-on-Intel.patch |  2 +-
 ...x-MAC_LIBS-inference-after-gcc-12-release.patch | 26 ++++++++++++++++++++++
 4 files changed, 31 insertions(+), 2 deletions(-)
$ grep env Formula/emacs-plus\@28.rb 
  env :std
$ vi Formula/emacs-plus\@28.rb 
$ grep env Formula/emacs-plus\@28.rb 
  # env :std
$ brew install --formula Formula/emacs-plus\@28.rb 
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
==> Updated Homebrew from 8e49be58b to ea981adf2.
Updated 3 taps (homebrew/core, homebrew/cask and d12frosted/emacs-plus).
==> New Casks
gittyup

You have 30 outdated formulae and 2 outdated casks installed.
You can upgrade them with brew upgrade
or list them with brew outdated.

==> Downloading https://ftp.gnu.org/gnu/emacs/emacs-28.1.tar.xz
Already downloaded: /Users/greg/Library/Caches/Homebrew/downloads/81fae34a5dbd8042af6a70512829e9d4a11e31e7067bf4da5c5bded31f757129--emacs-28.1.tar.xz
/usr/local/Homebrew/Library/Taps/d12frosted/homebrew-emacs-plus/Library/UrlResolver.rb:1: warning: already initialized constant TAP_OWNER
/Users/greg/homebrew-emacs-plus/Library/UrlResolver.rb:1: warning: previous definition of TAP_OWNER was here
/usr/local/Homebrew/Library/Taps/d12frosted/homebrew-emacs-plus/Library/UrlResolver.rb:2: warning: already initialized constant TAP_REPO
/Users/greg/homebrew-emacs-plus/Library/UrlResolver.rb:2: warning: previous definition of TAP_REPO was here
/usr/local/Homebrew/Library/Taps/d12frosted/homebrew-emacs-plus/Library/Icons.rb:1: warning: already initialized constant ICONS_CONFIG
/Users/greg/homebrew-emacs-plus/Library/Icons.rb:1: warning: previous definition of ICONS_CONFIG was here
==> Patching
==> Applying fix-window-role.patch
patching file src/nsterm.m
Hunk #1 succeeded at 8583 (offset -185 lines).
==> Applying system-appearance.patch
patching file src/frame.h
patching file src/nsfns.m
Hunk #1 succeeded at 1315 (offset 59 lines).
patching file src/nsterm.m
Hunk #1 succeeded at 1878 (offset -11 lines).
Hunk #2 succeeded at 5389 (offset -6 lines).
Hunk #3 succeeded at 5635 (offset -6 lines).
Hunk #4 succeeded at 5685 (offset -6 lines).
Hunk #5 succeeded at 5911 (offset -6 lines).
Hunk #6 succeeded at 8916 (offset 14 lines).
Hunk #7 succeeded at 10072 (offset 14 lines).
==> ./autogen.sh
==> ./configure --enable-locallisppath=/usr/local/share/emacs/site-lisp --infodi
==> gmake
Last 15 lines from /Users/greg/Library/Logs/Homebrew/emacs-plus@28/03.gmake:
Loading loadup.el (source)...
Dump mode: pbootstrap
Using load-path (/private/tmp/emacs-plusA28-20220809-83618-186l3zd/emacs-28.1/lisp /private/tmp/emacs-plusA28-20220809-83618-186l3zd/emacs-28.1/lisp/emacs-lisp /private/tmp/emacs-plusA28-20220809-83618-186l3zd/emacs-28.1/lisp/progmodes /private/tmp/emacs-plusA28-20220809-83618-186l3zd/emacs-28.1/lisp/language /private/tmp/emacs-plusA28-20220809-83618-186l3zd/emacs-28.1/lisp/international /private/tmp/emacs-plusA28-20220809-83618-186l3zd/emacs-28.1/lisp/textmodes /private/tmp/emacs-plusA28-20220809-83618-186l3zd/emacs-28.1/lisp/vc)
Loading emacs-lisp/byte-run...
Loading emacs-lisp/backquote...
Loading subr...
Loading version...
Loading widget...
Loading custom...
Loading emacs-lisp/map-ynp...
Loading international/mule...
Loading international/mule-conf...
gmake[1]: *** [Makefile:868: bootstrap-emacs.pdmp] Illegal instruction: 4
gmake[1]: Leaving directory '/private/tmp/emacs-plusA28-20220809-83618-186l3zd/emacs-28.1/src'
gmake: *** [Makefile:449: src] Error 2

Do not report this issue to Homebrew/brew or Homebrew/core!

$

I have no idea what to do about this illegal instruction thing.

In case I didn't state it clearly before, I am running on an Apple M1 Macbook Pro running Monterey 12.5.

gcoladon avatar Aug 09 '22 17:08 gcoladon

The emacs release notes contain this information Although the portable dumper has been tested, it may have a bug on unusual platforms. If you require traditional unexec dumping you can use the configure-time option '--with-dumping=unexec'; however, please file a bug report describing the situation, as unexec dumping is deprecated, and we plan on removing it in some future release.

I wonder if you would be able to build with --with-dumping=unexec. Perhaps M1 is an unusual platform

ingorichter avatar Aug 10 '22 18:08 ingorichter

I wonder if you would be able to build with --with-dumping=unexec. Perhaps M1 is an unusual platform

OK that's worth a try. Where would I put that flag? I can't just pass it to brew, and expect it to be passed along to configure, correct?

gcoladon avatar Aug 10 '22 19:08 gcoladon

you can install with options brew reinstall d12frosted/emacs-plus/emacs-plus@28 --with-dumping=unexec

ingorichter avatar Aug 10 '22 20:08 ingorichter

you can install with options brew reinstall d12frosted/emacs-plus/emacs-plus@28 --with-dumping=unexec

Brew's response to that command is

Error: invalid option: --with-dumping=unexec

gcoladon avatar Aug 10 '22 22:08 gcoladon

sigh, looks like that config option is not expose/available. My bad 👎 It's probably available for the emacs build scripts but it not passed along from brew

ingorichter avatar Aug 11 '22 02:08 ingorichter

@ingorichter yup, it's not exposed. But even more, --with-dumping=unexec is not valida in brew as far as I know. This is why we have separate options for each icon. E.g. instead of --with-icon=NAME we have --with-NAME-icon.

@gcoladon you can add extra options here:

https://github.com/d12frosted/homebrew-emacs-plus/blob/ecaf5a621d9eeee29ea66c7b2952b50055662cf0/Formula/emacs-plus%4029.rb#L105-L111

d12frosted avatar Aug 11 '22 06:08 d12frosted

@d12frosted I see now. The options need to be mapped from brew to the underlying emacs build script

ingorichter avatar Aug 11 '22 16:08 ingorichter

@d12frosted @ingorichter I tried added the --with-dumping=unexec flag to the formula but I got the same error:

$ git diff 
diff --git a/Formula/[email protected] b/Formula/[email protected]
index 9bceb8c..7eea4dc 100644
--- a/Formula/[email protected]
+++ b/Formula/[email protected]
@@ -5,7 +5,7 @@ class EmacsPlusAT28 < EmacsBase
   url "https://ftp.gnu.org/gnu/emacs/emacs-28.1.tar.xz"
   mirror "https://ftpmirror.gnu.org/emacs/emacs-28.1.tar.xz"
   sha256 "28b1b3d099037a088f0a4ca251d7e7262eab5ea1677aabffa6c4426961ad75e1"
-  env :std
+  # env :std
 
   head do
     url "https://github.com/emacs-mirror/emacs.git", :branch => "emacs-28"
@@ -110,6 +110,7 @@ class EmacsPlusAT28 < EmacsBase
       --enable-locallisppath=#{HOMEBREW_PREFIX}/share/emacs/site-lisp
       --infodir=#{info}/emacs
       --prefix=#{prefix}
+      --with-dumping=unexec
     ]
 
     args << "--with-xml2"
$ brew install --formula Formula/emacs-plus\@28.rb 
==> Downloading https://ftp.gnu.org/gnu/emacs/emacs-28.1.tar.xz
==> Patching
==> Applying fix-window-role.patch
patching file src/nsterm.m
Hunk #1 succeeded at 8583 (offset -185 lines).
==> Applying system-appearance.patch
patching file src/frame.h
patching file src/nsfns.m
Hunk #1 succeeded at 1315 (offset 59 lines).
patching file src/nsterm.m
Hunk #1 succeeded at 1878 (offset -11 lines).
Hunk #2 succeeded at 5389 (offset -6 lines).
Hunk #3 succeeded at 5635 (offset -6 lines).
Hunk #4 succeeded at 5685 (offset -6 lines).
Hunk #5 succeeded at 5911 (offset -6 lines).
Hunk #6 succeeded at 8916 (offset 14 lines).
Hunk #7 succeeded at 10072 (offset 14 lines).
==> ./autogen.sh
==> ./configure --enable-locallisppath=/usr/local/share/emacs/site-lisp --infodi
==> gmake
Last 15 lines from /Users/greg/Library/Logs/Homebrew/emacs-plus@28/03.gmake:
Loading loadup.el (source)...
Dump mode: bootstrap
Using load-path (/private/tmp/emacs-plusA28-20220813-7519-fguxrk/emacs-28.1/lisp /private/tmp/emacs-plusA28-20220813-7519-fguxrk/emacs-28.1/lisp/emacs-lisp /private/tmp/emacs-plusA28-20220813-7519-fguxrk/emacs-28.1/lisp/progmodes /private/tmp/emacs-plusA28-20220813-7519-fguxrk/emacs-28.1/lisp/language /private/tmp/emacs-plusA28-20220813-7519-fguxrk/emacs-28.1/lisp/international /private/tmp/emacs-plusA28-20220813-7519-fguxrk/emacs-28.1/lisp/textmodes /private/tmp/emacs-plusA28-20220813-7519-fguxrk/emacs-28.1/lisp/vc)
Loading emacs-lisp/byte-run...
Loading emacs-lisp/backquote...
Loading subr...
Loading version...
Loading widget...
Loading custom...
Loading emacs-lisp/map-ynp...
Loading international/mule...
Loading international/mule-conf...
gmake[1]: *** [Makefile:852: bootstrap-emacs] Illegal instruction: 4
gmake[1]: Leaving directory '/private/tmp/emacs-plusA28-20220813-7519-fguxrk/emacs-28.1/src'
gmake: *** [Makefile:449: src] Error 2

Do not report this issue to Homebrew/brew or Homebrew/core!

$ 

Any more ideas I can try?

gcoladon avatar Aug 13 '22 19:08 gcoladon