LeaderF
LeaderF copied to clipboard
:LeaderfInstallCExtension Fails to build on MacOS with Xcode
- vim or neovim?
- [ ] vim
- [x ] neovim
- Output of
vim --version
ornvim --version
: NVIM v0.10.0-dev-2983+g55f6a1cab-Homebrew - Output of
:echo has("python")
: has 0 - Output of
:echo has("python3")
: 1 - Output of
:echo &pythondll
(only vim, not neovim): - Output of
:echo &pythonthreedll
(only vim, not neovim): - Output of
:py print(sys.version)
: 3.11.4 (main, Jun 20 2023, 17:37:48) [Clang 14.0.0 (clang-1400.0.29.202)] - Output of
:py3 print(sys.version)
: 3.11.4 (main, Jun 20 2023, 17:37:48) [Clang 14.0.0 (clang-1400.0.29.202)] - Output of
:echo g:Lf_Debug_Cmd
: - Output of
:echo g:Lf_FilesFromCache
: - Operating system:
- [ ] Linux
- [ x] Mac OS X
- [ ] Windows
- [ ] Etc.
- Configurations related to LeaderF in vimrc: No
Describe your question, feature request, or bug.
The problem is a bug in the way the -arch flag is passed to clang.
Running 'LeaderfInstallCExtension' fails and generates the following output:
Begin to compile C extension of Python3 ...
running build
running build_ext
building 'fuzzyMatchC' extension
clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -
fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX
12.sdk -I/opt/homebrew/opt/binutils/include arm64 -I/opt/homebrew/opt/pyth
[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c fu
zzyMatch.c -o build/temp.macosx-12-arm64-cpython-311/fuzzyMatch.o
clang: error: no such file or directory: 'arm64'
error: command '/usr/bin/clang' failed with exit code 1
The problem was determined to be an incorrect passing of the arch flag. The -arch flag was passed with a trailing space. This resulted in a wrong invocation, where the command inculded this flag like this: 'arch ' arm64.
See "Clang Error on Mac: No Such File or Directory: 'arm64' · Issue #3847 · Ericsson/codechecker"
https://github.com/Ericsson/codechecker/issues/3847
The "[fix] is simply to pass arch flag correctly. See [fix] Pass arch flag correctly by vodorok · Pull Request #3854 · Ericsson/codechecker https://github.com/Ericsson/codechecker/issues/384
I believe I can create the C-Extension myself if I have access to the source-file (fuzzyMatch.c).
Steps to reproduce
Run :LeaderfInstallCExtension
Actual behaviour
See the next section.
Build fails with the output:
Running 'LeaderfInstallCExtension' fails and generates the following output: Begin to compile C extension of Python3 ... running build running build_ext building 'fuzzyMatchC' extension clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g - fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX 12.sdk -I/opt/homebrew/opt/binutils/include arm64 -I/opt/homebrew/opt/pyth [email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c fu zzyMatch.c -o build/temp.macosx-12-arm64-cpython-311/fuzzyMatch.o clang: error: no such file or directory: 'arm64'
Expected behaviour
The Python C Extension would be created.