Skip to content
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

Can't load Dispatch when statically compiling Foundation #11

Open
LebJe opened this issue Feb 17, 2021 · 3 comments
Open

Can't load Dispatch when statically compiling Foundation #11

LebJe opened this issue Feb 17, 2021 · 3 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists help wanted Extra attention is needed

Comments

@LebJe
Copy link

LebJe commented Feb 17, 2021

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>
@helje5
Copy link
Contributor

helje5 commented Feb 17, 2021

I think this mirrors SwiftXcode/swift-lambda#3

@helje5 helje5 added bug Something isn't working duplicate This issue or pull request already exists help wanted Extra attention is needed labels Feb 17, 2021
@LebJe
Copy link
Author

LebJe commented Mar 2, 2021

Do you mind if I keep this issue open so it points to the issue you mentioned?

@benrosen78
Copy link

Hi there, has there been any new success with getting Foundation to compile statically for AWS lambdas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants