-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Added more details to "Building Swift on Windows" #28496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added more details to "Building Swift on Windows" #28496
Conversation
The image doesn't render? I'm not sure that we really want images as part of the directions though - this is something we should be doing to simplify the build, not adding images. Why the link to the french translation? The names for the components can change, I think it probably makes more sense to provide instructions to automate the installation of the features through an unattended installation invocation. |
Thanks for the interesting reviews. Here are my replies.
I removed the image. I just wanted to insist on launching the Visual Studio command line and not the regular one.
Fixed the link. It allows to find the component name from its ID. It is useful when we select components from Visual Studio installer IU.
I removed the names of the components and just kept the link. About the instruction, I agree :). Thanks to your suggestion, I have found that the visual studio installer can install components from the command line. It would be interesting to investigate this. For example, we can provide commands that install the necessary packages for VS2019. If possible, I suggest to work on the installer cli in another PR. |
docs/WindowsBuild.md
Outdated
@@ -71,7 +91,9 @@ Warning: Creating the above links usually requires administrator privileges. The | |||
|
|||
```cmd | |||
md "S:\b\toolchain" | |||
cmake -B "S:\b\toolchain" -G Ninja -S S:\toolchain\llvm -C S:\windows-swift\cmake\caches\Windows-x86_64.cmake -C S:\windows-swift\cmake\caches\org.compnerd.dt.cmake -DLLVM_ENABLE_ASSERTIONS=YES -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;cmark;swift;lldb;lld" -DLLVM_EXTERNAL_PROJECTS="cmark;swift" -DSWIFT_PATH_TO_LIBDISPATCH_SOURCE=S:\toolchain\swift-corelibs-libdispatch -DLLVM_ENABLE_PDB=YES -DLLDB_DISABLE_PYTHON=YES -DSWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE="S:/Library/icu-64/usr/include" -DSWIFT_WINDOWS_x86_64_ICU_UC="S:/Library/icu-64/usr/lib/icuuc64.lib" -DSWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE="S:/Library/icu-64/usr/include" -DSWIFT_WINDOWS_x86_64_ICU_I18N="S:/Library/icu-64/usr/lib/icuin64.lib" -DCMAKE_INSTALL_PREFIX="C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr" -DPYTHON_EXECUTABLE=C:\Python27\python.exe -DSWIFT_BUILD_DYNAMIC_STDLIB=YES -DSWIFT_BUILD_DYNAMIC_SDK_OVERLAY=YES | |||
set PYTHON_EXE=(your python.exe full path) | |||
set INSTALL_PREFIX=C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the value that is gained from using the extra variable here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the extra variables to reduce the size of the commands. It also allows to reuse in other commands where the python path is needed.
For example, my python.exe has a quite log path ...\AppData\Local\Programs\Python\Python38\python.exe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The paths are going to be long, the majority of the commands are just paths, they are not intrinsically long. The reason for the commands being this way is to aid in copy/paste execution and recall in cmd which doesn't have a lot of the nice features of Unix. Id really prefer not relying on extra variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. I rolled back my modifications on this part
- [SQLite](https://dev.azure.com/compnerd/windows-swift/_build?definitionId=12&_a=summary) | ||
- [curl](https://dev.azure.com/compnerd/windows-swift/_build?definitionId=11&_a=summary) | ||
- [libxml2](https://dev.azure.com/compnerd/windows-swift/_build?definitionId=10&_a=summary) | ||
- [zlib](https://dev.azure.com/compnerd/windows-swift/_build?definitionId=16&_a=summary) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea with the links. However, I think that we can actually do this much better now. I've been playing around with more automation and something like this works really well:
pip install azure
C:\Python27\python.exe windows-swift\utilities\windows-swift.py --build 10 --build 11 --build 12 --build 16 --download-latest-artifacts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks :)
I agree that the command looks great. We can keep the link for information purpose. What do you think ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
Hello @compnerd and happy new year. Can the PR be accepted as it is right now ? Thanks, |
@swift-ci please smoke test |
Hi. I have added more details on building Swift on Windows. I added further details in three aspects:
I hope that these additions will make the build process more straightforward :).
I also took the opportunity to clean up the markdown file.
Thanks for the review,