[Windows] Build swiftly on Windows and list toolchains from Windows Installer #619
Why do we need this? Can we not use WinSDK to get the appropriate header pulled in?
Just used swift format using swiftly \:)
Please avoid this pattern. Use win32 APIs directly to get the base name or use URL APIs. Treating the file path as a formatted string is non-portable and error prone.
If possible, I prefer that we pull in swift-tools-support-core for the environment. There was a wrapper that I introduced to deal with the case sensitivity. Windows environment is case insensitive, and duplication is fatal.
Is this for clients or the toolchain? The latter doesn’t need it IMO. We should be now using the SxS bound version which should be loaded by the loader without Path alterations I believe.
Maybe wrap in #if DEBUG.
I would say that installed(cache: FilePath?) reads more naturally. That also allows bypassing the cache if desired/needed.
Why not generalize? Something like func products(vendor:complete:) -> [String:Product].
Why not make installedPaths a property of Product? What benefit does the static version have?
Can this be done as a dictionary initializer?
Component might be better than piece
Perhaps withUTF16Representation is better. I wonder if this should just be a private extension on String?.
Why is this needed? Why not just String(decoding: buffer, as: UTF16.self)? That is why do you need to do the prefix call?
Please use the Windows API rather than hardcoding this.
This seems sketchy.
compnerd
AbdAlRahmanGad
The beginning of bringing Swiftly to Windows. See the Swift Forums proposal.
swiftly now builds and runs on Windows. The OpenAPI clients use openapi-winhttp-transport there (swift-nio-ssl doesn't compile against the Windows SDK), and installed toolchains come from Windows Installer's records of the swift.org MSIs; Linux and macOS are unchanged.
Works on Windows
swift buildbuild Swiftlyswiftly init --skip-install: sets up swiftly's home directory; skips the shell profile, which Windows doesn't haveswiftly --version,swiftly --helpswiftly list: shows toolchains installed with the swift.org installerswiftly list-available: fetches the release list from swift.org over WinHTTPswiftly use,swiftly use <version>,swiftly use --print-location: shows or picks the in-use toolchain- Couldn't test picking different valid toolchain since windows doesn't support having multiple toolchains installed at once
in progress
swiftly runminimal working verision