Swift 在 FreeBSD 上的预览版
Swift on FreeBSD Preview

原始链接: https://forums.swift.org/t/swift-on-freebsd-preview/83064

Swift工具链的预览版现在适用于FreeBSD 14.3+的x86_64机器!该软件包可从[https://download.swift.org/tmp-ci-nightly/development/freebsd-14_ci_latest.tar.gz](https://download.swift.org/tmp-ci-nightly/development/freebsd-14_ci_latest.tar.gz)下载,包含一个Swift编译器和运行时,用于直接在FreeBSD上开发Swift程序。 用户需要安装zlib-ng、python3、sqlite3、libuuid和curl等依赖项。但需要注意的是,这是一个开发预览版,存在已知问题,包括线程清理器、LLDB、SwiftPM插件、C++互操作性和库导入(当前使用Glibc)等方面的问题。 团队正在致力于aarch64支持和更广泛的FreeBSD 14兼容性。鼓励通过Swift GitHub仓库([https://github.com/swiftlang/swift/issues](https://github.com/swiftlang/swift/issues))提交错误报告,并欢迎社区贡献!

## Swift 在 FreeBSD 上:总结 最近的消息强调了 FreeBSD 上 Swift 支持的预览版,引发了开发者之间的讨论。虽然 Swift 与苹果生态系统联系紧密,但此举标志着其平台覆盖范围持续扩大,此前已于 2015 年建立了 Linux 移植。 讨论的重点是 Swift 的可移植性优势,特别是对于已经熟悉该语言并可能希望构建后端或跨平台应用程序的开发者而言。有些人质疑其必要性,因为已经存在 Node.js、Python、React Native 和 Flutter 等成熟的替代方案。另一些人则指出 Swift 的优势——内存安全、并发特性和现代语法——使其成为一个值得考虑的选择。 一个关键的争论围绕着 UI 框架。虽然 SwiftUI 的直接移植似乎不太可能,但开发者正在探索第三方解决方案,以将 Swift UI 带到 Android 和其他平台。讨论还涉及跨平台 UI 开发的挑战以及在 iOS/macOS 应用程序与其后端之间共享代码的潜力。 最终,FreeBSD 移植扩展了 Swift 的潜力,并为开发者提供了另一个选择,特别是对于那些希望扩大部署可能性的苹果生态系统投资者的选择。
相关文章

原文

We have been hard at work to bring the Swift toolchain to FreeBSD. A preview Swift bundle for FreeBSD 14.3+ is available at https://download.swift.org/tmp-ci-nightly/development/freebsd-14_ci_latest.tar.gz. The bundle contains a Swift development compiler and Swift runtimes needed for compiling Swift programs on, and for, FreeBSD 14 on x86_64 machines.

Dependencies

The Swift compiler and runtimes have a few dependencies. Please install the following dependencies:

  • zlib-ng
  • python3
  • sqlite3
  • libuuid
  • curl

Known Issues

The compiler in the bundle is still under development and isn't part of a release yet and we're not quite done porting everything to FreeBSD.

Here is a list of known issues that you may run into while trying things out.

  • Thread sanitizer reports incorrect failures
  • LLDB is unable to execute Swift expressions
  • Command Plugins in a SwiftPM package hangs
  • Using standard types with C++ interop results in an undefined voidify symbol
  • Importing the C libraries is done through "Glibc". This will change to import FreeBSD
  • lld and lldb depend on libxml2.so.2, which is not be available in the system package manager.

We are investigating adding aarch64 support and making the bundle available for all minor versions of FreeBSD 14.

As you find more bugs, please file issues at https://github.com/swiftlang/swift/issues.

We look forward to hearing your feedback. If you're interested in helping add the finishing polish, please feel free to reach out here on the forums.

11 Likes

联系我们 contact @ memedata.com