Closed bbenchen closed 2 years ago
Looks like the same issue as https://github.com/d12frosted/homebrew-emacs-plus/issues/392#issuecomment-1162854131
On mine it's failing with a different error:
Error: Failed changing dylib ID of /usr/local/Cellar/emacs-plus@29/29.0.50/lib/emacs/29.0.50/native-lisp/29.0.50-b2fb589e/preloaded/isearch-693bdd75-005fb30b.eln
from isearch-693bdd75-005fb30b.eln
to /usr/local/opt/emacs-plus@29/lib/emacs/29.0.50/native-lisp/29.0.50-b2fb589e/preloaded/isearch-693bdd75-005fb30b.eln
Error: Failed to fix install linkage
adding --debug flag reveals more dylib errors:
A workaround to make it work:
ln -sf $(brew --prefix)/opt/emacs-plus@29/lib/emacs/29.0.50/native-lisp $(brew --prefix)/Cellar/emacs-plus@29/29.0.50/Emacs.app/Contents
can confirm. for me
ln -sf /usr/local/Cellar/emacs-plus@29/29.0.50/lib/emacs/29.0.50/native-lisp /opt/homebrew/Cellar/emacs-plus@29/29.0.50/Emacs.app/Contents
did the trick...
A workaround to make it work:
ln -sf $(brew --prefix)/opt/emacs-plus@29/lib/emacs/29.0.50/native-lisp $(brew --prefix)/Cellar/emacs-plus@29/29.0.50/Emacs.app/Contents
It works
The fix is in master. CI on branch is green. Since I am not using native compilation, would be nice for someone to confirm.
@d12frosted I ran:
brew uninstall emacs-plus@29
brew install emacs-plus@29 --with-native-comp --with-xwidgets --with-modern-papirus-icon --verbose
Intel chip Mac. Things looking good.
Reinstalled Brew on an M1 (arm64) Macbook via uninstall steps and then: brew install emacs-plus@29 --with-dbus --with-mailutils --with-xwidgets --with-imagemagick --with-native-comp
.
Seems to have been working well so far with multiple restarts. Here is the output from brew info
:
% brew info d12frosted/emacs-plus/emacs-plus@29
d12frosted/emacs-plus/emacs-plus@29: stable 29.0.50
/opt/homebrew/Cellar/emacs-plus@29/29.0.50 (4,378 files, 192.0MB) *
Built from source on 2022-07-07 at 12:42:48 with: --with-xwidgets --with-native-comp --with-imagemagick --with-dbus --with-mailutils
From: https://github.com/d12frosted/homebrew-emacs-plus/blob/HEAD/Formula/emacs-plus@29.rb
==> Dependencies
Build: make ✔, autoconf ✔, gnu-sed ✔, gnu-tar ✔, awk ✔, coreutils ✔, pkg-config ✔, texinfo ✔
Required: gnutls ✔, librsvg ✔, little-cms2 ✔, jansson ✔
Optional: imagemagick ✔, dbus ✔, mailutils ✔
...
I'm still getting this output at the end of my build:
==> touch '/usr/local/Cellar/emacs-plus@29/29.0.50/Emacs.app'
Error: Failed changing dylib ID of /usr/local/Cellar/emacs-plus@29/29.0.50/Emacs.app/Contents/native-lisp/29.0.50-beb5b449/comp-7672a6ed-aea242fd.eln
from comp-7672a6ed-aea242fd.eln
to /usr/local/opt/emacs-plus@29/Emacs.app/Contents/native-lisp/29.0.50-beb5b449/comp-7672a6ed-aea242fd.eln
Error: Failed to fix install linkage
The formula built, but you may encounter issues using it or linking other
formulae against it.
@tilgovi make sure to brew update
before trying to install.
Yeah, I have. I even wiped the tap and retapped, made sure the git log showed it was up-to-date. I've uninstalled, reinstalled emacs multiple times.
I don't know if this is the right command because I don't know about these OSX linking things, but here's output if I try to change the dylib ID manually:
❯ install_name_tool -id /usr/local/opt/emacs-plus@29/Emacs.app/Contents/native-lisp/29.0.50-beb5b449/comp-7672a6ed-aea242fd.eln /usr/local/Cellar/emacs-plus@29/29.0.50/Emacs.app/Contents/native-lisp/29.0.50-beb5b449/comp-7672a6ed-aea242fd.eln
error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool: changing install names or rpaths can't be redone for: /usr/local/Cellar/emacs-plus@29/29.0.50/Emacs.app/Contents/native-lisp/29.0.50-beb5b449/comp-7672a6ed-aea242fd.eln (for architecture x86_64) because larger updated load commands do not fit (the program must be relinked, and you may need to use -headerpad or -headerpad_max_install_names)
@tilgovi what version of Command Line Tools do you have installed? Can you check?
pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
❯ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 13.4.0.0.1.1651278267
volume: /
location: /
install-time: 1654198104
groups: com.apple.FindSystemFiles.pkg-group
Have you tried @LuciusChen 's workaround?
I'm not sure what the workaround should do. I observe nothing broken. Emacs starts without trouble. I am just reporting the log message.
Oh, okay. I misunderstood. I thought it's still failing to install for you. I'm glad you have Emacs running. Nothing is worse when you can't get Emacs (the way you wanted) on your machine.
True :). And you all are amazing and responsive and I appreciate this repository so much.
Please let me know if you have suggestions as to how to help debug. I don't even know how to get more verbose output from Homebrew to see which command is actually failing. I guessed at the install_name_tool
command to try manually.
if you have suggestions as to how to help debug
there are --verbose
and --debug
flags that you can feed to brew install
After several successful messages about changing dylib IDs, it gets to this one that fails:
==> Changing dylib ID of /usr/local/Cellar/emacs-plus@29/29.0.50/Emacs.app/Contents/native-lisp/29.0.50-beb5b449/comp-7672a6ed-aea242fd.eln
from comp-7672a6ed-aea242fd.eln
to /usr/local/opt/emacs-plus@29/Emacs.app/Contents/native-lisp/29.0.50-beb5b449/comp-7672a6ed-aea242fd.eln
Error: Failed changing dylib ID of /usr/local/Cellar/emacs-plus@29/29.0.50/Emacs.app/Contents/native-lisp/29.0.50-beb5b449/comp-7672a6ed-aea242fd.eln
from comp-7672a6ed-aea242fd.eln
to /usr/local/opt/emacs-plus@29/Emacs.app/Contents/native-lisp/29.0.50-beb5b449/comp-7672a6ed-aea242fd.eln
Error: Failed to fix install linkage
The formula built, but you may encounter issues using it or linking other
formulae against it.
==> Updated load commands do not fit in the header of /usr/local/Cellar/emacs-plus@29/29.0.50/Emacs.app/Contents/native-lisp/29.0.50-beb5b449/comp-7672a6ed-aea242fd.eln. /usr/local/Cellar/emacs-plus@29/29.0.50/Emacs.app/Contents/native-lisp/29.0.50-beb5b449/comp-7672a6ed-aea242fd.eln needs to be relinked, possibly with -headerpad or -headerpad_max_install_names
That's not really helpful or new information, probably, from what I posted before, but I did want to follow up with what the --verbose --debug
output gave me.
Well, I tried this again later in the day and it worked without issue. I can't explain that, but I'll accept it.
@tilgovi thank you for your enthusiasm in digging this issues 💪 I don't know why it didn't work in the first place and why it works now. I checked the latest commits in the Emacs master branch and seems like there is nothing related. I am with @agzam on this - I am just happy that it builds and works 😸
Error: Failed changing dylib ID of /usr/local/Cellar/emacs-plus@29/29.0.50/lib/emacs/29.0.50/native-lisp/29.0.50-566f90ed/preloaded/isearch-693bdd75-7048e0a2.eln
from isearch-693bdd75-7048e0a2.eln
to /usr/local/opt/emacs-plus@29/lib/emacs/29.0.50/native-lisp/29.0.50-566f90ed/preloaded/isearch-693bdd75-7048e0a2.eln
Error: Failed to fix install linkage
The formula built, but you may encounter issues using it or linking other
Please make sure to follow these steps (and mark the checkboxes):
brew update
and try to reproduce the issue againbrew doctor
, fix all issues and try to reproduce your issue againbrew config
andbrew doctor
and include their outputWhat you were trying to do
What happened (include command output)
Command output
Output of
brew config
Output of
brew doctor