akiyosi / goneovim

A GUI frontend for neovim.
MIT License
2.36k stars 59 forks source link

Build error on macos with ld and clang #463

Open luisiacc opened 1 year ago

luisiacc commented 1 year ago

I'm trying to build the code on macOS ventura. However I'm getting an error, do someone know any solutions for this or has it ever happened to someone? Im pretty sure is a environment problem on my side.

ERRO[0023] failed to run command                         _func=RunCmd cmd="go build -p 12 -v -ldflags=all=\"-w\" \"-X\" \"github.com/akiyosi/goneovim/editor.Version=nightly\" -trimpath -o /Users/Luis/tools/goneovim/cmd/goneovim/deploy/darwin/goneovim.app/Contents/MacOS/goneovim -tags=minimal" dir=/Users/Luis/tools/goneovim/cmd/goneovim env="_CE_M= SHLVL=2 BAT_THEME=gruvbox-dark P9K_SSH=0 P9K_TTY=old CONDA_PREFIX=/opt/homebrew/Caskroom/miniconda/base GOFLAGS=-mod=vendor MFLAGS= _CE_CONDA= FNM_ARCH=arm64 TERM_PROGRAM_VERSION=447 LSCOLORS=Gxfxcxdxbxegedabagacad FNM_DIR=/Users/Luis/Library/Application Support/fnm LOGNAME=Luis GOROOT=/opt/homebrew/Cellar/go/1.20.3/libexec TMPDIR=/var/folders/_h/cy6nv52s2lj7n18v_mlcb3y40000gn/T/ ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE=fg=208 HOMEBREW_PREFIX=/opt/homebrew GOOS=darwin CONDA_PROMPT_MODIFIER=(base)  HOMEBREW_CELLAR=/opt/homebrew/Cellar DISPLAY=:0 _P9K_TTY=/dev/ttys000 MAKEFLAGS= CONDA_PYTHON_EXE=/opt/homebrew/Caskroom/miniconda/base/bin/python GOPATH=/Users/Luis/go CONDA_DEFAULT_ENV=base OLDPWD=/Users/Luis/tools/goneovim FNM_MULTISHELL_PATH=/Users/Luis/Library/Caches/fnm_multishells/77805_1682833362416 QT_API=5.13.0 _=/Users/Luis/go/bin/qtdeploy PAGER=less XPC_FLAGS=0x0 QT_HOMEBREW=true XPC_SERVICE_NAME=0 _P9K_SSH_TTY=/dev/ttys000 TERM_SESSION_ID=7A6C0B6F-83E4-475F-8D1D-1E4E7CFEC601 LS_COLORS=di=1;36:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43 __CF_USER_TEXT_ENCODING=0x1F5:0:0 HOME=/Users/Luis INFOPATH=/opt/homebrew/share/info: TERM=wezterm FNM_NODE_DIST_MIRROR=https://nodejs.org/dist FNM_LOGLEVEL=info ZSH=/Users/Luis/.oh-my-zsh MAKELEVEL=1 __CFBundleIdentifier=com.apple.Terminal MANPATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/share/man:/Library/Developer/CommandLineTools/usr/share/man:/Library/Developer/CommandLineTools/Toolchains/XcodeDefault.xctoolchain/usr/share/man:/opt/homebrew/share/man:: TERM_PROGRAM=Apple_Terminal HOMEBREW_REPOSITORY=/opt/homebrew SSH_AUTH_SOCK=/var/folders/_h/cy6nv52s2lj7n18v_mlcb3y40000gn/T//ssh-cH6AwG6EaAfg/agent.77882 FNM_VERSION_FILE_STRATEGY=local LC_CTYPE=UTF-8 GOARCH=amd64 PATH=/opt/homebrew/opt/qt@5/bin:/Users/Luis/.cargo/bin:/Users/Luis/.poetry/bin:/usr/local/go/bin:/Users/Luis/.local/bin:/opt/homebrew/Caskroom/miniconda/base/bin:/opt/homebrew/Caskroom/miniconda/base/condabin:/Users/Luis/.poetry/bin:/usr/local/go/bin:/home/acc/.cargo/bin:/Users/Luis/Library/Caches/fnm_multishells/77805_1682833362416/bin:/Users/Luis/Library/Application Support/fnm:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/Luis/Library/Application Support/JetBrains/Toolbox/scripts:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/Users/Luis/bin:/Users/Luis/.local/bin LESS=-R CGO_ENABLED=1 USER=Luis CONDA_SHLVL=1 CONDA_EXE=/opt/homebrew/Caskroom/miniconda/base/bin/conda PWD=/Users/Luis/tools/goneovim/cmd/goneovim GPG_TTY=not a tty SSH_AGENT_PID=77883 SHELL=/bin/zsh" error="exit status 1" name="build for darwin on darwin"
# github.com/therecipe/qt/core
core-minimal.cpp:430:55: warning: 'append' is deprecated: Use QString's toUtf8(), toLatin1() or toLocal8Bit() [-Wdeprecated-declarations]
/opt/homebrew/Cellar/qt@5/5.15.8_3/lib/QtCore.framework/Headers/qbytearray.h:338:5: note: 'append' has been explicitly marked deprecated here
/opt/homebrew/Cellar/qt@5/5.15.8_3/lib/QtCore.framework/Headers/qglobal.h:374:45: note: expanded from macro 'QT_DEPRECATED_VERSION_X_5_15'
/opt/homebrew/Cellar/qt@5/5.15.8_3/lib/QtCore.framework/Headers/qglobal.h:294:33: note: expanded from macro 'QT_DEPRECATED_X'
/opt/homebrew/Cellar/qt@5/5.15.8_3/lib/QtCore.framework/Headers/qcompilerdetection.h:675:55: note: expanded from macro 'Q_DECL_DEPRECATED_X'
core-minimal.cpp:540:55: warning: 'insert' is deprecated: Use QString's toUtf8(), toLatin1() or toLocal8Bit() [-Wdeprecated-declarations]
/opt/homebrew/Cellar/qt@5/5.15.8_3/lib/QtCore.framework/Headers/qbytearray.h:340:5: note: 'insert' has been explicitly marked deprecated here
/opt/homebrew/Cellar/qt@5/5.15.8_3/lib/QtCore.framework/Headers/qglobal.h:374:45: note: expanded from macro 'QT_DEPRECATED_VERSION_X_5_15'
/opt/homebrew/Cellar/qt@5/5.15.8_3/lib/QtCore.framework/Headers/qglobal.h:294:33: note: expanded from macro 'QT_DEPRECATED_X'

...
...
...

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

cp: deploy/darwin/goneovim.app/Contents/Resources: No such file or directory
cp: ../../runtime: unable to copy extended attributes to deploy/darwin/goneovim.app/Contents/Resources: No such file or directory
cp: deploy/darwin/goneovim.app/Contents/Resources/doc: No such file or directory
cp: ../../runtime/doc: unable to copy extended attributes to deploy/darwin/goneovim.app/Contents/Resources/doc: No such file or directory
cp: deploy/darwin/goneovim.app/Contents/Resources/doc/goneovim.txt: No such file or directory
cp: utimensat: deploy/darwin/goneovim.app/Contents/Resources/doc: No such file or directory
cp: chown: deploy/darwin/goneovim.app/Contents/Resources/doc: No such file or directory
cp: chmod: deploy/darwin/goneovim.app/Contents/Resources/doc: No such file or directory
cp: chflags: deploy/darwin/goneovim.app/Contents/Resources/doc: No such file or directory
cp: ../../runtime/doc: unable to copy ACL to deploy/darwin/goneovim.app/Contents/Resources/doc: No such file or directory
cp: utimensat: deploy/darwin/goneovim.app/Contents/Resources: No such file or directory
cp: chown: deploy/darwin/goneovim.app/Contents/Resources: No such file or directory
cp: chmod: deploy/darwin/goneovim.app/Contents/Resources: No such file or directory
cp: chflags: deploy/darwin/goneovim.app/Contents/Resources: No such file or directory
cp: ../../runtime: unable to copy ACL to deploy/darwin/goneovim.app/Contents/Resources: No such file or directory
akiyosi commented 1 year ago

@luisiacc Hi, Thanks for this issue report.

From the error, it seems that this is happening because the application cannot find the x86_64 architecture symbol. Perhaps your MacOS is Apple Silicon?

Since I don't have an Apple Silicon device, goneovim does not yet have an established build procedure for Apple Silicon.

How does you setup Qt?

luisiacc commented 1 year ago

Ohh ok that makes sense because I do have a macboock m2. The make qt_bindings command did worked, but the make app failed with the above error.

akiyosi commented 1 year ago

Thanks for the info! Did you set up Qt with brew install qt5 ? Or are you using the official Qt installer?

luisiacc commented 1 year ago

I did it with homebrew, I also set the env variable QT_HOMEBREW=true