Merge pull request #221358 from stephank/feat/swift-lib-closure

swift: reduce closure size of swift-lib
This commit is contained in:
Guillaume Girol 2023-03-26 18:00:24 +00:00 committed by GitHub
commit 18f0a62146
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -619,7 +619,12 @@ in stdenv.mkDerivation {
# Swift has a separate resource root from Clang, but locates the Clang
# resource root via subdir or symlink. Provide a default here, but we also
# patch Swift to prefer NIX_CC if set.
ln -s ${clang}/resource-root $lib/lib/swift/clang
#
# NOTE: We don't symlink directly here, because that'd add a run-time dep
# on the full Clang compiler to every Swift executable. The copy here is
# just copying the 3 symlinks inside to smaller closures.
mkdir $lib/lib/swift/clang
cp -P ${clang}/resource-root/* $lib/lib/swift/clang/
${lib.optionalString stdenv.isDarwin ''
# Install required library for ObjC interop.