#68274 closed defect (fixed)

emacs 29.1+nativecomp+treesitter: configuration failure

Reported by: kenniskoldewyn (Kennis Koldewyn) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: sonoma Cc: drkp (Dan Ports), catap (Kirill A. Korinsky), elteck, hutches (David J. Hutches)
Port: emacs

Description

Building emacs 29.1 on MacOS Sonoma (14.0) with native compilation support fails with a configuration error:

/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_editors_emacs/emacs/main.log:

[...]
:info:configure checking for gcc_jit_context_acquire in -lgccjit... no
:info:configure configure: error: ELisp native compiler was requested, but libgccjit was not found.
:info:configure Please try installing libgccjit or a similar package.
:info:configure If you are sure you want Emacs be compiled without ELisp native compiler,
:info:configure pass the --without-native-compilation option to configure.
:info:configure Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_editors_emacs/emacs/work/emacs-29.1" && ./configure --prefix=/opt/local --disable-silent-rules --without-ns --without-x --without-dbus --without-gconf --without-libotf --without-m17n-flt --with-libgmp --with-gnutls --with-json --with-xml2 --with-modules --with-sqlite3 --with-webp --infodir /opt/local/share/info/emacs --with-native-compilation=aot --with-tree-sitter
:info:configure Exit code: 1
:error:configure Failed to configure emacs: consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_editors_emacs/emacs/work/emacs-29.1/config.log
:error:configure Failed to configure emacs: configure failure: command execution failed
:debug:configure Error code: NONE
:debug:configure Backtrace: configure failure: command execution failed
:debug:configure     while executing
:debug:configure "$procedure $targetname"
:error:configure See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_editors_emacs/emacs/main.log for details.

Attachments (2)

config.log (227.8 KB) - added by kenniskoldewyn (Kennis Koldewyn) 14 months ago.
config.log
main.log (144.0 KB) - added by kenniskoldewyn (Kennis Koldewyn) 14 months ago.

Download all attachments as: .zip

Change History (10)

Changed 14 months ago by kenniskoldewyn (Kennis Koldewyn)

Attachment: config.log added

config.log

Changed 14 months ago by kenniskoldewyn (Kennis Koldewyn)

Attachment: main.log added

comment:1 Changed 14 months ago by kenniskoldewyn (Kennis Koldewyn)

I should add that emacs 29.1 builds with no problems if native compilation support is excluded using -nativecomp.

comment:2 Changed 14 months ago by hutches (David J. Hutches)

This may be related, so I'll avoid creating a potentially duplicate defect report. After an update to gcc (gcc12 @12.3.0_1+stdlib_flag) today, Emacs (at least) would fail to start with a missing dynamic shared library error of the following form (as expected, a similar error is produced when attempting to start emacs-app):

dyld[69541]: Library not loaded: @rpath/libgccjit.0.dylib
  Referenced from: <30776C42-135A-363C-9A57-39E9A1EA4AA4> /opt/local/bin/emacs-29.1
  Reason: tried: '/opt/local/lib/gcc12/libgccjit.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/gcc12/libgccjit.0.dylib' (no such file), '/opt/local/lib/gcc12/libgccjit.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/gcc12/libgccjit.0.dylib' (no such file), '/usr/local/lib/libgccjit.0.dylib' (no such file), '/usr/lib/libgccjit.0.dylib' (no such file, not in dyld cache)
Abort

Reviewing backups from prior to the gcc update, it appears that the libgccjit.0.dylib file that had previously resided in /opt/local/lib/gcc12 was removed and replaced by a symlink to a target of the same name in /opt/local/lib/libgcc, except that no corresponding shared library exists/was built for gcc JIT. All of the other symlinks in /opt/local/lib/gcc12 point to targets that actually exist and were updated/installed in /opt/local/lib/libgcc during the course of today's rebuild of gcc (i.e., only the target for the gcc JIT shared library is missing).

System details:

Model Name: Mac Studio (2022)
Model Identifier: Mac13,1
Model Number: Z14J000GDLL/A
Chip: Apple M1 Max
System Version:	macOS 13.5.2 (22G91)
Kernel Version: Darwin 22.6.0

comment:3 Changed 14 months ago by elteck

Ran into the same issue. The root cause for me is that it somehow picks the system clang compiler. I see this in the log file:

configure:5103: result: x86_64-apple-darwin23.0.0
configure:6372: checking for C compiler version
configure:6381: /usr/bin/clang --version >&5
Apple clang version 15.0.0 (clang-1500.0.40.1)
Target: x86_64-apple-darwin23.0.0
Thread model: posix

Which is strange, since I did install the clang-14 and I did do a port select clang mp-clang-14.

@Georges-MacBook-Pro-5 ~ % which clang
/opt/local/bin/clang

I did try installing emacs-devel as well. That port does pick the correct clang executable, but requires libgccjit, which I don't know how to install.

Last edited 14 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:4 in reply to:  3 Changed 14 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: elteck added

Replying to elteck:

Which is strange, since I did install the clang-14 and I did do a port select clang mp-clang-14.

It's not strange; that's how MacPorts is intended to work. Ports specify which compilers they don't work with; MacPorts picks which compiler to use, based on its internal list of known compilers, and usually Xcode's clang (or the CLT's clang) is the one it picks unless the port indicates that won't work.

What you do with sudo port select is for your convenience when you run programs on the command line outside of MacPorts. It should not affect MacPorts port builds. (Some times it does; if it does, that is a bug that should be reported and fixed.) The goal is ReproducibleBuilds, and performing builds that vary based on what each user might have selected is contrary to that goal.

comment:5 in reply to:  2 Changed 14 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: hutches added

Replying to hutches:

it appears that the libgccjit.0.dylib file that had previously resided in /opt/local/lib/gcc12 was removed and replaced by a symlink to a target of the same name in /opt/local/lib/libgcc, except that no corresponding shared library exists/was built for gcc JIT.

Please see if [400883c9ecd2197f38b6c86d9418e19501e94063/macports-ports] (which was committed just a couple hours before your comment) fixed this, by running sudo port selfupdate and sudo port upgrade outdated.

comment:6 Changed 14 months ago by fpeos

I confirm it works now. I just installed 'emacs' without problems.

Thanks everyone for the rapid response.

comment:7 Changed 14 months ago by elteck

Same here. This morning I was able to install emacs. Thank you for fixing this quickly.

comment:8 Changed 14 months ago by cjones051073 (Chris Jones)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.