-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Support bootstrapping with Xcode #40838
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
Support bootstrapping with Xcode #40838
Conversation
This comment has been minimized.
This comment has been minimized.
7b33141
to
115f9c6
Compare
I was able to fix the other problem too! So now, bootstrapping also works with Xcode! Both "bootstrapping" and "bootstrapping-with-hostlibs" are working. |
A `/${CMAKE_CFG_INTDIR}` was missing in a path. With Ninja, this does not matter because then it is always "". But with Xcode, it is "Debug", "Release", etc..
115f9c6
to
e77d731
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fine to me from the CMake perspective, no idea about the Xcode builds.
SwiftCompilerSources/CMakeLists.txt
Outdated
# Therefore, it fails to create the static library. As a workaround, | ||
# we create just a dummy source file. | ||
if (XCODE) | ||
set(dummy_source_file "${build_dir}/dummy.cpp") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would be happier with a random SHA sum as the filename rather than something which could collide. What happens with only objects in the archive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found a more elegant solution, that works too: creating an empty script phase. That is probably nicer than creating a dummy file. (And if we generated a random SHA sum for the dummy file name every time that CMake runs, wouldn't that cause dummy files to pile up in the build dir?)
Without a dummy file or script phase, Xcode would completely ignore the library target, not even mentioning it in the logs. (It does appear in the Xcode GUI, but is never built.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't suggesting a random SHA sum :) You could generate a SHA sum of the target name. The empty files in the build tree don't really matter - they would get cleaned up when you clean up the build tree (and only impact the Xcode builds).
Xcode does not compile libraries that contain only object files; it just skips them completely, not even mentioning them in the logs. Therefore, it fails to create the static library that would contain all SwiftCompilerSources object files. As a workaround, we add a dummy script phase to the target, to force that it gets compiled.
e77d731
to
5ad98aa
Compare
@swift-ci please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
@swift-ci test macOS platform |
A
/${CMAKE_CFG_INTDIR}
was missing in a path. With Ninja, this does not matter because then it is always "". But with Xcode, it is "Debug", "Release", etc.. This causes SR-15705, which is also the error mentioned in #40833.Edit: fixed the other problems too (see comments), now it fully works.