Skip to content

Add Windows release artifacts#6445

Merged
SimplyDanny merged 5 commits intomainfrom
windows-build
Jan 23, 2026
Merged

Add Windows release artifacts#6445
SimplyDanny merged 5 commits intomainfrom
windows-build

Conversation

@SimplyDanny
Copy link
Copy Markdown
Collaborator

@SimplyDanny SimplyDanny commented Jan 20, 2026

Resolves #6353.

@SimplyDanny SimplyDanny force-pushed the windows-build branch 11 times, most recently from f9dd8ad to 5b19b88 Compare January 21, 2026 07:32
@SimplyDanny SimplyDanny marked this pull request as ready for review January 21, 2026 08:45
@SimplyDanny
Copy link
Copy Markdown
Collaborator Author

@compnerd, @roman-bcny: In order to prepare for a first official (pre-)release including Windows support, I set up this installer build mimicking what you have done for SwiftFormat. Please have a look! 🙏

$archDir = ('${{ matrix.target-triple }}'.Split('-')[0])
$staticLibDir = Join-Path $sdk (Join-Path 'usr\lib\swift_static\windows' $archDir)
Copy-Item -Path (Join-Path $staticLibDir 'libcurl.lib') -Destination (Join-Path $staticLibDir 'curl.lib') -Force
Copy-Item -Path (Join-Path $staticLibDir 'libxml2s.lib') -Destination (Join-Path $staticLibDir 'xml2.lib') -Force
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels very strange. However, it cannot be built without having both names available. I can reproduce this locally.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. Not sure what's up with that. One thing to try could be snapshot from a different date? I had a bunch of those not working last time I checked until I found one that seemed good.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong. I think that the copying here needs to be done because you are missing compile flags. I think that you might need -Xcc -DCURL_STATICLIB -Xcc -DLIBXML_STATIC.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It exists with

[116/118] Write Objects.LinkFileList
lld-link: error: could not open 'xml2.lib': no such file or directory
lld-link: error: could not open 'curl.lib': no such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)

with only these defines.

Copy link
Copy Markdown
Collaborator Author

@SimplyDanny SimplyDanny Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the same with just https://github.com/jpsim/SourceKitten which has Clang dependencies. So I guess some options are not passed on to this lower level and xml2.lib is more or less "hard-coded" somewhere, so it needs to be found as such.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that code generation is impacted by that macro and you now have some code assuming static linking and some assuming dynamic linking. I think that we should simply go through and find and address the incorrect expectation.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works with explicit linking options:

-Xlinker /NODEFAULTLIB:curl -Xlinker libcurl.lib
-Xlinker /NODEFAULTLIB:xml2 -Xlinker libxml2s.lib
-Xlinker zlibstatic.lib
-Xlinker brotlidec.lib
-Xlinker brotlicommon.lib

I think that's acceptable.

$archDir = ('${{ matrix.target-triple }}'.Split('-')[0])
$staticLibDir = Join-Path $sdk (Join-Path 'usr\lib\swift_static\windows' $archDir)
Copy-Item -Path (Join-Path $staticLibDir 'libcurl.lib') -Destination (Join-Path $staticLibDir 'curl.lib') -Force
Copy-Item -Path (Join-Path $staticLibDir 'libxml2s.lib') -Destination (Join-Path $staticLibDir 'xml2.lib') -Force
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong. I think that the copying here needs to be done because you are missing compile flags. I think that you might need -Xcc -DCURL_STATICLIB -Xcc -DLIBXML_STATIC.

@SimplyDanny SimplyDanny force-pushed the windows-build branch 3 times, most recently from 9fa54df to e9deb0f Compare January 23, 2026 10:15
@SimplyDanny SimplyDanny merged commit 1d7f3b6 into main Jan 23, 2026
28 checks passed
@SimplyDanny SimplyDanny deleted the windows-build branch January 23, 2026 19:00
@roman-bcny
Copy link
Copy Markdown
Contributor

🥳

nadeemnali pushed a commit to nadeemnali/SwiftLint that referenced this pull request Feb 26, 2026
nadeemnali pushed a commit to nadeemnali/SwiftLint that referenced this pull request Feb 26, 2026
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.

Prepare release artifacts for Windows as part of CI

3 participants