Skip to content

Commit 8aab5fb

Browse files
authored
WiX: reflect variant name in directory IDs
This is a follow up change to #428. In this PR we are making directory IDs reflect the variant in the name of the install directory (e.g. `Swift\Toolchains\6.2.0+Asserts\usr`). There is no functional change in this change, it is just directory ids. Directory names and which components are installed to which directories should not be changed. This should make it easier to add new variants by following the same pattern, and will allow us to parametrize authoring that is shared between variants. Naming convention: `ToolchainsVersioned` became `ToolchainsVersionedAsserts` -- this is our top-level toolchain install directory like `Swift\Toolchains\0.0.0+Asserts` Subdirectories like `_usr_share` became `toolchains_asserts_usr_share` to reflect the full path at install time e.g. `Swift\Toolchains\0.0.0+Asserts\usr\share`
1 parent be72f2b commit 8aab5fb

File tree

7 files changed

+154
-154
lines changed

7 files changed

+154
-154
lines changed

platforms/Windows/bld/asserts/bld.asserts.wixproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<ItemGroup>
1717
<HarvestDirectory Include="$(ImageRoot)\Toolchains\$(ProductVersion)+Asserts\usr\lib\clang">
1818
<ComponentGroupName>ClangResources_asserts</ComponentGroupName>
19-
<DirectoryRefId>_usr_lib_clang</DirectoryRefId>
19+
<DirectoryRefId>toolchain_asserts_usr_lib_clang</DirectoryRefId>
2020
<PreprocessorVariable>var._USR_LIB_CLANG</PreprocessorVariable>
2121
<SuppressCom>true</SuppressCom>
2222
<SuppressRegistry>true</SuppressRegistry>
@@ -27,7 +27,7 @@
2727
<ItemGroup>
2828
<HarvestDirectory Include="$(ImageRoot)\Toolchains\$(ProductVersion)+Asserts\usr\lib\swift\clang">
2929
<ComponentGroupName>SwiftClangResources_asserts</ComponentGroupName>
30-
<DirectoryRefId>_usr_lib_swift_clang</DirectoryRefId>
30+
<DirectoryRefId>toolchain_asserts_usr_lib_swift_clang</DirectoryRefId>
3131
<PreprocessorVariable>var._USR_LIB_SWIFT_CLANG</PreprocessorVariable>
3232
<SuppressCom>true</SuppressCom>
3333
<SuppressRegistry>true</SuppressRegistry>
@@ -39,7 +39,7 @@
3939
<!-- FIXME(#81557) this needs to be properly staged once the sanitizers are included -->
4040
<HarvestDirectory Include="$(ImageRoot)\Toolchains\$(ProductVersion)+Asserts\usr\lib\swift\clang">
4141
<ComponentGroupName>SwiftStaticClangResources_asserts</ComponentGroupName>
42-
<DirectoryRefId>_usr_lib_swift_static_clang</DirectoryRefId>
42+
<DirectoryRefId>toolchain_asserts_usr_lib_swift_static_clang</DirectoryRefId>
4343
<PreprocessorVariable>var._USR_LIB_SWIFT_STATIC_CLANG</PreprocessorVariable>
4444
<SuppressCom>true</SuppressCom>
4545
<SuppressRegistry>true</SuppressRegistry>

platforms/Windows/bld/bld.wxi

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@
1616
<WixVariable Id="SideBySidePackageUpgradeCode" Value="$(BldAssertsUpgradeCode)" />
1717
<FeatureGroupRef Id="SideBySideUpgradeStrategy" />
1818

19-
<DirectoryRef Id="_usr_include">
20-
<Directory Id="_usr_include_llvm_c" Name="llvm-c" />
21-
<Directory Id="_usr_include_swift" Name="swift" />
19+
<DirectoryRef Id="toolchain_asserts_usr_include">
20+
<Directory Id="toolchain_asserts_usr_include_llvm_c" Name="llvm-c" />
21+
<Directory Id="toolchain_asserts_usr_include_swift" Name="swift" />
2222
</DirectoryRef>
2323

24-
<DirectoryRef Id="_usr_lib_swift">
25-
<Directory Id="_usr_lib_swift_migrator" Name="migrator" />
26-
<Directory Id="_usr_lib_swift_swiftToCxx" Name="swiftToCxx" />
24+
<DirectoryRef Id="toolchain_asserts_usr_lib_swift">
25+
<Directory Id="toolchain_asserts_usr_lib_swift_migrator" Name="migrator" />
26+
<Directory Id="toolchain_asserts_usr_lib_swift_swiftToCxx" Name="swiftToCxx" />
2727
</DirectoryRef>
2828

29-
<DirectoryRef Id="_usr_share">
30-
<Directory Id="_usr_share_clang" Name="clang" />
31-
<Directory Id="_usr_share_swift" Name="swift" />
32-
<Directory Id="_usr_share_doc" Name="doc">
33-
<Directory Id="_usr_share_doc_swift" Name="swift">
34-
<Directory Id="_usr_share_doc_swift_diagnostics" Name="diagnostics">
29+
<DirectoryRef Id="toolchain_asserts_usr_share">
30+
<Directory Id="toolchain_asserts_usr_share_clang" Name="clang" />
31+
<Directory Id="toolchain_asserts_usr_share_swift" Name="swift" />
32+
<Directory Id="toolchain_asserts_usr_share_doc" Name="doc">
33+
<Directory Id="toolchain_asserts_usr_share_doc_swift" Name="swift">
34+
<Directory Id="toolchain_asserts_usr_share_doc_swift_diagnostics" Name="diagnostics">
3535
</Directory>
3636
</Directory>
3737
</Directory>
3838
</DirectoryRef>
3939

40-
<ComponentGroup Id="cmark_gfm" Directory="_usr_bin">
40+
<ComponentGroup Id="cmark_gfm" Directory="toolchain_asserts_usr_bin">
4141
<Component>
4242
<File Source="$(ToolchainRoot)\usr\bin/cmark-gfm.dll" />
4343
</Component>
@@ -46,7 +46,7 @@
4646
</Component>
4747
</ComponentGroup>
4848

49-
<ComponentGroup Id="binutils" Directory="_usr_bin">
49+
<ComponentGroup Id="binutils" Directory="toolchain_asserts_usr_bin">
5050
<!-- TODO(compnerd) can we use symbolic links to llvm-ar.exe instead? -->
5151
<Component>
5252
<File Source="$(ToolchainRoot)\usr\bin\llvm-dlltool.exe" />
@@ -145,26 +145,26 @@
145145
</ComponentGroup>
146146

147147
<ComponentGroup Id="lto">
148-
<Component Directory="_usr_bin">
148+
<Component Directory="toolchain_asserts_usr_bin">
149149
<File Source="$(ToolchainRoot)\usr\bin\LTO.dll" />
150150
</Component>
151151

152-
<Component Directory="_usr_lib">
152+
<Component Directory="toolchain_asserts_usr_lib">
153153
<File Source="$(ToolchainRoot)\usr\lib\LTO.lib" />
154154
</Component>
155155

156-
<Component Directory="_usr_include_llvm_c">
156+
<Component Directory="toolchain_asserts_usr_include_llvm_c">
157157
<File Source="$(ToolchainRoot)\usr\include\llvm-c\lto.h" />
158158
</Component>
159159
</ComponentGroup>
160160

161-
<ComponentGroup Id="ClangFeatures" Directory="_usr_share_clang">
161+
<ComponentGroup Id="ClangFeatures" Directory="toolchain_asserts_usr_share_clang">
162162
<Component>
163163
<File Source="$(ToolchainRoot)\usr\share\clang\features.json" />
164164
</Component>
165165
</ComponentGroup>
166166

167-
<ComponentGroup Id="clang" Directory="_usr_bin">
167+
<ComponentGroup Id="clang" Directory="toolchain_asserts_usr_bin">
168168
<ComponentGroupRef Id="ClangFeatures" />
169169

170170
<!-- TODO(compnerd) can we use symbolic links to clang.exe instead? -->
@@ -195,7 +195,7 @@
195195
-->
196196
</ComponentGroup>
197197

198-
<ComponentGroup Id="lld" Directory="_usr_bin">
198+
<ComponentGroup Id="lld" Directory="toolchain_asserts_usr_bin">
199199
<!-- TODO(compnerd) can we use symbolic links to lld.exe instead? -->
200200
<Component>
201201
<File Source="$(ToolchainRoot)\usr\bin\ld.lld.exe" />
@@ -215,30 +215,30 @@
215215
</ComponentGroup>
216216

217217
<ComponentGroup Id="BlocksRuntime">
218-
<Component Directory="_usr_bin">
218+
<Component Directory="toolchain_asserts_usr_bin">
219219
<File Source="$(ToolchainRoot)\usr\bin\BlocksRuntime.dll" />
220220
</Component>
221221

222-
<Component Directory="_usr_lib">
222+
<Component Directory="toolchain_asserts_usr_lib">
223223
<File Source="$(ToolchainRoot)\usr\lib\BlocksRuntime.lib" />
224224
</Component>
225225

226226
<!-- TODO(compnerd) should we install the block headers? -->
227227
</ComponentGroup>
228228

229229
<ComponentGroup Id="libdispatch">
230-
<Component Directory="_usr_bin">
230+
<Component Directory="toolchain_asserts_usr_bin">
231231
<File Source="$(ToolchainRoot)\usr\bin\dispatch.dll" />
232232
</Component>
233233

234-
<Component Directory="_usr_lib">
234+
<Component Directory="toolchain_asserts_usr_lib">
235235
<File Source="$(ToolchainRoot)\usr\lib\dispatch.lib" />
236236
</Component>
237237

238238
<!-- TODO(compnerd) should we install the dispatch headers? -->
239239
</ComponentGroup>
240240

241-
<ComponentGroup Id="SwiftCxx" Directory="_usr_lib_swift_swiftToCxx">
241+
<ComponentGroup Id="SwiftCxx" Directory="toolchain_asserts_usr_lib_swift_swiftToCxx">
242242
<Component>
243243
<File Source="$(ToolchainRoot)\usr\lib\swift\swiftToCxx\_SwiftCxxInteroperability.h" />
244244
</Component>
@@ -249,27 +249,27 @@
249249
<File Source="$(ToolchainRoot)\usr\lib\swift\swiftToCxx\experimental-interoperability-version.json" />
250250
</Component>
251251

252-
<Component Directory="_usr_include_swift">
252+
<Component Directory="toolchain_asserts_usr_include_swift">
253253
<File Source="$(ToolchainRoot)\usr\include\swift\bridging.modulemap" />
254254
</Component>
255-
<Component Directory="_usr_include_swift">
255+
<Component Directory="toolchain_asserts_usr_include_swift">
256256
<File Source="$(ToolchainRoot)\usr\include\swift\bridging" />
257257
</Component>
258-
<Component Directory="_usr_include_swift">
258+
<Component Directory="toolchain_asserts_usr_include_swift">
259259
<File Source="$(ToolchainRoot)\usr\include\module.modulemap" />
260260
</Component>
261261
</ComponentGroup>
262262

263263
<ComponentGroup Id="SwiftDemangle">
264-
<Component Directory="_usr_bin">
264+
<Component Directory="toolchain_asserts_usr_bin">
265265
<File Source="$(ToolchainRoot)\usr\bin\swiftDemangle.dll" />
266266
</Component>
267-
<Component Directory="_usr_lib">
267+
<Component Directory="toolchain_asserts_usr_lib">
268268
<File Source="$(ToolchainRoot)\usr\lib\swiftDemangle.lib" />
269269
</Component>
270270
</ComponentGroup>
271271

272-
<ComponentGroup Id="SwiftEducationalNotes" Directory="_usr_share_doc_swift_diagnostics">
272+
<ComponentGroup Id="SwiftEducationalNotes" Directory="toolchain_asserts_usr_share_doc_swift_diagnostics">
273273
<Component>
274274
<File Source="$(ToolchainRoot)\usr\share\doc\swift\diagnostics\dynamic-callable-requirements.md" />
275275
</Component>
@@ -308,13 +308,13 @@
308308
</Component>
309309
</ComponentGroup>
310310

311-
<ComponentGroup Id="SwiftFeatures" Directory="_usr_share_swift">
311+
<ComponentGroup Id="SwiftFeatures" Directory="toolchain_asserts_usr_share_swift">
312312
<Component>
313313
<File Source="$(ToolchainRoot)\usr\share\swift\features.json" />
314314
</Component>
315315
</ComponentGroup>
316316

317-
<ComponentGroup Id="SwiftMigrator" Directory="_usr_lib_swift_migrator">
317+
<ComponentGroup Id="SwiftMigrator" Directory="toolchain_asserts_usr_lib_swift_migrator">
318318
<Component>
319319
<File Source="$(ToolchainRoot)\usr\lib\swift\migrator\ios4.json" />
320320
</Component>
@@ -347,7 +347,7 @@
347347
</Component>
348348
</ComponentGroup>
349349

350-
<ComponentGroup Id="swift" Directory="_usr_bin">
350+
<ComponentGroup Id="swift" Directory="toolchain_asserts_usr_bin">
351351
<ComponentGroupRef Id="SwiftCxx" />
352352
<ComponentGroupRef Id="SwiftDemangle" />
353353
<ComponentGroupRef Id="SwiftEducationalNotes" />
@@ -372,7 +372,7 @@
372372
</Component>
373373
</ComponentGroup>
374374

375-
<ComponentGroup Id="SwiftMacros" Directory="_usr_bin">
375+
<ComponentGroup Id="SwiftMacros" Directory="toolchain_asserts_usr_bin">
376376
<Component>
377377
<File Source="$(ToolchainRoot)\usr\bin\ObservationMacros.dll" />
378378
</Component>
@@ -381,25 +381,25 @@
381381
</Component>
382382
</ComponentGroup>
383383

384-
<ComponentGroup Id="FoundationMacros" Directory="_usr_bin">
384+
<ComponentGroup Id="FoundationMacros" Directory="toolchain_asserts_usr_bin">
385385
<Component>
386386
<File Source="$(ToolchainRoot)\usr\bin\FoundationMacros.dll" />
387387
</Component>
388388
</ComponentGroup>
389389

390-
<ComponentGroup Id="TestingMacros" Directory="_usr_bin">
390+
<ComponentGroup Id="TestingMacros" Directory="toolchain_asserts_usr_bin">
391391
<Component>
392392
<File Source="$(ToolchainRoot)\usr\bin\TestingMacros.dll" />
393393
</Component>
394394
</ComponentGroup>
395395

396-
<ComponentGroup Id="argument_parser" Directory="_usr_bin">
396+
<ComponentGroup Id="argument_parser" Directory="toolchain_asserts_usr_bin">
397397
<Component>
398398
<File Source="$(ToolchainRoot)\usr\bin\ArgumentParser.dll" />
399399
</Component>
400400
</ComponentGroup>
401401

402-
<ComponentGroup Id="tools_support_core" Directory="_usr_bin">
402+
<ComponentGroup Id="tools_support_core" Directory="toolchain_asserts_usr_bin">
403403
<Component>
404404
<File Source="$(ToolchainRoot)\usr\bin\TSCBasic.dll" />
405405
</Component>
@@ -408,7 +408,7 @@
408408
</Component>
409409
</ComponentGroup>
410410

411-
<ComponentGroup Id="swift_driver" Directory="_usr_bin">
411+
<ComponentGroup Id="swift_driver" Directory="toolchain_asserts_usr_bin">
412412
<!-- TODO(compnerd) can we use symbolic links to swift.exe instead? -->
413413
<Component>
414414
<File Name="swiftc.exe" Source="$(ToolchainRoot)\usr\bin\swift-driver.exe" />
@@ -432,7 +432,7 @@
432432
</Component>
433433
</ComponentGroup>
434434

435-
<ComponentGroup Id="compiler_swift_syntax" Directory="_usr_bin">
435+
<ComponentGroup Id="compiler_swift_syntax" Directory="toolchain_asserts_usr_bin">
436436
<Component>
437437
<File Source="$(ToolchainRoot)\usr\bin\_CompilerSwiftBasicFormat.dll" />
438438
</Component>
@@ -474,7 +474,7 @@
474474
</Component>
475475
</ComponentGroup>
476476

477-
<ComponentGroup Id="swift_syntax" Directory="_usr_bin">
477+
<ComponentGroup Id="swift_syntax" Directory="toolchain_asserts_usr_bin">
478478
<Component>
479479
<File Source="$(ToolchainRoot)\usr\bin\SwiftBasicFormat.dll" />
480480
</Component>
@@ -516,7 +516,7 @@
516516
</Component>
517517
</ComponentGroup>
518518

519-
<ComponentGroup Id="plugin_server" Directory="_usr_bin">
519+
<ComponentGroup Id="plugin_server" Directory="toolchain_asserts_usr_bin">
520520
<Component>
521521
<File Source="$(ToolchainRoot)\usr\bin\swift-plugin-server.exe" />
522522
</Component>
@@ -525,7 +525,7 @@
525525
</Component>
526526
</ComponentGroup>
527527

528-
<ComponentGroup Id="mimalloc" Directory="_usr_bin">
528+
<ComponentGroup Id="mimalloc" Directory="toolchain_asserts_usr_bin">
529529
<Component>
530530
<File Source="$(ToolchainRoot)\usr\bin\mimalloc.dll" />
531531
</Component>
@@ -539,13 +539,13 @@
539539
</ComponentGroup>
540540

541541
<ComponentGroup Id="Configuration">
542-
<Component Directory="ToolchainsVersioned">
542+
<Component Directory="ToolchainVersionedAsserts">
543543
<File Source="$(ToolchainRoot)\ToolchainInfo.plist" />
544544
</Component>
545545
</ComponentGroup>
546546

547547
<ComponentGroup Id="EnvironmentVariables">
548-
<Component Id="UserPathVariable" Condition="NOT ALLUSERS=1" Directory="_usr_bin" Guid="ab52b870-23ee-42e8-9581-3fcbdfb9228c">
548+
<Component Id="UserPathVariable" Condition="NOT ALLUSERS=1" Directory="toolchain_asserts_usr_bin" Guid="ab52b870-23ee-42e8-9581-3fcbdfb9228c">
549549
<Environment Action="set" Name="Path" Part="last" Permanent="no" System="no" Value="[_usr_bin]" />
550550
</Component>
551551
</ComponentGroup>

platforms/Windows/cli/asserts/cli.asserts.wixproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<ItemGroup Condition=" '$(INCLUDE_SWIFT_DOCC)' == 'True' ">
1818
<HarvestDirectory Include="$(SWIFT_DOCC_RENDER_ARTIFACT_ROOT)\dist">
1919
<ComponentGroupName>DocCRender_asserts</ComponentGroupName>
20-
<DirectoryRefId>_usr_share_docc_render</DirectoryRefId>
20+
<DirectoryRefId>toolchain_asserts_usr_share_docc_render</DirectoryRefId>
2121
<PreprocessorVariable>var.SWIFT_DOCC_RENDER_ARTIFACT_ROOT_DIST</PreprocessorVariable>
2222
<SuppressCom>true</SuppressCom>
2323
<SuppressRegistry>true</SuppressRegistry>

0 commit comments

Comments
 (0)