-
Notifications
You must be signed in to change notification settings - Fork 61
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
Unable to handle compilation, expected exactly one compiler job #827
Comments
can you provide full clangd logs ? they should contain the compile flags received from your database. it seems like you are compiling for multiple architectures within a single compilation, I don't know what clang flag triggers that though. |
I added
|
As I've suspected, you've got In the meantime you can workaround the issue by putting a .clangd file in your project root with contents:
This will drop all
|
Thanks, that works. |
Yeah exactly which is best is fuzzy (the example shows "first" isn't ideal), but clearly anything is better than what we do now. BTW the easiest way to repro this on non-mac is adding a mac target (exact target doesn't matter).
|
Haha yes, that's how I reproduced locally as well. I even have a patch to
drop all if there's more than one. I think it is more reasonable to just
drop everything in case of multiple arch options and default to host. If
the user wants a particular one they should set it via .clangd. I've got a
patch for that one ready, happy to send it out for review if you also think
that's reasonable.
…On Fri, Aug 6, 2021 at 11:06 AM Sam McCall ***@***.***> wrote:
Yeah exactly which is best is fuzzy (the example shows "first" isn't
ideal), but clearly anything is better than what we do now.
BTW the easiest way to repro this on non-mac is adding a mac target (exact
target doesn't matter).
compile_flags.txt:
--target=arm64e-apple-darwin20
-arch
i386
-arch
x86_64
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#827 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG3EE355VY5EMLTSC224Y3T3OJY3ANCNFSM5A3BFB5Q>
.
|
…ble job. This happens in createInvocationWithCommandLine but only clangd currently passes ShouldRecoverOnErorrs (sic). One cause of this (with correct command) is several -arch arguments for mac multi-arch support. Fixes clangd/clangd#827 Differential Revision: https://reviews.llvm.org/D107632
This patch strips all the arch options in case of multiple ones. As it results in multiple compiler jobs, which clangd cannot handle. It doesn't pick any over the others as it is unclear which one the user wants and defaulting to host architecture seems less surprising. Users also have the ability to explicitly specify the architecture they want via clangd config files. Fixes clangd/clangd#827. Differential Revision: https://reviews.llvm.org/D107634
I built llvm in MacOS (enabled "clang;lld;compiler-rt"), and saw the following error when opening
compiler-rt/lib/profile/InstrProfilingFile.c
. I only saw this kind of error in files under compiler-rt folder. For files under other folders like clang, llvm, lld, I don't see that and it works well.Logs
Unable to handle compilation, expected exactly one compiler job in ' "/Users/zequanwu/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang" "-cc1" "-triple" "i386-apple-ios9.0.0-simulator" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-fsyntax-only" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "InstrProfilingFile.c" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=all" "-fno-rounding-math" "-munwind-tables" "-faligned-alloc-unavailable" "-target-sdk-version=14.5" "-fcompatibility-qualified-id-block-type-checking" "-fvisibility-inlines-hidden-static-local-var" "-target-cpu" "yonah" "-tune-cpu" "generic" "-debugger-tuning=lldb" "-target-linker-version" "609.8" "-nostdinc++" "-resource-dir" "/Users/zequanwu/Library/Application Support/Code/User/globalStorage/llvm-vs-code-extensions.vscode-clangd/install/12.0.0/clangd_12.0.0/lib/clang/12.0.0" "-isysroot" "/Users/zequanwu/llvm-project/sysroot/MacOSX.sdk" "-isysroot" "/Applications/Xcode_12.5.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk" "-D" "_DEBUG" "-D" "__STDC_CONSTANT_MACROS" "-D" "__STDC_FORMAT_MACROS" "-D" "__STDC_LIMIT_MACROS" "-I" "/Users/zequanwu/llvm-project/build/release/projects/compiler-rt/lib/profile" "-I" "/Users/zequanwu/llvm-project/compiler-rt/lib/profile" "-I" "/Users/zequanwu/llvm-project/build/release/include" "-I" "/Users/zequanwu/llvm-project/llvm/include" "-I" "/Users/zequanwu/llvm-project/compiler-rt/lib/profile/.." "-I" "/Users/zequanwu/llvm-project/compiler-rt/lib/profile/../../include" "-D" "NDEBUG" "-D" "COMPILER_RT_HAS_ATOMICS=1" "-D" "COMPILER_RT_HAS_FCNTL_LCK=1" "-D" "COMPILER_RT_HAS_UNAME=1" "-U" "NDEBUG" "-internal-isystem" "/Applications/Xcode_12.5.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/local/include" "-internal-isystem" "/Users/zequanwu/Library/Application Support/Code/User/globalStorage/llvm-vs-code-extensions.vscode-clangd/install/12.0.0/clangd_12.0.0/lib/clang/12.0.0/include" "-internal-externc-isystem" "/Applications/Xcode_12.5.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include" "-O3" "-Werror=date-time" "-Werror=unguarded-availability-new" "-Wall" "-Wextra" "-Wno-unused-parameter" "-Wwrite-strings" "-Wmissing-field-initializers" "-Wno-long-long" "-Wc++98-compat-extra-semi" "-Wimplicit-fallthrough" "-Wcovered-switch-default" "-Wdelete-non-virtual-dtor" "-Wstring-conversion" "-Wmisleading-indentation" "-Wall" "-Wno-unused-parameter" "-Wno-pedantic" "-pedantic" "-fconst-strings" "-fdebug-compilation-dir" "/Users/zequanwu/llvm-project/build/release" "-ferror-limit" "19" "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fmax-type-align=16" "-vectorize-loops" "-vectorize-slp" "-x" "c" "/Users/zequanwu/llvm-project/compiler-rt/lib/profile/InstrProfilingFile.c"; "/Users/zequanwu/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang" "-cc1" "-triple" "x86_64-apple-ios9.0.0-simulator" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-Werror=implicit-function-declaration" "-fsyntax-only" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "InstrProfilingFile.c" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=all" "-fno-rounding-math" "-munwind-tables" "-faligned-alloc-unavailable" "-target-sdk-version=14.5" "-fcompatibility-qualified-id-block-type-checking" "-fvisibility-inlines-hidden-static-local-var" "-target-cpu" "core2" "-tune-cpu" "generic" "-debugger-tuning=lldb" "-target-linker-version" "609.8" "-nostdinc++" "-resource-dir" "/Users/zequanwu/Library/Application Support/Code/User/globalStorage/llvm-vs-code-extensions.vscode-clangd/install/12.0.0/clangd_12.0.0/lib/clang/12.0.0" "-isysroot" "/Users/zequanwu/llvm-project/sysroot/MacOSX.sdk" "-isysroot" "/Applications/Xcode_12.5.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk" "-D" "_DEBUG" "-D" "__STDC_CONSTANT_MACROS" "-D" "__STDC_FORMAT_MACROS" "-D" "__STDC_LIMIT_MACROS" "-I" "/Users/zequanwu/llvm-project/build/release/projects/compiler-rt/lib/profile" "-I" "/Users/zequanwu/llvm-project/compiler-rt/lib/profile" "-I" "/Users/zequanwu/llvm-project/build/release/include" "-I" "/Users/zequanwu/llvm-project/llvm/include" "-I" "/Users/zequanwu/llvm-project/compiler-rt/lib/profile/.." "-I" "/Users/zequanwu/llvm-project/compiler-rt/lib/profile/../../include" "-D" "NDEBUG" "-D" "COMPILER_RT_HAS_ATOMICS=1" "-D" "COMPILER_RT_HAS_FCNTL_LCK=1" "-D" "COMPILER_RT_HAS_UNAME=1" "-U" "NDEBUG" "-internal-isystem" "/Applications/Xcode_12.5.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/local/include" "-internal-isystem" "/Users/zequanwu/Library/Application Support/Code/User/globalStorage/llvm-vs-code-extensions.vscode-clangd/install/12.0.0/clangd_12.0.0/lib/clang/12.0.0/include" "-internal-externc-isystem" "/Applications/Xcode_12.5.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include" "-O3" "-Werror=date-time" "-Werror=unguarded-availability-new" "-Wall" "-Wextra" "-Wno-unused-parameter" "-Wwrite-strings" "-Wmissing-field-initializers" "-Wno-long-long" "-Wc++98-compat-extra-semi" "-Wimplicit-fallthrough" "-Wcovered-switch-default" "-Wdelete-non-virtual-dtor" "-Wstring-conversion" "-Wmisleading-indentation" "-Wall" "-Wno-unused-parameter" "-Wno-pedantic" "-pedantic" "-fconst-strings" "-fdebug-compilation-dir" "/Users/zequanwu/llvm-project/build/release" "-ferror-limit" "19" "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fmax-type-align=16" "-vectorize-loops" "-vectorize-slp" "-x" "c" "/Users/zequanwu/llvm-project/compiler-rt/lib/profile/InstrProfilingFile.c"; "/Users/zequanwu/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang" "-cc1" "-triple" "arm64-apple-ios9.0.0" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-Werror=implicit-function-declaration" "-fsyntax-only" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "InstrProfilingFile.c" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=non-leaf" "-fno-rounding-math" "-munwind-tables" "-faligned-alloc-unavailable" "-target-sdk-version=14.5" "-fcompatibility-qualified-id-block-type-checking" "-fvisibility-inlines-hidden-static-local-var" "-target-cpu" "apple-a7" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-feature" "+crypto" "-target-feature" "+zcm" "-target-feature" "+zcz" "-target-feature" "+sha2" "-target-feature" "+aes" "-target-abi" "darwinpcs" "-fallow-half-arguments-and-returns" "-debugger-tuning=lldb" "-target-linker-version" "609.8" "-nostdinc++" "-resource-dir" "/Users/zequanwu/Library/Application Support/Code/User/globalStorage/llvm-vs-code-extensions.vscode-clangd/install/12.0.0/clangd_12.0.0/lib/clang/12.0.0" "-isysroot" "/Users/zequanwu/llvm-project/sysroot/MacOSX.sdk" "-isysroot" "/Applications/Xcode_12.5.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk" "-D" "_DEBUG" "-D" "__STDC_CONSTANT_MACROS" "-D" "__STDC_FORMAT_MACROS" "-D" "__STDC_LIMIT_MACROS" "-I" "/Users/zequanwu/llvm-project/build/release/projects/compiler-rt/lib/profile" "-I" "/Users/zequanwu/llvm-project/compiler-rt/lib/profile" "-I" "/Users/zequanwu/llvm-project/build/release/include" "-I" "/Users/zequanwu/llvm-project/llvm/include" "-I" "/Users/zequanwu/llvm-project/compiler-rt/lib/profile/.." "-I" "/Users/zequanwu/llvm-project/compiler-rt/lib/profile/../../include" "-D" "NDEBUG" "-D" "COMPILER_RT_HAS_ATOMICS=1" "-D" "COMPILER_RT_HAS_FCNTL_LCK=1" "-D" "COMPILER_RT_HAS_UNAME=1" "-U" "NDEBUG" "-internal-isystem" "/Applications/Xcode_12.5.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/local/include" "-internal-isystem" "/Users/zequanwu/Library/Application Support/Code/User/globalStorage/llvm-vs-code-extensions.vscode-clangd/install/12.0.0/clangd_12.0.0/lib/clang/12.0.0/include" "-internal-externc-isystem" "/Applications/Xcode_12.5.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include" "-O3" "-Werror=date-time" "-Werror=unguarded-availability-new" "-Wall" "-Wextra" "-Wno-unused-parameter" "-Wwrite-strings" "-Wmissing-field-initializers" "-Wno-long-long" "-Wc++98-compat-extra-semi" "-Wimplicit-fallthrough" "-Wcovered-switch-default" "-Wdelete-non-virtual-dtor" "-Wstring-conversion" "-Wmisleading-indentation" "-Wall" "-Wno-unused-parameter" "-Wno-pedantic" "-pedantic" "-fconst-strings" "-fdebug-compilation-dir" "/Users/zequanwu/llvm-project/build/release" "-ferror-limit" "19" "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fmax-type-align=16" "-vectorize-loops" "-vectorize-slp" "-x" "c" "/Users/zequanwu/llvm-project/compiler-rt/lib/profile/InstrProfilingFile.c"; 'clang(fe_expected_compiler_job)
More logs:
There are 13 entries in compilation_database.json with following file field:
"file": "/Users/zequanwu/llvm-project/compiler-rt/lib/profile/InstrProfiling.c"
System information
Clangd version: clangd version 12.0.0 (https://github.com/clangd/llvm-project 8a844a3a321ea56da21af4d48433ad493b1bcfae)
OS: MacOS 11.3.1.
Editor: VS Code 1.58.1
Plugin: clangd
The text was updated successfully, but these errors were encountered: