Skip to content

Fix the clang dependency of sourcekit libraries. #78073

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

Open
wants to merge 1 commit into
base: release/5.10
Choose a base branch
from

Conversation

hjyamauchi
Copy link
Contributor

@hjyamauchi hjyamauchi commented Dec 9, 2024

Because swift_swap_compiler_if_needed updates the compiler ID to Clang, we need to account for it when deciding to add a dependency on clang. Otherwise, the sourcekit build could fail due to the clang executable not having been built there yet.

Cherrypick PR #68780
Cherrypick commit 71d8118

We see non-deterministic build failures when clang-cl.exe happened to have not been created yet depending on the timing. This cherrypick should fix that.

FAILED: tools/swift/tools/SourceKit/lib/Support/CMakeFiles/SourceKitSupport.dir/Logging.cpp.obj 
sccache C:\a\swift-build\swift-build\BinaryCache\1\.\bin\clang-cl.exe  /nologo /TP -DGTEST_HAS_RTTI=0 -DLLVM_ON_WIN32 -DSWIFT_THREADING_WIN32 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_USE_BUILTIN_OFFSETOF -D_CRT_USE_WINAPI_FAMILY_DESKTOP_APP -D_DLL -D_ENABLE_ATOMIC_ALIGNMENT_FIX -D_ENABLE_EXTENDED_ALIGNED_STORAGE=1 -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_HAS_STATIC_RTTI=0 -D_LIBCPP_ENABLE_ASSERTIONS -D_MD -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -IC:\a\swift-build\swift-build\BinaryCache\1\tools\swift\tools\SourceKit\lib\Support -IC:\a\swift-build\swift-build\SourceCache\swift\tools\SourceKit\lib\Support -IC:\a\swift-build\swift-build\BinaryCache\1\tools\swift\tools\SourceKit\include -IC:\a\swift-build\swift-build\SourceCache\swift\tools\SourceKit\include -IC:\a\swift-build\swift-build\BinaryCache\1\tools\swift\include -IC:\a\swift-build\swift-build\SourceCache\swift\stdlib\public\SwiftShims -IC:\a\swift-build\swift-build\SourceCache\swift\include -IC:\a\swift-build\swift-build\BinaryCache\1\include -IC:\a\swift-build\swift-build\SourceCache\llvm-project\llvm\include -IC:\a\swift-build\swift-build\BinaryCache\1\tools\clang\include -IC:\a\swift-build\swift-build\SourceCache\llvm-project\llvm\..\clang\include -IC:\a\swift-build\swift-build\SourceCache\swift-cmark\src\include -IC:\a\swift-build\swift-build\BinaryCache\1\tools\cmark\src -IC:\a\swift-build\swift-build\SourceCache\swift-corelibs-libdispatch\src\BlocksRuntime -IC:\a\swift-build\swift-build\SourceCache\swift-corelibs-libdispatch -external:I"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.39.33519\\include" -external:I"C:\Program Files (x86)\Windows Kits\10\\Include\10.0.26100.0\ucrt" -external:I"C:\Program Files (x86)\Windows Kits\10\\Include\10.0.26100.0\shared" -external:I"C:\Program Files (x86)\Windows Kits\10\\Include\10.0.26100.0\um" -external:W0 /GS- /Gw /Gy /Oi /Oy /Z7 /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Zc:inline /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd4324 -w14062 -we4238 /Gw /we4062 /wd4068 /permissive- -DOBJC_OLD_DISPATCH_PROTOTYPES=0 /MD /O2 /Ob2 -std:c++17  /EHs-c- /GR- -UNDEBUG --target=x86_64-unknown-windows-msvc -O2 /GR- -U_DEBUG -fblocks /showIncludes /Fotools\swift\tools\SourceKit\lib\Support\CMakeFiles\SourceKitSupport.dir\Logging.cpp.obj /Fdtools\swift\tools\SourceKit\lib\Support\CMakeFiles\SourceKitSupport.dir\SourceKitSupport.pdb /FS -c C:\a\swift-build\swift-build\SourceCache\swift\tools\SourceKit\lib\Support\Logging.cpp
sccache: error: failed to execute compile
sccache: caused by: cannot find binary path

Because swift_swap_compiler_if_needed updates the compiler ID to
Clang, we need to account for it when deciding to add a dependency on
clang. Otherwise, the sourcekit build could fail due to the clang
executable not having been built there yet.

Cherrypick PR swiftlang#68780
Cherrypick commit 71d8118
@hjyamauchi
Copy link
Contributor Author

@swift-ci please test

1 similar comment
@hjyamauchi
Copy link
Contributor Author

@swift-ci please test

@hjyamauchi hjyamauchi marked this pull request as ready for review December 10, 2024 23:53
@hjyamauchi hjyamauchi requested a review from a team December 10, 2024 23:54
@compnerd
Copy link
Member

CC: @airspeedswift @shahmishal

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

Successfully merging this pull request may close these issues.

2 participants