Skip to content

[static-stdlib] Move static-executable-args.lnk under stdlib/public/Resources/linux#66423

Merged
kateinoigakukun merged 1 commit intoswiftlang:mainfrom
kateinoigakukun:pr-0c7c2f57b05a694965ab652f57cbfead006a33d7
Jun 19, 2023
Merged

[static-stdlib] Move static-executable-args.lnk under stdlib/public/Resources/linux#66423
kateinoigakukun merged 1 commit intoswiftlang:mainfrom
kateinoigakukun:pr-0c7c2f57b05a694965ab652f57cbfead006a33d7

Conversation

@kateinoigakukun
Copy link
Member

This is a preparatory change for adding a static executable support for WASI

@kateinoigakukun
Copy link
Member Author

@swift-ci Please smoke test

@kateinoigakukun kateinoigakukun force-pushed the pr-0c7c2f57b05a694965ab652f57cbfead006a33d7 branch from 5e9d7b1 to 2bbb65a Compare June 8, 2023 11:45
…esources/linux

This is a preparatory change for adding a static executable support for WASI
@kateinoigakukun kateinoigakukun force-pushed the pr-0c7c2f57b05a694965ab652f57cbfead006a33d7 branch from 2bbb65a to 2410da4 Compare June 8, 2023 11:46
@kateinoigakukun
Copy link
Member Author

@swift-ci Please smoke test

@kateinoigakukun kateinoigakukun marked this pull request as ready for review June 8, 2023 14:36
@MaxDesiatov
Copy link
Contributor

@swift-ci build toolchain

@kateinoigakukun
Copy link
Member Author

kateinoigakukun commented Jun 9, 2023

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

@MaxDesiatov
Copy link
Contributor

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.

@kateinoigakukun
Copy link
Member Author

kateinoigakukun commented Jun 9, 2023

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

@kateinoigakukun kateinoigakukun merged commit f527f72 into swiftlang:main Jun 19, 2023
@kateinoigakukun kateinoigakukun deleted the pr-0c7c2f57b05a694965ab652f57cbfead006a33d7 branch June 19, 2023 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants