swift
swift copied to clipboard
[static-stdlib] Move static-executable-args.lnk under stdlib/public/Resources/linux
This is a preparatory change for adding a static executable support for WASI
@swift-ci Please smoke test
@swift-ci Please smoke test
@swift-ci build toolchain
I tested the built toolchain and it looks working at least for a simple scenario
$ curl https://download.swift.org/tmp/pull-request/66423/470/ubuntu2004/PR-ubuntu2004.tar.gz | tar xz
$ echo 'print("Hello")' > main.swift
$ ./usr/bin/swiftc main.swift -static-executable
$ ./main
Please also test a simple async @main function with static linking on Linux, which implicitly requires Dispatch. We had multiple regressions in that area recently, so I'm cautious about changes in that area.
Sure! I've tested with the following snippets and they work well
@main
struct Main {
static func main() {
print("ok")
}
}
@main
struct Main {
static func main() async {
try! await Task.sleep(nanoseconds: 1000)
print("ok")
}
}
import Foundation
@main
struct Main {
static func main() {
print("ok", UUID())
}
}
And checked .lnk is installed in the correct place usr/lib/swift_static/linux/static-executable-args.lnk