Skip to content

Conversation

Steelskin
Copy link
Contributor

Make swift-crypto build on Windows

Checklist

  • I've run tests to see all new and existing tests pass
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

If you've made changes to gyb files

  • [N/A] I've run .script/generate_boilerplate_files_with_gyb and included updated generated files in a commit of this pull request

Motivation:

Currently, swift-crypto on the main branch does not build on Windows.

Modifications:

  • Add the Windows Arm64 assembly files to the CMake build.
  • Add appropriate CMake options for swift-crypto to build on Windows.

Result:

swift-crypto can be built on Windows from main

Fixes #369

* Add the Windows Arm64 assembly files to the CMake build.
* Add appropriate CMake options for swift-crypto to build on Windows.

Fixes apple#369
gen/bcm/sha512-armv8-win.S
gen/bcm/vpaes-armv8-win.S
gen/crypto/chacha-armv8-win.S
gen/crypto/chacha20_poly1305_armv8-win.S)
Copy link
Contributor

Choose a reason for hiding this comment

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

These files are generated automatically by this script in swift-nio. I think this first needs a patch to swift-nio to ensure that this script can actually generate these two stanzas. Are you open to making that change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I edited the file here to be more friendly for the script. I opened apple/swift-nio#3275 but I could not figure out how to test it.

@Steelskin
Copy link
Contributor Author

FYI I hit a compiler crash with this, see swiftlang/swift#82589

@Lukasa
Copy link
Contributor

Lukasa commented Jun 30, 2025

Very useful call-out, thankyou.

@Lukasa Lukasa added the 🔨 semver/patch No public API change. label Jul 21, 2025
@etcwilde
Copy link
Member

I'm confused about why this is still failing. When I run it on my Linux box against this PR, it looks like it should pass:

...
** Updated /sources/swift-crypto/Sources/CCryptoBoringSSL/CMakeLists.txt
** ✅ CMake files are up-to-date.

@Lukasa
Copy link
Contributor

Lukasa commented Jul 21, 2025

When I run it I get a very simple diff. I'll try applying it and see what happens.

@Lukasa
Copy link
Contributor

Lukasa commented Jul 21, 2025

Yup, that was it.

@Lukasa Lukasa enabled auto-merge (squash) July 21, 2025 19:31
@Lukasa Lukasa merged commit 9934678 into apple:main Jul 21, 2025
32 checks passed
etcwilde pushed a commit to etcwilde/swift-crypto that referenced this pull request Jul 22, 2025
Make swift-crypto build on Windows

- [X] I've run tests to see all new and existing tests pass
- [X] I've followed the code style of the rest of the project
- [X] I've read the [Contribution Guidelines](CONTRIBUTING.md)
- [X] I've updated the documentation if necessary

- [N/A] I've run `.script/generate_boilerplate_files_with_gyb` and
included updated generated files in a commit of this pull request

Currently, swift-crypto on the main branch does not build on Windows.

* Add the Windows Arm64 assembly files to the CMake build.
* Add appropriate CMake options for swift-crypto to build on Windows.

swift-crypto can be built on Windows from main

Fixes apple#369

---------

Co-authored-by: Cory Benfield <[email protected]>

(cherry picked from commit 9934678)
etcwilde pushed a commit to etcwilde/swift-crypto that referenced this pull request Jul 22, 2025
Make swift-crypto build on Windows

- [X] I've run tests to see all new and existing tests pass
- [X] I've followed the code style of the rest of the project
- [X] I've read the [Contribution Guidelines](CONTRIBUTING.md)
- [X] I've updated the documentation if necessary

- [N/A] I've run `.script/generate_boilerplate_files_with_gyb` and
included updated generated files in a commit of this pull request

Currently, swift-crypto on the main branch does not build on Windows.

* Add the Windows Arm64 assembly files to the CMake build.
* Add appropriate CMake options for swift-crypto to build on Windows.

swift-crypto can be built on Windows from main

Fixes apple#369

---------

Co-authored-by: Cory Benfield <[email protected]>

(cherry picked from commit 9934678)
Lukasa pushed a commit that referenced this pull request Jul 22, 2025
Make swift-crypto build on Windows

- [X] I've run tests to see all new and existing tests pass
- [X] I've followed the code style of the rest of the project
- [X] I've read the [Contribution Guidelines](CONTRIBUTING.md)
- [X] I've updated the documentation if necessary

- [N/A] I've run `.script/generate_boilerplate_files_with_gyb` and
included updated generated files in a commit of this pull request

Currently, swift-crypto on the main branch does not build on Windows.

* Add the Windows Arm64 assembly files to the CMake build.
* Add appropriate CMake options for swift-crypto to build on Windows.

swift-crypto can be built on Windows from main

Fixes #369

---------

Co-authored-by: Cory Benfield <[email protected]>

(cherry picked from commit 9934678)
(#370)

Co-authored-by: Fabrice de Gans <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows Support
3 participants