[MacPorts] #71298: emacs @29.4+nativecomp+treesitter segfaults clang during build
MacPorts
noreply at macports.org
Wed Nov 13 15:55:09 UTC 2024
#71298: emacs @29.4+nativecomp+treesitter segfaults clang during build
---------------------------------+----------------------
Reporter: JGoldstone | Owner: drkp
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.10.4
Resolution: | Keywords:
Port: emacs, tree-sitter |
---------------------------------+----------------------
Changes (by ryandesign):
* cc: herbygillot (added)
* port: emacs => emacs, tree-sitter
Comment:
Replying to [comment:2 JGoldstone]:
> {{{
> ---> Scanning binaries for linking errors
> DEBUG: Skipping weakly-linked /opt/local/lib/libXss.1.dylib
> DEBUG: Skipping weakly-linked /opt/local/lib/libXss.1.dylib
> DEBUG: Ignoring loadcommand containing @rpath in
/opt/local/lib/libgcc/libgfortran.5.dylib
> DEBUG: Ignoring loadcommand containing @rpath in
/opt/local/lib/libgcc/libgfortran.5.dylib
> DEBUG: Ignoring loadcommand containing @rpath in /opt/local/lib/libgcc
/libobjc-gnu.4.dylib
> DEBUG: Ignoring loadcommand containing @rpath in
/opt/local/lib/libgcc/libstdc++.6.dylib
> DEBUG: Ignoring loadcommand containing @rpath in
/opt/local/lib/gcc14/libgccjit.0.dylib
> Could not open /opt/local/lib/libtree-sitter.0.23.dylib: Error opening
or reading file (referenced from /opt/local/bin/emacs-29.4)
> DEBUG: Marking /opt/local/bin/emacs-29.4 as broken
> DEBUG: Ignoring loadcommand containing @rpath in
/opt/local/bin/emacs-29.4
> ---> Found 1 broken file, matching files to ports
> ---> Found 1 broken port, determining rebuild order
> DEBUG: Broken: emacs
> DEBUG: Processing port emacs @0:29.4_1+nativecomp+treesitter
> }}}
>
> In /opt/local/lib there is a libtree-sitter.0.24.dylib, but not the
above-linked libtree-sitter.0.23.dylib.
Ok, the tree-sitter major library version must've changed when
[changeset:b63edbf7a8613015e702fe685748f8702ed7371e/macports-ports the
tree-sitter port was updated to version 0.24.x last month]. All ports that
link with tree-sitter's library, including emacs, needed to have had their
revisions increased at that time to rebuild them to use the new library.
Herby, can you do that now, for all ports linking with the tree-sitter
library that have not already had their revisions or versions increased
since then?
> I realize it's quite grotesque, but I seem to have managed a workaround:
first I install with --no-rev-upgrade, and then I use install_name_tool
to cause the emacs binary to reference the newest (0.24) version rather
than the nonexistent 0.23 version to which it is embedding a reference.
That's useful to know. This shouldn't work. The only reason why the
developers would change the install name of their library (in this case,
by changing its major version number) is if there is an incompatibility
(for example, if they changed or removed something that a program might be
using). If editing the emacs library linkage with install_name_tool to use
tree-sitter 0.24 instead of 0.23 results in a working emacs, that suggests
that the developers of the tree-sitter library may be versioning their
library improperly. That wouldn't surprise me; it's an extremely common
mistake for developers to make. For one thing, they are
[https://github.com/tree-sitter/tree-
sitter/blob/bdfe32402e85673bbc693216f0a6ef72c98bb665/Makefile#L32-L34
using their project's version number as the library's version number]
which is not the correct way to do it. Herby, have you already discussed
library versioning with them?
It's also possible that they're versioning it correctly, and that your
change doesn't result in a fully working emacs. Maybe emacs launches and
appears to work initially, but if you were to access whatever
functionality is dependent upon the tree-sitter library it would crash or
not work.
--
Ticket URL: <https://trac.macports.org/ticket/71298#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list