Repository: d12frosted/homebrew-emacs-plus

Issue #364: Installs ok - strange function error on first run
Created: 2021-06-27T14:57:25Z
Please make sure to follow these steps (and mark the checkboxes):

 run brew update and try to reproduce the issue again
 run brew doctor, fix all issues and try to reproduce your issue again
 run brew config and brew doctor and include their output

What you were trying to do
Install emacs-plus@28 on to a brand new macbook with:
brew install emacs-plus@28 --with-modern-paper-icon --with-xwidgets --with-native-comp --with-no-titlebar --with-mailutils --with-debug 
What happened (include command output)
Brew reports it installed correctly
* brew info emacs-plus@28
d12frosted/emacs-plus/emacs-plus@28: stable 28.0.50
/usr/local/Cellar/emacs-plus@28/28.0.50 (4,330 files, 167MB) *
  Built from source on 2021-06-27 at 15:31:24 with: --with-no-titlebar --with-debug --with-xwidgets --with-native-comp --with-mailutils --with-modern-paper-icon
From: https://github.com/d12frosted/homebrew-emacs-plus/blob/HEAD/
==> Dependencies
Build: autoconf ✔, gnu-sed ✔, pkg-config ✔, texinfo ✔
Required: gnutls ✔, librsvg ✔, little-cms2 ✔, jansson ✔
Recommended: imagemagick ✔
Optional: dbus ✔, mailutils ✔
==> Options
--with-EmacsIcon1-icon
	Using Emacs EmacsIcon1 icon
--with-EmacsIcon2-icon
	Using Emacs EmacsIcon2 icon
--with-EmacsIcon3-icon
	Using Emacs EmacsIcon3 icon
--with-EmacsIcon4-icon
	Using Emacs EmacsIcon4 icon
--with-EmacsIcon5-icon
	Using Emacs EmacsIcon5 icon
--with-EmacsIcon6-icon
	Using Emacs EmacsIcon6 icon
--with-EmacsIcon7-icon
	Using Emacs EmacsIcon7 icon
--with-EmacsIcon8-icon
	Using Emacs EmacsIcon8 icon
--with-EmacsIcon9-icon
	Using Emacs EmacsIcon9 icon
--with-cacodemon-icon
	Using Emacs cacodemon icon
--with-ctags
	Don't remove the ctags executable that Emacs provides
--with-dbus
	Build with dbus support
--with-debug
	Build with debug symbols and debugger friendly optimizations
--with-elrumo1-icon
	Using Emacs elrumo1 icon
--with-elrumo2-icon
	Using Emacs elrumo2 icon
--with-emacs-card-blue-deep-icon
	Using Emacs emacs-card-blue-deep icon
--with-emacs-card-british-racing-green-icon
	Using Emacs emacs-card-british-racing-green icon
--with-emacs-card-carmine-icon
	Using Emacs emacs-card-carmine icon
--with-emacs-card-green-icon
	Using Emacs emacs-card-green icon
--with-gnu-head-icon
	Using Emacs gnu-head icon
--with-mailutils
	Build with mailutils support
--with-modern-alecive-flatwoken-icon
	Using Emacs modern-alecive-flatwoken icon
--with-modern-asingh4242-icon
	Using Emacs modern-asingh4242 icon
--with-modern-azhilin-icon
	Using Emacs modern-azhilin icon
--with-modern-bananxan-icon
	Using Emacs modern-bananxan icon
--with-modern-black-dragon-icon
	Using Emacs modern-black-dragon icon
--with-modern-black-gnu-head-icon
	Using Emacs modern-black-gnu-head icon
--with-modern-black-variant-icon
	Using Emacs modern-black-variant icon
--with-modern-bokehlicia-captiva-icon
	Using Emacs modern-bokehlicia-captiva icon
--with-modern-cg433n-icon
	Using Emacs modern-cg433n icon
--with-modern-doom-icon
	Using Emacs modern-doom icon
--with-modern-doom3-icon
	Using Emacs modern-doom3 icon
--with-modern-icon
	Using Emacs modern icon
--with-modern-mzaplotnik-icon
	Using Emacs modern-mzaplotnik icon
--with-modern-nuvola-icon
	Using Emacs modern-nuvola icon
--with-modern-orange-icon
	Using Emacs modern-orange icon
--with-modern-paper-icon
	Using Emacs modern-paper icon
--with-modern-papirus-icon
	Using Emacs modern-papirus icon
--with-modern-pen-3d-icon
	Using Emacs modern-pen-3d icon
--with-modern-pen-black-icon
	Using Emacs modern-pen-black icon
--with-modern-pen-icon
	Using Emacs modern-pen icon
--with-modern-pen-lds56-icon
	Using Emacs modern-pen-lds56 icon
--with-modern-purple-flat-icon
	Using Emacs modern-purple-flat icon
--with-modern-sexy-v1-icon
	Using Emacs modern-sexy-v1 icon
--with-modern-sexy-v2-icon
	Using Emacs modern-sexy-v2 icon
--with-modern-sjrmanning-icon
	Using Emacs modern-sjrmanning icon
--with-modern-vscode-icon
	Using Emacs modern-vscode icon
--with-modern-yellow-icon
	Using Emacs modern-yellow icon
--with-native-comp
	Build with native compilation
--with-no-frame-refocus
	Disables frame re-focus (ie. closing one frame does not refocus another one)
--with-no-titlebar
	Experimental: build without titlebar
--with-nobu417-big-sur-icon
	Using Emacs nobu417-big-sur icon
--with-retro-emacs-logo-icon
	Using Emacs retro-emacs-logo icon
--with-retro-gnu-meditate-levitate-icon
	Using Emacs retro-gnu-meditate-levitate icon
--with-retro-sink-bw-icon
	Using Emacs retro-sink-bw icon
--with-retro-sink-icon
	Using Emacs retro-sink icon
--with-spacemacs-icon
	Using Emacs spacemacs icon
--with-x11
	Experimental: build with x11 support
--with-xwidgets
	Experimental: build with xwidgets support
--without-cocoa
	Build a non-Cocoa version of Emacs
--without-imagemagick
	Build without imagemagick support
==> Caveats
Emacs.app was installed to:
  /usr/local/opt/emacs-plus@28

To link the application to default Homebrew App location:
  ln -s /usr/local/opt/emacs-plus@28/Emacs.app /Applications

To have launchd start d12frosted/emacs-plus/emacs-plus@28 now and restart at login:
  brew services start d12frosted/emacs-plus/emacs-plus@28
Or, if you don't want/need a background service you can just run:
  emacs
✓ ~$
* ln -s /usr/local/opt/emacs-plus@28/Emacs.app /Applications
'/Applications/Emacs.app' -> '/usr/local/opt/emacs-plus@28/Emacs.app'
✓ ~$
>

The problem is when launching it:
✓ ~$
* emacs
emacs: can't find function "F6d656e752d6261722d7570646174652d62756666657273_menu_bar_update_buffers_0" in compilation unit /usr/local/Cellar/emacs-plus@28/28.0.50/libexec/emacs/28.0.50/x86_64-apple-darwin19.6.0/../../../../bin/../lib/emacs/28.0.50/native-lisp/28.0.50-d79ffe10/preloaded/menu-bar-4f46ea94-7781c24c.eln
❌ ~$

also
❌ ~$
* open -a emacs
LSOpenURLsWithRole() failed for the application /usr/local/Cellar/emacs-plus@28/28.0.50/Emacs.app with error -10810.

Output of brew config
$ brew config

HOMEBREW_VERSION: 3.2.0
ORIGIN: https://github.com/Homebrew/brew
HEAD: 09f7bc27a99469cf947431df4754737dfbadb31d
Last commit: 7 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 756b091d1d6988bb13926e7bb4116926ea724302
Core tap last commit: 48 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: nvim
HOMEBREW_MAKE_JOBS: 12
Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby
CPU: dodeca-core 64-bit kabylake
Clang: 12.0.0 build 1200
Git: 2.24.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 10.15.7-x86_64
CLT: 12.4.0.0.1.1610135815
Xcode: N/A


Output of brew doctor
$ brew doctor
Your system is ready to brew.

Duplicate issue #360: X11 builds with native compilation don't work
Created: 2021-06-05T19:58:27Z
Builds OK with brew install emacs-plus@28 --with-x11 --with-retro-sink-bw-icon --with-native-comp but when run it fails with the same error message as #333:
emacs: can't find function "F6d656e752d6261722d7570646174652d62756666657273_menu_bar_update_buffers_0" in compilation unit /usr/local/Cellar/emacs-plus@28/28.0.50/libexec/emacs/28.0.50/x86_64-apple-darwin20.4.0/../../../../bin/../lib/emacs/28.0.50/native-lisp/28.0.50-790491c2/preloaded/menu-bar-4f46ea94-bb2650c8.eln

I've tried pinning the build to known good commits, including 3f8b303 and f4dc646e0d7fb673f3149836bb7299fba9539e80, which I used to build a cocoa version with native compilation about 10 days ago and has been working well. All fail with the same error.
The X11 builds work fine if --with-native-comp is not used.

Closing comment (2021-06-28T09:05:07Z): Same issue here, too. This issue seems to be the same as #364 .
In the output of objdump -D menu-bar-4f46ea94-7781c24c.eln, I can see a function named _F6d656e752d6261722d7570646174652d62756666657273_menu_bar_update_buffers_0. Note the leading underscore. I doubt the issue is caused by the extra leading underscore.