-
Notifications
You must be signed in to change notification settings - Fork 10.5k
build-script: build static version of Foundation #20824
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
Conversation
CC: @kevints |
Please test with following PRs: @swift-ci please smoke test |
Please test with following PRs: @swift-ci please build toolchain |
macOS Toolchain Install command |
Please test with following PRs: @swift-ci please build toolchain |
Please test with following PRs: @swift-ci please smoke test |
CC: @shahmishal @gottesmm @kevints @spevans It seems that the ICU version on the system is not the version that we are building against?
Note that we are trying to link against the system ICU rather than the version in tmp_install |
Is there a way to get the CMakeCache.txt and build.ninja from the build? |
There should be an built ICU in |
@spevans - should be. I definitely see that being passed to CMake, but, I don't see that in the install logs? Could it be that we aren't populating the library at the time that we think that we are? |
No, interesting, I did find it, I think I wasn't searching for the right name. It seems that CMake doesn't believe that to be available. |
macOS Toolchain Install command |
@compnerd Im just doing a local build with your 2 PRs on ubuntu18 so I will see If I can replicate the issue |
Oh, I think that this might be due to the fact that we are renaming the libraries :/ |
Build and install Foundation static. We now build Foundation using CMake, which does not easily generate static and shared versions of libraries. Create two builds to populate the toolchain distribution.
af22546
to
69e2018
Compare
@swift-ci please smoke test |
@swift-ci please build toolchain |
@@ -2604,7 +2608,7 @@ for host in "${ALL_HOSTS[@]}"; do | |||
esac | |||
|
|||
;; | |||
foundation) | |||
foundation|foundation_static) |
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.
Should we build a static ICU as well?
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.
Yeah, that would be a good idea to do given the rest of the static linking, and the behaviour of glibc's libdl
. But, I think that is beyond the scope of this change.
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.
A static libICU is already built on linux as part of the --libicu
option:
if [ $(true_false "${BUILD_SWIFT_STATIC_STDLIB}") == "TRUE" ]; then
libicu_enable_static="--enable-static"
else
libicu_enable_static=""
fi
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.
Oh, cool. Um, why is that controlled by static stdlib though? Lets get this working and then adjust the static build to use the static ICU.
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.
Since ICU is now bundled (presumably so that "🏴".count == 1
instead of possibly 7) it's on us to build the static version of it as well. -static-stdlib
changes the library search path to lib/swift_static
instead of lib/swift
so if there's no icu libs there it won't work.
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.
What should it be controlled by? Are we adding an extra --static-
flag for each lib? maybe it would be better with a --static-libs
flag instead to build them all together, -static-stdlib
requires all of them anyway
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.
IOW it seems ICU is now considered part of the stdlib, so flags that control the linkage of the stdlib should cover ICU now too
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.
@kevints, this is about the build-script, not the the driver flag. The driver flag remains -static-stdlib
. The icu libs are already present in the swift_static
directory.
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.
Ok @compnerd I was confused then. This looks good to me
@compnerd I got this to work by undoing the
|
Linux Toolchain (Ubuntu 16.04) Install command |
@spevans - the location thing is fixed with swiftlang/swift-corelibs-foundation#1788 ... I think that if this passes the smoke test/toolchain builds, this should be good to go. We should fix up the ICU location in a follow up. Note that the only thing impacted will be plutil. |
macOS Toolchain Install command |
@compnerd I think this is ok now, I just did a test of the latest version along with
As to
|
We could compile something with |
@spevans SGTM. Can you put that together? |
Build and install Foundation static. We now build Foundation using
CMake, which does not easily generate static and shared versions of
libraries. Create two builds to populate the toolchain
distribution.
Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.
Resolves SR-NNNN.