Homebrew-emacs-plus: Could not install with brew install emacs-plus@28 --without-imagemagick --with-no-titlebar

Created on 27 Dec 2020  ·  10Comments  ·  Source: d12frosted/homebrew-emacs-plus

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
  • [ x ] run brew config and brew doctor and include their output

What you were trying to do

Tried to do an install of emacs28 with --without-imagemagick and --with-no-titlebar. I think there might have been a timeout?

What happened (include command output)

$ brew install emacs-plus@28 --with-no-titlebar --with-modern-sexy-v1-icon --without-imagemagick


Command output

Your branch is up to date with 'origin/master'.
HEAD is now at 714ca84 Improve the edebug-form-data doc string
==> Patching
==> Applying no-titlebar.patch
patching file src/nsterm.m
Hunk #1 succeeded at 453 (offset -20 lines).
Hunk #2 succeeded at 1964 (offset -19 lines).
Hunk #3 succeeded at 7568 (offset 31 lines).
Hunk #4 succeeded at 7605 with fuzz 1 (offset 30 lines).
==> Applying fix-window-role.patch
patching file src/nsterm.m
Hunk #1 succeeded at 8773 (offset 5 lines).
==> Applying system-appearance.patch
patching file src/frame.h
patching file src/nsfns.m
Hunk #1 succeeded at 1251 (offset -2 lines).
patching file src/nsterm.m
Hunk #1 succeeded at 2179 (offset -15 lines).
Hunk #2 succeeded at 5734 (offset -17 lines).
Hunk #3 succeeded at 5980 (offset -17 lines).
Hunk #4 succeeded at 6030 (offset -17 lines).
Hunk #5 succeeded at 6256 (offset -17 lines).
Hunk #6 succeeded at 9104 (offset -28 lines).
Hunk #7 succeeded at 9986 (offset -28 lines).
==> ./autogen.sh
==> ./configure --enable-locallisppath=/opt/homebrew/share/emacs/site-lisp --infodir=/opt/h
==> make
Last 15 lines from /Users/derp/Library/Logs/Homebrew/emacs-plus@28/03.make:
clang -o temacs.tmp
-Demacs -I. -I. -I../lib -I../lib -I/opt/homebrew/Cellar/libffi/3.3/include -I/opt/homebrew/Cellar/libpng/1.6.37/include/libpng16 -I/opt/homebrew/opt/freetype/include/freetype2 -I/opt/homebrew/Cellar/fontconfig/2.13.1/include -I/opt/homebrew/Cellar/pcre/8.44/include -I/opt/homebrew/Cellar/glib/2.66.4/include -I/opt/homebrew/Cellar/glib/2.66.4/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.66.4/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pixman/0.40.0/include/pixman-1 -I/opt/homebrew/Cellar/cairo/1.16.0_3/include/cairo -I/opt/homebrew/Cellar/gdk-pixbuf/2.42.2/include/gdk-pixbuf-2.0 -I/opt/homebrew/Cellar/librsvg/2.50.2/include/librsvg-2.0 -I/opt/homebrew/Cellar/libpng/1.6.37/include/libpng16 -I/opt/homebrew/Cellar/little-cms2/2.11/include -MMD -MF deps/.d -MP -I/opt/homebrew/Cellar/jansson/2.13.1/include -I/opt/homebrew/Cellar/libidn2/2.3.0/include -I/opt/homebrew/Cellar/libtasn1/4.16.0/include -I/opt/homebrew/Cellar/nettle/3.6/include -I/opt/homebrew/Cellar/p11-kit/0.23.22/include/p11-kit-1 -I/opt/homebrew/Cellar/gnutls/3.6.15/include -Wno-switch -Wno-pointer-sign -Wno-string-plus-int -Wno-unknown-attributes -Wno-initializer-overrides -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -g3 -O2 -framework AppKit -framework IOKit -framework Carbon
dispnew.o frame.o scroll.o xdisp.o menu.o window.o charset.o coding.o category.o ccl.o character.o chartab.o bidi.o cm.o term.o terminal.o xfaces.o emacs.o keyboard.o macros.o keymap.o sysdep.o bignum.o buffer.o filelock.o insdel.o marker.o minibuf.o fileio.o dired.o cmds.o casetab.o casefiddle.o indent.o search.o regex-emacs.o undo.o alloc.o pdumper.o data.o doc.o editfns.o callint.o eval.o floatfns.o fns.o font.o print.o lread.o dynlib.o emacs-module.o syntax.o bytecode.o process.o gnutls.o callproc.o region-cache.o sound.o timefns.o atimer.o doprnt.o intervals.o textprop.o composite.o xml.o lcms.o kqueue.o profiler.o decompress.o thread.o systhread.o fontset.o fringe.o image.o json.o nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o macfont.o terminfo.o lastfile.o ../lib/libgnu.a -ltiff -ljpeg -L/opt/homebrew/Cellar/libpng/1.6.37/lib -lpng16 -lz -L/opt/homebrew/Cellar/glib/2.66.4/lib -L/opt/homebrew/opt/gettext/lib -L/opt/homebrew/Cellar/cairo/1.16.0_3/lib -L/opt/homebrew/Cellar/gdk-pixbuf/2.42.2/lib -L/opt/homebrew/Cellar/librsvg/2.50.2/lib -lrsvg-2 -lm -lgio-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lcairo -lxml2 -lncurses -L/opt/homebrew/Cellar/gnutls/3.6.15/lib -lgnutls -L/opt/homebrew/Cellar/little-cms2/2.11/lib -llcms2 -lz -L/opt/homebrew/Cellar/jansson/2.13.1/lib -ljansson -lgmp
../lib-src/make-fingerprint temacs.tmp
mv temacs.tmp temacs
../build-aux/install-sh -c -d ../etc
/Library/Developer/CommandLineTools/usr/bin/make -C ../lisp update-subdirs
for file in . ./calc ./calendar ./emacs-lisp ./emulation ./erc ./eshell ./gnus ./image ./international ./language ./mail ./mh-e ./net ./nxml ./obsolete ./org ./play ./progmodes ./term ./textmodes ./url ./vc; do
./../build-aux/update-subdirs $file;
done;
cp -f temacs bootstrap-emacs
rm -f bootstrap-emacs.pdmp
./temacs --batch -l loadup --temacs=pbootstrap
make[1]: * [bootstrap-emacs.pdmp] Killed: 9
make: *
[src] Error 2


Output of brew config

$ brew config
HOMEBREW_VERSION: 2.7.0
ORIGIN: https://github.com/Homebrew/brew
HEAD: 993bf95877143afe1cede022083499e0b4fe336c
Last commit: 6 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: b54627ecb76a0fc48ea5cd97a82fd1ba1daae0e5
Core tap last commit: 32 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 12.0 build 1200
Git: 2.24.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.0-arm64
CLT: 12.3.0.0.1.1607026830
Xcode: N/A
Rosetta 2: false

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: You are running macOS on a arm64 CPU architecture.
We do not provide support for this (yet).
Reinstall Homebrew under Rosetta 2 until we support it.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this
unsupported configuration.
install error

Most helpful comment

Fix is in the master branch. Emacs 28.0.50 compiles just fine on Apple Silicon now.

brew install emacs-plus@28 --with-no-titlebar --without-imagemagick
GNU Emacs 28.0.50 (build 1, aarch64-apple-darwin20.2.0, NS appkit-2022.20 Version 11.1 (Build 20C69)) of 2020-12-29

All 10 comments

🤔 maybe you should retry. I just tested it on CI and it builds. There is an error regarding test dependencies in the test step, but ignore that, the most important part there is successful installation 😸

I see the same error locally on Apple Silicon:

./temacs --batch  -l loadup --temacs=pbootstrap
make[1]: *** [bootstrap-emacs.pdmp] Killed: 9
make: *** [src] Error 2

And @miiwo uses macOS: 11.0-arm64 with M1 chip as well according to the brew config output. So, I believe this is an issue with arm64 in the current Emacs master. It was compiling properly a few days ago.

I tried to debug the problem, it seems that there is a problem with search-slow-speed symbol.

(lldb) process launch
Process 75320 launched: '/Users/dive/Projects/emacs/src/temacs' (arm64)
Loading loadup.el (source)...
...
Eager macro-expansion failure: (void-variable search-slow-speed)
Eager macro-expansion failure: (void-variable search-slow-speed)
Symbol’s value as variable is void: search-slow-speed
Process 75320 exited with status = 255 (0x000000ff) 

The problem was introduced in the Merge from origin/emacs-27 #90ec81f5b2, the last working commit is Merge from origin/emacs-27 #2e20749e57. It seems that this is the source of the problem:

diff --git a/src/Makefile.in b/src/Makefile.in
index 39c0f12fe6..19304cca04 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -338,7 +338,7 @@ HAVE_PDUMPER = @HAVE_PDUMPER@

 ## ARM Macs require that all code have a valid signature.  Since pump
 ## invalidates the signature, we must re-sign to fix it.
-DO_CODESIGN=$(patsubst aarch64-apple-darwin%,yes,@configuration@)
+DO_CODESIGN=$(patsubst arm-apple-darwin%,yes,@configuration@)

Reported to Emacs bug tracker – #45455.

@dive thank you very much for taking your time to debug the problem and to report it!

Fix is in the master branch. Emacs 28.0.50 compiles just fine on Apple Silicon now.

brew install emacs-plus@28 --with-no-titlebar --without-imagemagick
GNU Emacs 28.0.50 (build 1, aarch64-apple-darwin20.2.0, NS appkit-2022.20 Version 11.1 (Build 20C69)) of 2020-12-29

@dive did you have to change anything else in your setup? Is there a dependency I'm not thinking about? brew install emacs-plus@28 --with-no-titlebar --without-imagemagick still fails with the same error for me.

brew config:

HOMEBREW_VERSION: 3.0.1
ORIGIN: https://github.com/Homebrew/brew
HEAD: c951be8d3c7b339c7e759b7c40aec859e09a70a5
Last commit: 2 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: a74c40ea9c578bf9ade97a8f003ad0ac5b6eb7bb
Core tap last commit: 38 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 12.0 build 1200
Git: 2.24.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.2.1-arm64
CLT: 12.4.0.0.1.1610135815
Xcode: 12.4
XQuartz: 2.7.11 => /opt/X11
Rosetta 2: false

@cacology, I did not. Just checked, everything works fine on my side with the same brew config. The only difference I see in the brew configuration is that CLT is not available in my case, and brew uses Xcode 12.4 directly.

% brew config                                                                                                                                                  master
HOMEBREW_VERSION: 3.0.1
...
CLT: N/A
Xcode: 12.4 => /Volumes/Extended/Archives/Xcode_12.4.app/Contents/Developer
Rosetta 2: false
$ brew install emacs-plus@28 --with-no-titlebar --without-imagemagick
...
==> Patching
==> Applying no-titlebar.patch
patching file src/nsterm.m
Hunk #1 succeeded at 441 (offset -32 lines).
Hunk #2 succeeded at 1957 (offset -26 lines).
Hunk #3 succeeded at 7503 (offset -34 lines).
Hunk #4 succeeded at 7540 with fuzz 1 (offset -35 lines).
==> Applying fix-window-role.patch
patching file src/nsterm.m
Hunk #1 succeeded at 8818 (offset 50 lines).
==> Applying system-appearance.patch
patching file src/frame.h
patching file src/nsfns.m
Hunk #1 succeeded at 1277 (offset 24 lines).
patching file src/nsterm.m
Hunk #1 succeeded at 2172 (offset -22 lines).
Hunk #2 succeeded at 5668 (offset -83 lines).
Hunk #3 succeeded at 5914 (offset -83 lines).
Hunk #4 succeeded at 5964 (offset -83 lines).
Hunk #5 succeeded at 6190 (offset -83 lines).
Hunk #6 succeeded at 9149 (offset 17 lines).
Hunk #7 succeeded at 10235 (offset 221 lines).
==> ./autogen.sh
==> ./configure --enable-locallisppath=/opt/homebrew/share/emacs/site-lisp --infodir=/opt/homebrew/Cellar/emacs-plus@28/28.0.50/share/info/emacs --prefix=/opt/homebrew/Cellar/emacs
==> make
==> make install
...
==> Summary
🍺  /opt/homebrew/Cellar/emacs-plus@28/28.0.50: 4,045 files, 132.8MB, built in 4 minutes 2 seconds

Thank you @dive. Your response suggested my install was borked in some way, which turns out it was. I reinstalled XCode and CLT from developer.apple.com (rather than app store), dumped a Brewfile, uninstalled ARM Homebrew, reinstalled ARM Homebrew, reinstalled the Brewfile, and now it compiles just fine. I bet I didn't have to reinstall XCode, but I'm still recording this solution in case it helps someone else.

Had this problem as well on 11.2.1. Just want to confirm that I was able to use @cacology's steps without reinstalling Xcode or CLT and it was fixed.

So, dumped a Brewfile, uninstalled ARM Homebrew, installed ARM Homebrew, and reinstalling the Brewfile fixed the issue for me.

@dive @cacology @red-scott thanks for solution and validation of that solution 🎉

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oguzserbetci picture oguzserbetci  ·  4Comments

frankjonen picture frankjonen  ·  3Comments

jonathanj picture jonathanj  ·  3Comments

glepnir picture glepnir  ·  6Comments

paulhenrich picture paulhenrich  ·  8Comments