# Announcing Swift 5.9.1 for Linux and Windows

**URL:** <https://forums.swift.org/t/announcing-swift-5-9-1-for-linux-and-windows/67955>\
**Category:** Announcements\
**Created:** [October 19, 2023, 8:12pm UTC](https://forums.swift.org/t/announcing-swift-5-9-1-for-linux-and-windows/67955 "2023-10-19T20:12:14Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![mishal\_shah](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/mishal_shah/32/247_2.png) [@mishal\_shah](https://forums.swift.org/u/mishal_shah)\
**Post date:** [October 19, 2023, 8:12pm UTC](https://forums.swift.org/t/announcing-swift-5-9-1-for-linux-and-windows/67955/1 "2023-10-19T20:12:15Z")

</div>

We are happy to announce the release of **Swift 5.9.1** for Linux and Windows.  
New downloads are available on [Swift.org - Download Swift](https://www.swift.org/download/)

**Release Notes**

- Macros support on Windows platform
- Windows toolchain built on [swift.org](http://swift.org/) infrastructure and signed by Apple
- Enable frame pointers when building Swift libraries on Linux

**Security Fix**

- Windows toolchain contains security fix for curl
  - [CVE-2023-38545](https://curl.se/docs/CVE-2023-38545.html): severity HIGH - SOCKS5 heap buffer overflow
  - [CVE-2023-38546](https://curl.se/docs/CVE-2023-38546.html): severity LOW - cookie injection with none file

---

<div class="post-metadata">

**Author:** ![sspringer](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sspringer](https://forums.swift.org/u/sspringer)\
**Post date:** [October 20, 2023, 1:59pm UTC](https://forums.swift.org/t/announcing-swift-5-9-1-for-linux-and-windows/67955/2 "2023-10-20T13:59:26Z")

</div>

> [@mishal\_shah](#):
>
> Windows toolchain built on [swift.org](http://swift.org/) infrastructure and signed by Apple

There are no Windows builds listed on [https://ci.swift.org](https://ci.swift.org) yet, right? I assume it is built and tested on Windows 11, and not on Windows 10? There might be edge cases where those two OS versions behave differently.

---

<div class="post-metadata">

**Author:** ![compnerd](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/compnerd/32/2165_2.png) [@compnerd](https://forums.swift.org/u/compnerd)\
**Post date:** [October 20, 2023, 4:59pm UTC](https://forums.swift.org/t/announcing-swift-5-9-1-for-linux-and-windows/67955/3 "2023-10-20T16:59:52Z")

</div>

> [@sspringer](#):
>
> There might be edge cases where those two OS versions behave differently.

Interesting, I don't know how the build would impact that, only the SDK version and the host should be the important aspect (e.g. even if you build on Windows 7, it shouldn't matter as long as the minimum OS requirement is 10). Do you have any concrete examples that should be explicitly tested?

---

<div class="post-metadata">

**Author:** ![sspringer](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sspringer](https://forums.swift.org/u/sspringer)\
**Post date:** [October 21, 2023, 5:44pm UTC](https://forums.swift.org/t/announcing-swift-5-9-1-for-linux-and-windows/67955/4 "2023-10-21T17:44:14Z")

</div>

> [@compnerd](#):
>
> Do you have any concrete examples that should be explicitly tested?

We have a project that compiles fine with Swift 5.9(.0) on macOS, on Ubuntu 22, and on Windows 11, but on Windows 10 we get the error "'main' attribute cannot be used in a module that contains top-level code". We get this error on two different Windows 10 installations (only those two tried).

Unfortunately the project is closed source so I cannot give it to you, I would have to reduce the project accordingly (I should try). (Just a few details: It is a project using the swift argument parser 1.0.1 and uses another package that is located siede-by-side, referenced via `.package(path: ...)`, this referenced package uses another package with C code that is only compiled on Windows.)

From my experience I expect Microsoft to be very cautious concerning changes for one major OS version, but to be a little bit more "generous" concerning changes between major OS versions. So given that the project does not compile on two Windows 10 installations but compiles on a Windows 11 let us suspect that Windows 10 vs. Windows 11 might be causing the difference. Of course, this is so far only speculation, but this why I wanted to see at [https://ci.swift.org](https://ci.swift.org) if a specified version of Windows is used for the CI.

This problem was also mentioned in [another topic](https://forums.swift.org/t/the-windows-compiler-main/63122) and maybe this Windows 10 vs. 11 thing might be indeed an issue.

---

<div class="post-metadata">

**Author:** ![stevapple](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/stevapple/32/31979_2.png) [@stevapple](https://forums.swift.org/u/stevapple)\
**Post date:** [October 22, 2023, 3:51am UTC](https://forums.swift.org/t/announcing-swift-5-9-1-for-linux-and-windows/67955/5 "2023-10-22T03:51:36Z")

</div>

Are you using the same Visual Studio (MSVC) version and Windows SDK version? It’s weird that _Windows_ breaks the compatibility, because internally Windows 10 to 11 has no major version bump.

---

<div class="post-metadata">

**Author:** ![sspringer](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sspringer](https://forums.swift.org/u/sspringer)\
**Post date:** [October 22, 2023, 3:22pm UTC](https://forums.swift.org/t/announcing-swift-5-9-1-for-linux-and-windows/67955/6 "2023-10-22T15:22:42Z")

</div>

> [@stevapple](#):
>
> Are you using the same Visual Studio (MSVC) version and Windows SDK version?

Regarding one Windows 10 system and the Windows 11 system, both Visual Studio installations were up to date, using MSVC v143, and both used Windows 10 SDK 10.0.19041.0. I now changed the SDK to Win 11 SDK 10.0.22621.0 on the Windows 10 machine (because on [swift.org](http://swift.org) the Windows 11 SDK is used), but no luck.

---

<div class="post-metadata">

**Author:** ![paulicelli](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@paulicelli](https://forums.swift.org/u/paulicelli)\
**Post date:** [October 22, 2023, 4:36pm UTC](https://forums.swift.org/t/announcing-swift-5-9-1-for-linux-and-windows/67955/7 "2023-10-22T16:36:58Z")

</div>

Can you provide some links that explain the frame pointer part? Does it lead to shorter compile time?

---

<div class="post-metadata">

**Author:** ![mackoj](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/mackoj/32/42395_2.png) [@mackoj](https://forums.swift.org/u/mackoj)\
**Post date:** [October 22, 2023, 8:23pm UTC](https://forums.swift.org/t/announcing-swift-5-9-1-for-linux-and-windows/67955/8 "2023-10-22T20:23:46Z")

</div>

Swift 5.9.1 seems to be missing `libswiftRegexBuilder.so` on linux, whereas Swift 5.9.0 used to have it.

```swift
./tool: error while loading shared libraries: libswiftRegexBuilder.so: cannot open shared object file: No such file or directory

```

Is this the expected behavior?

Swift was installed on Linux using `swiftly install latest` . To fix this, I changed it to `swiftly install 5.9.0` .

Thanks.

---

<div class="post-metadata">

**Author:** ![compnerd](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/compnerd/32/2165_2.png) [@compnerd](https://forums.swift.org/u/compnerd)\
**Post date:** [October 22, 2023, 11:50pm UTC](https://forums.swift.org/t/announcing-swift-5-9-1-for-linux-and-windows/67955/9 "2023-10-22T23:50:41Z")

</div>

> [@paulicelli](#):
>
> Does

It wouldn't shorten the compile times, if anything, it could increase it. It would however improve debugging. FPO is optional on Linux, but does increase register pressure in favour of a much better debugging experience even on release builds.

---

<div class="post-metadata">

**Author:** ![Finagolfin](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/finagolfin/32/34388_2.png) [@Finagolfin](https://forums.swift.org/u/Finagolfin)\
**Post date:** [October 23, 2023, 11:30pm UTC](https://forums.swift.org/t/announcing-swift-5-9-1-for-linux-and-windows/67955/10 "2023-10-23T23:30:33Z")

</div>

> [@mackoj](#):
>
> Swift 5.9.1 seems to be missing `libswiftRegexBuilder.so` on linux

Can you give more info on which prebuilt toolchain you're installing? I just checked the 5.9.1 toolchain I downloaded four days ago and it is there for me:

```swift
> ag --search-binary swiftRegexBuilder.so swift-5.9.1-RELEASE-ubuntu20.04
Binary file swift-5.9.1-RELEASE-ubuntu20.04/usr/lib/swift/linux/libswiftRegexBuilder.so matches.

```

---

<div class="post-metadata">

**Author:** ![stevapple](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/stevapple/32/31979_2.png) [@stevapple](https://forums.swift.org/u/stevapple)\
**Post date:** [October 24, 2023, 11:56am UTC](https://forums.swift.org/t/announcing-swift-5-9-1-for-linux-and-windows/67955/11 "2023-10-24T11:56:53Z")

</div>

> [@mishal\_shah](#):
>
> Windows toolchain built on [swift.org](http://swift.org/) infrastructure and signed by Apple

One regression found was that the toolchain installer doesn’t set the version correctly, making it a default `0.0.0`. Is this something recognized and going to be fixes in the following releases?

---

<div class="post-metadata">

**Author:** ![mackoj](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/mackoj/32/42395_2.png) [@mackoj](https://forums.swift.org/u/mackoj)\
**Post date:** [October 24, 2023, 4:35pm UTC](https://forums.swift.org/t/announcing-swift-5-9-1-for-linux-and-windows/67955/12 "2023-10-24T16:35:37Z")

</div>

> [@Finagolfin](#):
>
> info on which prebuilt toolchain you're installing? I just checked the 5.9.1 toolchain I downloaded four days ago and it is there for me:
> 
> ```swift
> 
> ```

After more investigation it is because the cli tools was build with swift 5.9.0 and run with swift 5.9.1.

---

<div class="post-metadata">

**Author:** ![sspringer](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sspringer](https://forums.swift.org/u/sspringer)\
**Post date:** [October 29, 2023, 7:11am UTC](https://forums.swift.org/t/announcing-swift-5-9-1-for-linux-and-windows/67955/13 "2023-10-29T07:11:07Z")

</div>

> [@sspringer](#):
>
> Unfortunately the project is closed source so I cannot give it to you, I would have to reduce the project accordingly (I should try).

In [the other topic](https://forums.swift.org/t/the-windows-compiler-main/63122/7) there is a public project mentioned that has the same problem and so anyone should be able to test the issue, and I suppose this other topic is the right place to continue any discussion of the issue.

---

<div class="post-metadata">

**Author:** ![compnerd](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/compnerd/32/2165_2.png) [@compnerd](https://forums.swift.org/u/compnerd)\
**Post date:** [October 29, 2023, 9:35pm UTC](https://forums.swift.org/t/announcing-swift-5-9-1-for-linux-and-windows/67955/14 "2023-10-29T21:35:25Z")

</div>

@stevapple thanks for this; please do file an issue for this. We should fix the release process to ensure that we correctly pass along the version information to the build.
