Description
This is a concern in the Swift installation procedure for Windows 10. Below, after describing the issue, I have a request to change Swift - Getting Started. I am new at Swift, and other thoughts are welcome! And many thanks to all who helped bring Swift to Windows!!! :)
Environment
build number: Swift 5.6.1
OS: Windows 10 desktop computer
Issue Description
Is Swift supposed to be installed before the dependencies or after?
I installed Swift following instructions on Swift - Getting Started. For various reasons, I chose to do the Traditional Install (even though I was installing 5.6.1). In that section there is no explicit step to install Swift after the dependencies, but in the paragraph starting "Swift has been tested with VS 2019", the Download section was referenced before the big box describing the VS components. Because of that, with no other explicit ordering in the instructions, I installed Swift first, then proceeded to install the dependencies.
In hindsight it appears that doing Swift before dependencies was not the correct order, because I later noticed that in On Windows > Install using the Windows Package Manager, that installing Swift clearly follows installing the dependencies. Also on page pwsacademy swift-setup, which I found later on When I install swift correctly..., it says that for the Traditional method, to install Swift after the dependencies.
Back to my install, before any that hindsight: In the Support Files section, due to the Note on 5.4.2, I skipped the 4 copy statements since I was installing 5.6.1. That led to later issues, which I eventually solved by running those 4 copy statements to fix things up. Sigh, much agony.
I didn't test this, but I am guessing if I had installed Swift after the dependencies, that I would not have needed the 4 copy statements, just as directed by the 5.4.2 note.
So due to all that, here is my request. Thanks for considering!
Suggested Documentation Fixes
- On Swift - Getting Started > Installing Swift > On Windows > Installation Instructions > Traditional Installation, move some text...
change this:
Swift has been tested with Visual Studio 2019. You will need to install Visual Studio with the following components. [[The installer for Swift is available in the Download section. The toolchain on Windows is installed to %SystemDrive%\Library\Developer\Toolchains.]]
to this:
Swift has been tested with Visual Studio 2019. You will need to install Visual Studio with the following components.
- And then at:
Support Files
insert the moved sentence, just above 'Support Files', right at the time you need it:
Next install Swift. The installer for Swift is available in the Download section.
And also add these details, akin to the same for macOS:
The toolchain on Windows is installed to %SystemDrive%\Library\Developer\Toolchains.
This install creates the env var:
SDKROOT=C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk
and it adds three directories to the end of the PATH env var:
C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin
C:\Library\Swift-development\bin
C:\Library\icu-69.1\usr\bin
- Also in Support Files,
change this:
You must use the x64 Native Tools for VS2019 Command Prompt to run the following steps.
to this:
You must use the x64 Native Tools for VS2019 Command Prompt, run as Administrator, to run the following steps.
- Finally, if my guess above regarding the order and the 4 copy statements is correct, then all is well. Otherwise, if my order of installs was fine, I did need these Copy statements to fix later errors (see On Windows 10, 'swift build' gets error regarding module ucrt #58450), so please adjust...
At On Windows > Support Files,
delete this note:
NOTE: This is only required for versions older than 5.4.2