d12frosted / homebrew-emacs-plus

Emacs Plus formulae for the Homebrew package manager
MIT License
2.38k stars 187 forks source link

[Build Failure]: #750

Closed aaronjensen closed 1 week ago

aaronjensen commented 1 week ago

Version

emacs-plus@30

Make sure to follow these steps before submitting the issue

What happened?

$ brew install emacs-plus@31 --with-native-comp --with-c9rgreen-sonoma-icon
Command output

==> Fetching d12frosted/emacs-plus/emacs-plus@31
==> Cloning https://github.com/emacs-mirror/emacs.git
Updating /Users/aaronjensen/Library/Caches/Homebrew/emacs-plus@31--git
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
HEAD is now at 6ddbe8c7010 * src/w32fns.c (process_dropfiles): Fix cygw32 build (bug#74312).
==> Installing emacs-plus@31 from d12frosted/emacs-plus
==> Patching
==> Applying fix-window-role.patch
==> Applying system-appearance.patch
==> Applying round-undecorated-frame.patch
==> ./autogen.sh
==> ./configure --disable-silent-rules --enable-locallisppath=/opt/homebrew/shar
==> gmake
Last 15 lines from /Users/aaronjensen/Library/Logs/Homebrew/emacs-plus@31/03.gmake:
gmake[1]: *** Waiting for unfinished jobs....
gmake[2]: Leaving directory '/private/var/tmp/emacs-plusA31-20241111-83158-c1cng0/doc/lispref'
gmake[1]: Leaving directory '/private/var/tmp/emacs-plusA31-20241111-83158-c1cng0'
gmake[1]: Entering directory '/private/var/tmp/emacs-plusA31-20241111-83158-c1cng0'
***
*** "make all" failed with exit status 2.
***
*** You could try to:
*** - run "make bootstrap", which might fix the problem
*** - run "make V=1", which displays the full commands invoked by make,
***   to further investigate the problem
***
gmake[1]: *** [Makefile:418: advice-on-failure] Error 2
gmake[1]: Leaving directory '/private/var/tmp/emacs-plusA31-20241111-83158-c1cng0'
gmake: *** [Makefile:374: all] Error 2

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/d12frosted/homebrew-emacs-plus/issues
  
End of gmake log

Undefined symbols for architecture arm64:
  "_sqlite3_load_extension", referenced from:
      _Fsqlite_load_extension in sqlite.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [Makefile:745: temacs] Error 1
gmake[2]: Leaving directory '/private/var/tmp/emacs-plusA31-20241111-83158-c1cng0/src'
gmake[1]: *** [Makefile:554: src] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake[2]: Leaving directory '/private/var/tmp/emacs-plusA31-20241111-83158-c1cng0/doc/lispref'
gmake[1]: Leaving directory '/private/var/tmp/emacs-plusA31-20241111-83158-c1cng0'
gmake[1]: Entering directory '/private/var/tmp/emacs-plusA31-20241111-83158-c1cng0'
***
*** "make all" failed with exit status 2.
***
*** You could try to:
*** - run "make bootstrap", which might fix the problem
*** - run "make V=1", which displays the full commands invoked by make,
***   to further investigate the problem
***
gmake[1]: *** [Makefile:418: advice-on-failure] Error 2
gmake[1]: Leaving directory '/private/var/tmp/emacs-plusA31-20241111-83158-c1cng0'
gmake: *** [Makefile:374: all] Error 2

HOMEBREW_VERSION: 4.4.5
ORIGIN: https://github.com/Homebrew/brew
HEAD: 254bf3fe9d8fa2e1b2fb55dbcf535b2d870180c4
Last commit: 19 hours ago
Core tap JSON: 12 Nov 06:11 UTC
Core cask tap JSON: 12 Nov 06:11 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: ["--appdir=/Applications"]
HOMEBREW_EDITOR: e
HOMEBREW_MAKE_JOBS: 16
HOMEBREW_NO_BOOTSNAP: set
HOMEBREW_TEMP: /private/var/tmp
Homebrew Ruby: 3.3.6 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/bin/ruby
CPU: 16-core 64-bit dunno
Clang: 16.0.0 build 1600
Git: 2.47.0 => /opt/homebrew/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 15.1-arm64
CLT: 16.1.0.0.1.1729049160
Xcode: N/A
Rosetta 2: false

HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
CFLAGS: -O2 -DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT -I/opt/homebrew/opt/gcc/include -I/opt/homebrew/opt/libgccjit/include
LDFLAGS: -L/opt/homebrew/lib/gcc/14 -I/opt/homebrew/opt/gcc/include -I/opt/homebrew/opt/libgccjit/include
MAKEFLAGS: -j16
CMAKE_PREFIX_PATH: /opt/homebrew/opt/m4:/opt/homebrew/opt/readline:/opt/homebrew/opt/sqlite:/opt/homebrew/opt/icu4c@76:/opt/homebrew/opt/jpeg:/opt/homebrew/opt/zlib:/opt/homebrew
CMAKE_INCLUDE_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
CMAKE_FRAMEWORK_PATH: /opt/homebrew/opt/python@3.13/Frameworks
PKG_CONFIG_PATH: /opt/homebrew/opt/pkgconf/lib/pkgconfig:/opt/homebrew/opt/xz/lib/pkgconfig:/opt/homebrew/opt/gmp/lib/pkgconfig:/opt/homebrew/opt/libidn2/lib/pkgconfig:/opt/homebrew/opt/libtasn1/lib/pkgconfig:/opt/homebrew/opt/nettle/lib/pkgconfig:/opt/homebrew/opt/p11-kit/lib/pkgconfig:/opt/homebrew/opt/openssl@3/lib/pkgconfig:/opt/homebrew/opt/libevent/lib/pkgconfig:/opt/homebrew/opt/libnghttp2/lib/pkgconfig:/opt/homebrew/opt/unbound/lib/pkgconfig:/opt/homebrew/opt/gnutls/lib/pkgconfig:/opt/homebrew/opt/libpng/lib/pkgconfig:/opt/homebrew/opt/freetype/lib/pkgconfig:/opt/homebrew/opt/fontconfig/lib/pkgconfig:/opt/homebrew/opt/pcre2/lib/pkgconfig:/opt/homebrew/opt/mpdecimal/lib/pkgconfig:/opt/homebrew/opt/readline/lib/pkgconfig:/opt/homebrew/opt/sqlite/lib/pkgconfig:/opt/homebrew/opt/python@3.13/lib/pkgconfig:/opt/homebrew/opt/glib/lib/pkgconfig:/opt/homebrew/opt/libxau/lib/pkgconfig:/opt/homebrew/opt/libxdmcp/lib/pkgconfig:/opt/homebrew/opt/libxcb/lib/pkgconfig:/opt/homebrew/opt/libx11/lib/pkgconfig:/opt/homebrew/opt/libxext/lib/pkgconfig:/opt/homebrew/opt/libxrender/lib/pkgconfig:/opt/homebrew/opt/lzo/lib/pkgconfig:/opt/homebrew/opt/pixman/lib/pkgconfig:/opt/homebrew/opt/cairo/lib/pkgconfig:/opt/homebrew/opt/jpeg-turbo/lib/pkgconfig:/opt/homebrew/opt/lz4/lib/pkgconfig:/opt/homebrew/opt/zstd/lib/pkgconfig:/opt/homebrew/opt/libtiff/lib/pkgconfig:/opt/homebrew/opt/gdk-pixbuf/lib/pkgconfig:/opt/homebrew/opt/fribidi/lib/pkgconfig:/opt/homebrew/opt/graphite2/lib/pkgconfig:/opt/homebrew/opt/icu4c@76/lib/pkgconfig:/opt/homebrew/opt/harfbuzz/lib/pkgconfig:/opt/homebrew/opt/pango/lib/pkgconfig:/opt/homebrew/opt/librsvg/lib/pkgconfig:/opt/homebrew/opt/little-cms2/lib/pkgconfig:/opt/homebrew/opt/jansson/lib/pkgconfig:/opt/homebrew/opt/tree-sitter/lib/pkgconfig:/opt/homebrew/opt/webp/lib/pkgconfig:/opt/homebrew/opt/isl/lib/pkgconfig:/opt/homebrew/opt/mpfr/lib/pkgconfig:/opt/homebrew/opt/jpeg/lib/pkgconfig:/opt/homebrew/opt/zlib/lib/pkgconfig:/opt/homebrew/opt/xorgproto/share/pkgconfig
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/opt/homebrew/Library/Homebrew/os/mac/pkgconfig/15
HOMEBREW_MAKE_JOBS: 16
HOMEBREW_GIT: git
HOMEBREW_SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk
ACLOCAL_PATH: /opt/homebrew/share/aclocal
PATH: /opt/homebrew/Library/Homebrew/shims/mac/super:/opt/homebrew/opt/make/bin:/opt/homebrew/opt/autoconf/bin:/opt/homebrew/opt/gnu-sed/bin:/opt/homebrew/opt/gnu-tar/bin:/opt/homebrew/opt/grep/bin:/opt/homebrew/opt/awk/bin:/opt/homebrew/opt/coreutils/bin:/opt/homebrew/opt/pkgconf/bin:/opt/homebrew/opt/texinfo/bin:/opt/homebrew/opt/xz/bin:/opt/homebrew/opt/m4/bin:/opt/homebrew/opt/gettext/bin:/opt/homebrew/opt/libidn2/bin:/opt/homebrew/opt/libtasn1/bin:/opt/homebrew/opt/nettle/bin:/opt/homebrew/opt/p11-kit/bin:/opt/homebrew/opt/openssl@3/bin:/opt/homebrew/opt/libevent/bin:/opt/homebrew/opt/gnutls/bin:/opt/homebrew/opt/libpng/bin:/opt/homebrew/opt/freetype/bin:/opt/homebrew/opt/fontconfig/bin:/opt/homebrew/opt/pcre2/bin:/opt/homebrew/opt/sqlite/bin:/opt/homebrew/opt/python@3.13/bin:/opt/homebrew/opt/glib/bin:/opt/homebrew/opt/cairo/bin:/opt/homebrew/opt/jpeg-turbo/bin:/opt/homebrew/opt/lz4/bin:/opt/homebrew/opt/zstd/bin:/opt/homebrew/opt/libtiff/bin:/opt/homebrew/opt/gdk-pixbuf/bin:/opt/homebrew/opt/fribidi/bin:/opt/homebrew/opt/graphite2/bin:/opt/homebrew/opt/icu4c@76/bin:/opt/homebrew/opt/harfbuzz/bin:/opt/homebrew/opt/pango/bin:/opt/homebrew/opt/librsvg/bin:/opt/homebrew/opt/little-cms2/bin:/opt/homebrew/opt/tree-sitter/bin:/opt/homebrew/opt/giflib/bin:/opt/homebrew/opt/webp/bin:/opt/homebrew/opt/gcc/bin:/opt/homebrew/opt/jpeg/bin:/opt/homebrew/opt/python@3.13/libexec/bin:/usr/bin:/bin:/usr/sbin:/sbin

brew doctor output

Your system is ready to brew.

brew config output

HOMEBREW_VERSION: 4.4.5 ORIGIN: https://github.com/Homebrew/brew HEAD: 254bf3fe9d8fa2e1b2fb55dbcf535b2d870180c4 Last commit: 19 hours ago Core tap JSON: 12 Nov 06:11 UTC Core cask tap JSON: 12 Nov 06:11 UTC HOMEBREW_PREFIX: /opt/homebrew HOMEBREW_CASK_OPTS: ["--appdir=/Applications"] HOMEBREW_EDITOR: e HOMEBREW_MAKE_JOBS: 16 HOMEBREW_TEMP: /var/tmp Homebrew Ruby: 3.3.6 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/bin/ruby CPU: 16-core 64-bit dunno Clang: 16.0.0 build 1600 Git: 2.47.0 => /opt/homebrew/bin/git Curl: 8.7.1 => /usr/bin/curl macOS: 15.1-arm64 CLT: 16.1.0.0.1.1729049160 Xcode: N/A Rosetta 2: false

Any extra information

Brand new laptop.

d12frosted commented 1 week ago
Undefined symbols for architecture arm64:
"_sqlite3_load_extension", referenced from:
_Fsqlite_load_extension in sqlite.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Ooof, initially I thought that it could be an upstream issue. But then I though - do you have sqlite3 installed? We don't have it as a dependency, and this is a fresh install. So maybe that's the reason. For sqlite extensions you need at least 3.13 version (afaik).

aaronjensen commented 1 week ago

I actually do have it installed. Adding it as a dependency doesn't work either. 30 doesn't build either.

d12frosted commented 1 week ago

That's strange. What if you disable native comp?

aaronjensen commented 1 week ago

That doesn't help. I've got two machines here I can't build it on. One I built it on a couple days ago. Both are M4 MacBook Pros.

aaronjensen commented 1 week ago

Oh, and I can build it from source just fine manually with --with-sqlite3

d12frosted commented 1 week ago

What version of SQLite do you have?

aaronjensen commented 1 week ago
==> sqlite: stable 3.47.0 (bottled) [keg-only]
Command-line interface for SQLite
https://sqlite.org/index.html
Installed
/opt/homebrew/Cellar/sqlite/3.47.0 (12 files, 4.9MB)
  Poured from bottle using the formulae.brew.sh API on 2024-11-11 at 22:03:20
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/s/sqlite.rb
aaronjensen commented 1 week ago

Not sure if it's of note or not, but the cmake command from my gmake log looks like this:

clang -o temacs.tmp \
  -Demacs  -I. -I. -I../lib -I../lib      -isystem /opt/homebrew/Cellar/librsvg/2.58.4/include/librsvg-2.0 -isystem /opt/homebrew/Cellar/gdk-pixbuf/2.42.12/include/gdk-pixbuf-2.0 -isystem /opt/homebrew/Cellar/libtiff/4.7.0/include -isystem /opt/homebrew/opt/zstd/include -isystem /opt/homebrew/Cellar/xz/5.6.3/include -isystem /opt/homebrew/Cellar/jpeg-turbo/3.0.4/include -isystem /opt/homebrew/Cellar/glib/2.82.2/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/ffi -isystem /opt/homebrew/Cellar/glib/2.82.2/include/glib-2.0 -isystem /opt/homebrew/Cellar/glib/2.82.2/lib/glib-2.0/include -isystem /opt/homebrew/opt/gettext/include -isystem /opt/homebrew/Cellar/pcre2/10.44/include -isystem /opt/homebrew/Cellar/cairo/1.18.2/include/cairo -isystem /opt/homebrew/Cellar/fontconfig/2.15.0/include -isystem /opt/homebrew/opt/freetype/include/freetype2 -isystem /opt/homebrew/opt/libpng/include/libpng16 -isystem /opt/homebrew/opt/zlib/include -isystem /opt/homebrew/Cellar/libxext/1.3.6/include -isystem /opt/homebrew/Cellar/xorgproto/2024.1/include -isystem /opt/homebrew/Cellar/libxrender/0.9.11/include -isystem /opt/homebrew/Cellar/libx11/1.8.10/include -isystem /opt/homebrew/Cellar/libxcb/1.17.0/include -isystem /opt/homebrew/Cellar/libxau/1.0.11/include -isystem /opt/homebrew/Cellar/libxdmcp/1.1.5/include -isystem /opt/homebrew/Cellar/pixman/0.44.0/include/pixman-1  -isystem /opt/homebrew/opt/libpng/include/libpng16 -isystem /opt/homebrew/opt/zlib/include         -isystem /opt/homebrew/Cellar/webp/1.4.0/include -isystem /opt/homebrew/Cellar/webp/1.4.0/include/webp  -isystem /opt/homebrew/Cellar/little-cms2/2.16/include       -MMD -MF deps/.d -MP   -isystem /opt/homebrew/Cellar/tree-sitter/0.24.4/include -isystem /opt/homebrew/Cellar/gnutls/3.8.4/include -isystem /opt/homebrew/Cellar/nettle/3.10/include -isystem /opt/homebrew/Cellar/libtasn1/4.19.0/include -isystem /opt/homebrew/Cellar/libidn2/2.3.7/include -isystem /opt/homebrew/Cellar/p11-kit/0.25.5/include/p11-kit-1 -isystem /opt/homebrew/opt/zlib/include              -Wall -Wdate-time -Wdisabled-optimization -Wextra -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-variable-declarations -Wnested-externs -Wnull-dereference -Wold-style-definition -Wpacked -Wpointer-arith -Wstrict-prototypes -Wuninitialized -Wunknown-pragmas -Wvariadic-macros -Wwrite-strings -Wformat=2 -Wredundant-decls -Wno-missing-field-initializers -Wno-override-init -Wno-sign-compare -Wno-type-limits -Wno-unused-parameter -Wno-format-nonliteral -Wno-bitwise-instead-of-logical -Wno-missing-braces -Wno-null-pointer-arithmetic -Wno-implicit-const-int-float-conversion -Wno-int-in-bool-context -Wno-shift-overflow -Wno-initializer-overrides -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-deprecated-declarations -O2 -DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT -I/opt/homebrew/opt/gcc/include -I/opt/homebrew/opt/libgccjit/include   -framework AppKit -framework IOKit -framework Carbon                     -framework IOSurface -framework QuartzCore -framework UniformTypeIdentifiers -L/opt/homebrew/lib/gcc/14 -I/opt/homebrew/opt/gcc/include -I/opt/homebrew/opt/libgccjit/include \
    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 sort.o font.o print.o lread.o emacs-module.o syntax.o  bytecode.o comp.o dynlib.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 sqlite.o  treesit.o itree.o json.o        fontset.o fringe.o image.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/opt/libpng/lib -lpng16 -lgif  -L/opt/homebrew/Cellar/webp/1.4.0/lib -lwebpdemux -lwebpdecoder   -L/opt/homebrew/Cellar/librsvg/2.58.4/lib -lrsvg-2 -lm -L/opt/homebrew/Cellar/glib/2.82.2/lib -lgio-2.0 -L/opt/homebrew/Cellar/gdk-pixbuf/2.42.12/lib -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -L/opt/homebrew/opt/gettext/lib -lintl -L/opt/homebrew/Cellar/cairo/1.18.2/lib -lcairo                -L/usr/lib -lxml2    -lncurses         -L/opt/homebrew/Cellar/gnutls/3.8.4/lib -lgnutls   -L/opt/homebrew/Cellar/little-cms2/2.16/lib -llcms2   -lz   -lgmp -lgccjit -ldl   -L/opt/homebrew/Cellar/tree-sitter/0.24.4/lib -ltree-sitter -lsqlite3   

it's truncated, but there's no -L for sqlite, which seems suspect.

d12frosted commented 1 week ago

🤔 yeah it might be the reason btw, did you add it as a regular dep or a build one? i.e.

  depends_on "sqlite3" => :build
ssbb commented 1 week ago

Emacs adding it by default https://github.com/emacs-mirror/emacs/blob/emacs-30/src/Makefile.in

I got it working by adding --with-sqlite3=no for now but probably need to provide correct paths?

oshiteku commented 1 week ago

I have reproduced the same issue on my environment (macOS 15.1). This might be related to the system's SQLite library.

The build succeeded after modifying the formula to use Homebrew's SQLite instead of the system library.

...

   depends_on "mailutils" => :optional
+  depends_on "sqlite"

...
     ENV.append "CFLAGS", "-O2 -DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT"
+
+    # sqlite
+    ENV.append "CFLAGS", "-I#{Formula["sqlite"].include}"
+    ENV.append "LDFLAGS", "-L#{Formula["sqlite"].opt_lib}"

...
rmarrowstone commented 1 week ago

I am running on Sonoma (14.7) and the workaround provided by oshiteku worked for me with emacs-plus@30

A note for others: to modify the formula use brew edit

aaronjensen commented 1 week ago

Is this a result of a homebrew change? It appears to not matter which Emacs version or macOS version is used.

aaronjensen commented 1 week ago

I tested all the way back to Homebrew 4.4.0 and still had the same issue. I have no idea what might be causing this.

citizensn1ps commented 1 week ago

I am running on Sonoma (14.7) and the workaround provided by oshiteku worked for me with emacs-plus@30

A note for others: to modify the formula use brew edit

Thanks that was super helpful, and @oshiteku 's suggestion worked for me as well on Sequoia 15.0.1. Learned a little something about hombrew along the way...

aaronjensen commented 1 week ago

@d12frosted Any reason not to turn this into a PR?

d12frosted commented 1 week ago

@aaronjensen it's easy. PR is welcome. 😅 I am away, so I can only approve/merge stuff from mobile client. 🥲

aaronjensen commented 1 week ago

@d12frosted https://github.com/d12frosted/homebrew-emacs-plus/pull/753