Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:LeaderfInstallCExtension Fails to build on MacOS with Xcode #1017

Open
4 tasks
Herk2 opened this issue Jul 12, 2023 · 6 comments
Open
4 tasks

:LeaderfInstallCExtension Fails to build on MacOS with Xcode #1017

Herk2 opened this issue Jul 12, 2023 · 6 comments

Comments

@Herk2
Copy link

Herk2 commented Jul 12, 2023

  • vim or neovim?
    • vim
    • [x ] neovim
  • Output of vim --version or nvim --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"
Ericsson/codechecker#3847
The "[fix] is simply to pass arch flag correctly. See [fix] Pass arch flag correctly by vodorok · Pull Request #3854 · Ericsson/codechecker Ericsson/codechecker#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.

@Yggdroot
Copy link
Owner

Yggdroot commented Jul 12, 2023

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"
Ericsson/codechecker#3847
The "[fix] is simply to pass arch flag correctly. See [fix] Pass arch flag correctly by vodorok · Pull Request #3854 · Ericsson/codechecker Ericsson/codechecker#384

Could you fix it as per the information?

@Herk2
Copy link
Author

Herk2 commented Jul 12, 2023 via email

@Yggdroot
Copy link
Owner

tensorflow/tensorflow#15484 is similar issue, hope this may help.

@Herk2
Copy link
Author

Herk2 commented Jul 12, 2023 via email

@Yggdroot
Copy link
Owner

@Herk2
Copy link
Author

Herk2 commented Jul 12, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants