Skip to content

Commit 8fb5b99

Browse files
committed
WiX: restructure the toolchain MSI
This restructures the MSIs into a slightly more granular set of MSIs. It reduces the size of the single MSI making the installer proceed a bit more uniformly. bld: Build Tools (binutils, compilers, linker, assembler) cli: Command Line Tools (clang-format, clang-tidy, swift-api-digester, swift-symbolgraph-extract, swift-package-manager) dbg: Debugging Tools (lldb, repl) ide: IDE Integration Tools (clangd, lldb-vscode, sourcekitd, SourceKit-LSP) In the future, this also provides a logical location for DocC (cli), swift-inspect (dbg), and swift-format (cli). Take the opportunity to use the higher compression by default on all the MSIs. This also removes `swift-build-tool` and `swift-build-sdk-interfaces` until we have a need for them. Simultaneously, we are taking advantage of the WiX 4.0 feature to create a dual-purpose MSI. Unfortunately, burn does not support dual-purpose builds and this implicitly migrates the toolchain to a per-user install currently. However, this is desirable as it will likely provide a space free install path along with removing the need for administrator rights.
1 parent be8fb47 commit 8fb5b99

File tree

10 files changed

+496
-418
lines changed

10 files changed

+496
-418
lines changed

platforms/Windows/toolchain.wixproj renamed to platforms/Windows/bld.wixproj

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
<PropertyGroup>
2222
<DefineConstants>ProductArchitecture=$(ProductArchitecture);ProductVersion=$(ProductVersion);DEVTOOLS_ROOT=$(DEVTOOLS_ROOT);TOOLCHAIN_ROOT=$(TOOLCHAIN_ROOT);TOOLCHAIN_ROOT_USR_LIB_CLANG=$(TOOLCHAIN_ROOT)\usr\lib\clang</DefineConstants>
23+
<DefaultCompressionLevel>high</DefaultCompressionLevel>
2324
<InstallerPlatform Condition=" '$(ProductArchitecture)' == 'amd64' ">x64</InstallerPlatform>
2425
<InstallerPlatform Condition=" '$(ProductArchitecture)' == 'arm64' ">arm64</InstallerPlatform>
2526
</PropertyGroup>
@@ -44,6 +45,6 @@
4445
<SuppressRootDirectory>true</SuppressRootDirectory>
4546
</HarvestDirectory>
4647

47-
<Compile Include="toolchain.wxs" />
48+
<Compile Include="bld.wxs" />
4849
</ItemGroup>
4950
</Project>

platforms/Windows/toolchain.wxs renamed to platforms/Windows/bld.wxs

+6-216
Original file line numberDiff line numberDiff line change
@@ -3,203 +3,43 @@
33
<Package
44
Language="1033"
55
Manufacturer="swift.org"
6-
Name="Swift Compiler Tools"
6+
Name="Swift Build Tools"
77
UpgradeCode="7e95dc06-7f84-4e8e-a038-8304af0468fb"
88
Version="$(var.ProductVersion)"
9-
Scope="perMachine">
10-
<SummaryInformation Description="Swift Compiler Tools" />
11-
12-
<!--
13-
NOTE(compnerd) Use high compression as this is an extrodinarily large
14-
cabinet. With upstream being amenable to considering decorations for
15-
DLL builds, this might be possible to reduce in the future hopefully.
16-
In the mean time, burn the CPU cycles to try to claw back the minimal
17-
bit of savings to hedge against the constant complaints that the MSIs
18-
are too large.
19-
-->
20-
<Media Id="1" Cabinet="toolchain.cab" EmbedCab="yes" CompressionLevel="high" />
9+
Scope="perUserOrMachine">
10+
<SummaryInformation Description="Swift Build Tools" />
11+
12+
<Media Id="1" Cabinet="bld.cab" EmbedCab="yes" />
2113

2214
<StandardDirectory Id="ProgramFiles64Folder">
2315
<Directory Id="INSTALLDIR" Name="Swift">
2416
<Directory Id="Toolchains" Name="Toolchains">
2517
<Directory Id="xctoolchain" Name="$(var.ProductVersion)+Asserts">
2618
<Directory Id="_usr" Name="usr">
2719
<Directory Id="_usr_bin" Name="bin">
28-
<Component Id="clang_format.exe">
29-
<File Id="clang_format.exe" Source="$(var.TOOLCHAIN_ROOT)\usr\bin\clang-format.exe" Checksum="yes" />
30-
</Component>
31-
<Component Id="clang_tidy.exe">
32-
<File Id="clang_tidy.exe" Source="$(var.TOOLCHAIN_ROOT)\usr\bin\clang-tidy.exe" Checksum="yes" />
33-
</Component>
34-
<Component Id="clangd.exe">
35-
<File Id="clangd.exe" Source="$(var.TOOLCHAIN_ROOT)\usr\bin\clangd.exe" Checksum="yes" />
36-
</Component>
37-
38-
<!-- lldb -->
39-
<Component Id="lldb_server.exe">
40-
<File Id="lldb_server.exe" Source="$(var.TOOLCHAIN_ROOT)\usr\bin\lldb-server.exe" Checksum="yes" />
41-
</Component>
42-
<Component Id="lldb_vscode.exe">
43-
<File Id="lldb_vscode.exe" Source="$(var.TOOLCHAIN_ROOT)\usr\bin\lldb-vscode.exe" Checksum="yes" />
44-
</Component>
45-
<Component Id="lldb.exe">
46-
<File Id="lldb.exe" Source="$(var.TOOLCHAIN_ROOT)\usr\bin\lldb.exe" Checksum="yes" />
47-
</Component>
48-
<Component Id="repl_swift.exe">
49-
<File Id="repl_swift.exe" Source="$(var.TOOLCHAIN_ROOT)\usr\bin\repl_swift.exe" Checksum="yes" />
50-
</Component>
51-
52-
<Component Id="liblldb.dll">
53-
<File Id="liblldb.dll" Source="$(var.TOOLCHAIN_ROOT)\usr\bin\liblldb.dll" Checksum="yes" />
54-
</Component>
55-
56-
<!-- SourceKit -->
57-
<Component Id="sourcekitdInProc.dll">
58-
<File Id="sourcekitdInProc.dll" Source="$(var.TOOLCHAIN_ROOT)\usr\bin\sourcekitdInProc.dll" Checksum="yes" />
59-
</Component>
60-
61-
<!-- swift -->
62-
63-
<!-- TODO(compnerd) can we use symbolic links instead? -->
64-
<Component Id="swift_api_digester.exe">
65-
<File Id="swift_api_digester.exe" Source="$(var.TOOLCHAIN_ROOT)\usr\bin\swift-api-digester.exe" Checksum="yes" />
66-
</Component>
67-
<Component Id="swift_symbolgraph_extract.exe">
68-
<File Id="swift_symbolgraph_extract.exe" Source="$(var.TOOLCHAIN_ROOT)\usr\bin\swift-symbolgraph-extract.exe" Checksum="yes" />
69-
</Component>
70-
71-
<!-- llbuild -->
72-
<Component Id="swift_build_tool.exe">
73-
<File Id="swift_build_tool.exe" Source="$(var.DEVTOOLS_ROOT)\usr\bin\swift-build-tool.exe" Checksum="yes" />
74-
</Component>
75-
<Component Id="llbuildSwift.dll">
76-
<File Id="llbuildSwift.dll" Source="$(var.DEVTOOLS_ROOT)\usr\bin\llbuildSwift.dll" Checksum="yes" />
77-
</Component>
78-
79-
<!-- swift-driver -->
80-
<Component Id="swift_build_sdk_interfaces.exe">
81-
<File Id="swift_build_sdk_interfaces.exe" Source="$(var.DEVTOOLS_ROOT)\usr\bin\swift-build-sdk-interfaces.exe" Checksum="yes" />
82-
</Component>
8320
</Directory>
84-
8521
<Directory Id="_usr_include" Name="include">
8622
<Directory Id="_usr_include__InternalSwiftScan" Name="_InternalSwiftScan">
8723
</Directory>
88-
8924
<Directory Id="_usr_include_clang_c" Name="clang-c">
9025
</Directory>
91-
92-
<Directory Id="_usr_include_dispatch" Name="dispatch">
93-
</Directory>
94-
9526
<Directory Id="_usr_include_indexstore" Name="indexstore">
9627
</Directory>
97-
98-
<Directory Id="_usr_include_lldb" Name="lldb">
99-
</Directory>
100-
10128
<Directory Id="_usr_include_llvm_c" Name="llvm-c">
10229
</Directory>
103-
104-
<Directory Id="_usr_include_os" Name="os">
105-
</Directory>
106-
107-
<Directory Id="_usr_include_SourceKit" Name="SourceKit">
108-
<Component Id="sourcekitd.h">
109-
<File Id="sourcekitd.h" Source="$(var.TOOLCHAIN_ROOT)\usr\include\SourceKit\sourcekitd.h" Checksum="yes" />
110-
</Component>
111-
</Directory>
11230
</Directory>
113-
11431
<Directory Id="_usr_lib" Name="lib">
115-
<Component Id="liblldb.lib">
116-
<File Id="liblldb.lib" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\liblldb.lib" Checksum="yes" />
117-
</Component>
118-
119-
<Component Id="sourcekitdInProc.lib">
120-
<File Id="sourcekitdInProc.lib" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\sourcekitdInProc.lib" Checksum="yes" />
121-
</Component>
122-
12332
<Directory Id="_usr_lib_clang" Name="clang">
12433
</Directory>
125-
126-
<Directory Id="_usr_lib_site_packages" Name="site-packages">
127-
<Directory Id="_usr_lib_site_packages_lldb" Name="lldb">
128-
<Component Id="__init__.py_c31e016e2f8b4fba9eebd73d5009e919">
129-
<File Id="___init__.py_c31e016e2f8b4fba9eebd73d5009e919" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\__init__.py" Checksum="yes" />
130-
</Component>
131-
<Component Id="_lldb.py">
132-
<File Id="_lldb.pyd" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\_lldb.pyd" Checksum="yes" />
133-
</Component>
134-
<Component Id="embedded_interpreter.py">
135-
<File Id="embedded_interpreter.py" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\embedded_interpreter.py" Checksum="yes" />
136-
</Component>
137-
<Component Id="lldb_argdumper.exe">
138-
<File Id="lldb_argdumper.exe" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\lldb-argdumper.exe" Checksum="yes" />
139-
</Component>
140-
141-
<Directory Id="_usr_lib_site_packages_lldb_formatters" Name="formatters">
142-
<Component Id="logger.py">
143-
<File Id="logger.py" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\formatters\Logger.py" Checksum="yes" />
144-
</Component>
145-
<Component Id="__init__.py_6124a6ee9e584275b153b0e1ddb4a2b2">
146-
<File Id="___init__.py_6124a6ee9e584275b153b0e1ddb4a2b2" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\formatters\__init__.py" Checksum="yes" />
147-
</Component>
148-
<Component Id="attrib_fromdict.py">
149-
<File Id="attrib_fromdict.py" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\formatters\attrib_fromdict.py" Checksum="yes" />
150-
</Component>
151-
<Component Id="cache.py">
152-
<File Id="cache.py" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\formatters\cache.py" Checksum="yes" />
153-
</Component>
154-
<Component Id="metrics.py">
155-
<File Id="metrics.py" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\formatters\metrics.py" Checksum="yes" />
156-
</Component>
157-
<Component Id="synth.py">
158-
<File Id="synth.py" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\formatters\synth.py" Checksum="yes" />
159-
</Component>
160-
161-
<Directory Id="_usr_lib_site_packages_lldb_formatters_cpp" Name="cpp">
162-
<Component Id="__init__.py_1bd1d2dc68b7417b83484f6183339af2">
163-
<File Id="___init__.py_1bd1d2dc68b7417b83484f6183339af2" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\formatters\cpp\__init__.py" Checksum="yes" />
164-
</Component>
165-
<Component Id="gnu_libstdcpp.py">
166-
<File Id="gnu_libstdcpp.py" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\formatters\cpp\gnu_libstdcpp.py" Checksum="yes" />
167-
</Component>
168-
<Component Id="libcxx.py">
169-
<File Id="libcxx.py" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\formatters\cpp\libcxx.py" Checksum="yes" />
170-
</Component>
171-
</Directory>
172-
</Directory>
173-
174-
<Directory Id="_usr_lib_site_packages_lldb_utils" Name="utils">
175-
<Component Id="__init__.py_52ef75ed702f4acc8272e6b2f8aa5392">
176-
<File Id="___init__.py_52ef75ed702f4acc8272e6b2f8aa5392" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\utils\__init__.py" Checksum="yes" />
177-
</Component>
178-
<Component Id="in_call_stack.py">
179-
<File Id="in_call_stack.py" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\utils\in_call_stack.py" Checksum="yes" />
180-
</Component>
181-
<Component Id="symbolication.py">
182-
<File Id="symbolication.py" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\utils\symbolication.py" Checksum="yes" />
183-
</Component>
184-
</Directory>
185-
</Directory>
186-
</Directory>
187-
18834
<Directory Id="_usr_lib_swift" Name="swift">
18935
<Directory Id="_usr_lib_swift_swiftToCxx" Name="swiftToCxx">
19036
</Directory>
191-
19237
<Directory Id="_usr_lib_swift_migrator" Name="migrator">
19338
</Directory>
194-
195-
<Directory Id="_usr_lib_swift_shims" Name="shims">
196-
</Directory>
19739
</Directory>
19840
</Directory>
199-
20041
<Directory Id="_usr_libexec" Name="libexec">
20142
</Directory>
202-
20343
<Directory Id="_usr_share" Name="share">
20444
<Directory Id="_usr_share_swift" Name="swift">
20545
</Directory>
@@ -599,7 +439,7 @@
599439
</Component>
600440
</ComponentGroup>
601441

602-
<Feature Id="Toolchain" AllowAbsent="no" AllowAdvertise="yes" ConfigurableDirectory="INSTALLDIR" Description="Swift Compiler Tools" Level="1" Title="Swift Compiler Tools">
442+
<Feature Id="Toolchain" AllowAbsent="no" AllowAdvertise="yes" ConfigurableDirectory="INSTALLDIR" Description="Swift Build Tools" Level="1" Title="Swift Build Tools">
603443
<ComponentGroupRef Id="binutils" />
604444
<ComponentGroupRef Id="clang" />
605445
<ComponentGroupRef Id="lld" />
@@ -627,56 +467,6 @@
627467
<ComponentGroupRef Id="argument_parser" />
628468
<ComponentGroupRef Id="tools_support_core" />
629469

630-
<!-- clang -->
631-
<ComponentRef Id="clang_format.exe" />
632-
<ComponentRef Id="clang_tidy.exe" />
633-
<ComponentRef Id="clangd.exe" />
634-
635-
<!-- lldb -->
636-
<ComponentRef Id="lldb_server.exe" />
637-
<ComponentRef Id="lldb_vscode.exe" />
638-
<ComponentRef Id="lldb.exe" />
639-
<ComponentRef Id="repl_swift.exe" />
640-
<ComponentRef Id="liblldb.dll" />
641-
642-
<ComponentRef Id="liblldb.lib" />
643-
644-
<ComponentRef Id="__init__.py_c31e016e2f8b4fba9eebd73d5009e919" />
645-
<ComponentRef Id="_lldb.py" />
646-
<ComponentRef Id="embedded_interpreter.py" />
647-
<ComponentRef Id="lldb_argdumper.exe" />
648-
649-
<ComponentRef Id="logger.py" />
650-
<ComponentRef Id="__init__.py_6124a6ee9e584275b153b0e1ddb4a2b2" />
651-
<ComponentRef Id="attrib_fromdict.py" />
652-
<ComponentRef Id="cache.py" />
653-
<ComponentRef Id="metrics.py" />
654-
<ComponentRef Id="synth.py" />
655-
656-
<ComponentRef Id="__init__.py_1bd1d2dc68b7417b83484f6183339af2" />
657-
<ComponentRef Id="gnu_libstdcpp.py" />
658-
<ComponentRef Id="libcxx.py" />
659-
660-
<ComponentRef Id="__init__.py_52ef75ed702f4acc8272e6b2f8aa5392" />
661-
<ComponentRef Id="in_call_stack.py" />
662-
<ComponentRef Id="symbolication.py" />
663-
664-
<!-- SourceKit -->
665-
<ComponentRef Id="sourcekitdInProc.dll" />
666-
<ComponentRef Id="sourcekitdInProc.lib" />
667-
<ComponentRef Id="sourcekitd.h" />
668-
669-
<!-- swift -->
670-
<ComponentRef Id="swift_api_digester.exe" />
671-
<ComponentRef Id="swift_symbolgraph_extract.exe" />
672-
673-
<!-- llbuild -->
674-
<ComponentRef Id="swift_build_tool.exe" />
675-
<ComponentRef Id="llbuildSwift.dll" />
676-
677-
<!-- swift-driver -->
678-
<ComponentRef Id="swift_build_sdk_interfaces.exe" />
679-
680470
<ComponentGroupRef Id="ClangResources" />
681471

682472
<ComponentRef Id="EnvironmentVariables" />

platforms/Windows/cli.wixproj

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<Project Sdk="WixToolset.Sdk/4.0.0">
2+
<PropertyGroup>
3+
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
4+
</PropertyGroup>
5+
6+
<PropertyGroup>
7+
<ProductArchitecture Condition=" '$(ProductArchitecture)' == '' ">amd64</ProductArchitecture>
8+
<ProductArchitecture>$(ProductArchitecture)</ProductArchitecture>
9+
10+
<ProductVersion Condition=" '$(ProductVersion)' == '' ">0.0.0</ProductVersion>
11+
<ProductVersion>$(ProductVersion)</ProductVersion>
12+
</PropertyGroup>
13+
14+
<PropertyGroup>
15+
<OutputPath>build\</OutputPath>
16+
<IntermediateOutputPath>build\obj\</IntermediateOutputPath>
17+
</PropertyGroup>
18+
19+
<Import Project="WiXCodeSigning.targets" />
20+
21+
<PropertyGroup>
22+
<DefineConstants>ProductArchitecture=$(ProductArchitecture);ProductVersion=$(ProductVersion);TOOLCHAIN_ROOT=$(TOOLCHAIN_ROOT);DEVTOOLS_ROOT=$(DEVTOOLS_ROOT)</DefineConstants>
23+
<DefaultCompressionLevel>high</DefaultCompressionLevel>
24+
<InstallerPlatform Condition=" '$(ProductArchitecture)' == 'amd64' ">x64</InstallerPlatform>
25+
<InstallerPlatform Condition=" '$(ProductArchitecture)' == 'arm64' ">arm64</InstallerPlatform>
26+
</PropertyGroup>
27+
28+
<ItemGroup>
29+
<PackageReference Include="WixToolset.UI.wixext" Version="4.0.0" />
30+
<PackageReference Include="WixToolset.Heat" Version="4.0.0" />
31+
</ItemGroup>
32+
33+
<ItemGroup>
34+
<Compile Include="cli.wxs" />
35+
</ItemGroup>
36+
</Project>

0 commit comments

Comments
 (0)