-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Description
Currently, we do not properly build static libraries on Windows due to the way that the library is built. A static library is effectively an archive of the object files (on all platforms), however the mechanism for building the archive is different. Darwin requires a BSD style index, other Unicies prefer a GNU style index (but do not require it). Windows does not require an index but does not have the Unix archiver but rather a dedicated librarian. The librarian is invoked through the linker with a mode specifier (link /LIB).
https://github.com/apple/swift-package-manager/blob/main/Sources/LLBuildManifest/BuildManifest.swift#L91-L99 constructs the ArchiveTool.
This likely is mapped to https://github.com/apple/swift-llbuild/blob/main/lib/BuildSystem/BuildSystem.cpp#L3343-L3345.
The construction of the command then uses https://github.com/apple/swift-llbuild/blob/main/lib/BuildSystem/BuildSystem.cpp#L3303-L3313 which assumes that ar is the tool to build the archive which causes a failure on Windows as there is no archiver.
Expected behavior
No response
Actual behavior
No response
Steps to reproduce
No response
Swift Package Manager version/commit hash
No response
Swift & OS version (output of swift --version && uname -a)
No response