homebrew-tap
homebrew-tap copied to clipboard
Can't load `Dispatch` when statically compiling `Foundation`
When statically compiling a package that imports Foundation, the build fails since Dispatch can't be loaded/found.
To reproduce, run:
$ swift package init --type executable
then add import Foundation to main.swift.
$ swift build \
--destination /usr/local/lib/swift/dst/x86_64-unknown-linux/swift-5.3-ubuntu16.04.xtoolchain/destination.json \
--static-swift-stdlib \
-Xswiftc "-static-executable"
<unknown>:0: error: cannot load underlying module for 'Dispatch'
<module-includes>:5:10: note: in file included from<module-includes>:5:
#include "private_includes/utmp.h"
^
/usr/local/lib/swift/dst/x86_64-unknown-linux/swift-5.3-ubuntu16.04.xtoolchain/x86_64-ubuntu16.04.sdk/usr/lib/swift/linux/x86_64/private_includes/utmp.h:1:10: note: in file included from /usr/local/lib/swift/dst/x86_64-unknown-linux/swift-5.3-ubuntu16.04.xtoolchain/x86_64-ubuntu16.04.sdk/usr/lib/swift/linux/x86_64/private_includes/utmp.h:1:
#include <utmp.h>
^
/usr/local/lib/swift/dst/x86_64-unknown-linux/swift-5.3-ubuntu16.04.xtoolchain/x86_64-ubuntu16.04.sdk/usr/include/utmp.h:23:10: note: in file included from /usr/local/lib/swift/dst/x86_64-unknown-linux/swift-5.3-ubuntu16.04.xtoolchain/x86_64-ubuntu16.04.sdk/usr/include/utmp.h:23:
#include <sys/types.h>
I think this mirrors https://github.com/SwiftXcode/swift-lambda/issues/3
Do you mind if I keep this issue open so it points to the issue you mentioned?
Hi there, has there been any new success with getting Foundation to compile statically for AWS lambdas?