Skip to content

WiX: parametrize authoring for toolchain MSIs #444

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

Merged
merged 2 commits into from
Jul 31, 2025

Conversation

mhegazy
Copy link
Contributor

@mhegazy mhegazy commented Jul 25, 2025

This is a follow up change to #428, #433 and #433. And the last change before adding full toolchain variant msi's.

In this change we parametrize the authoring in the wxi files for bld, cli, dbg and ide. Similar to previous changes, this should not have any functional changes; it just makes the authoring reusable in the future to add new variants.

The changes are mostly mechanical. e.g. a directory id toolchain_asserts_usr_include becomes toolchain_$(VariantName)_usr_include. This allows the same authoring to be used to create different layouts based on the variant without duplicating, and files added are added in one place.

Changes include:

  • directory Ids that have variant name in them
  • Component and ComponentGroup Ids that have variant name in them
  • Upgrade Codes since these are specific to the msi
  • Cab name, again since these are different passed on msi
  • Product name, that is the name of the msi

@mhegazy mhegazy force-pushed the parametrized-toolchain branch from c9c1dd9 to 2c0b86a Compare July 25, 2025 02:34
@mhegazy mhegazy force-pushed the parametrized-toolchain branch from 2c0b86a to 3ddc40d Compare July 25, 2025 02:36
<?define VariantProductName = !(loc.BldAsserts_ProductName)?>
<?define VariantCabName = bld.asserts.cab?>
<?define ToolchainVersionedVariantDirectory= ToolchainVersionedAsserts ?>
<?define VariantEnvironmentComponentGUID = ab52b870-23ee-42e8-9581-3fcbdfb9228c?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be here or should it go into shared.wxs along with the other GUID constants?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the other ones need to change between major upgrades. this one just needs to have a guid to identify since the Id (UserPathVariable) is not unique enough. it needs to be different from the other variant. so this is why i put it here.

We have 3 of these, in bld (toolchain\usr\bin), rtl (runtimes\usr\bin) and windowssdk(sdks\windows.sdk). we could pull them all out if you want, but not sure if that will add much value

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, okay, we can leave this for now; I am hoping that once we switch to the experimental SDK, the RTL is going to be possible to install into the GAC. We will want to have the RTL that the compiler was built against installed as well as the one that we just built.

@mhegazy mhegazy requested a review from compnerd July 29, 2025 22:27
@compnerd compnerd changed the title Parametrize authoring for toolchain msi's WiX: parametrize authoring for toolchain MSIs Jul 30, 2025
@compnerd
Copy link
Member

@compnerd compnerd merged commit f159aa2 into swiftlang:main Jul 31, 2025
compnerd pushed a commit that referenced this pull request Aug 7, 2025
…he toolchain

This changes introduces new toolchain variant for No-Assert. The authoring leverages our parametrization (#444) and only introduces a new set of project files and includes. 

**Note**: This does not change any of the existing Assert variant authoring or output (msi or cabs). The new msi's are only built if you pass `-IncludeNoAsserts`  to `build.ps1`. No changes on CI are needed at this point.

## Changes:
- New projects, and wxs with include files for bld, cli, dbg and ide. these result in producing new msi's `bld.noasserts.msi`, `cli.noasserts.msi`, `dbg.noasserts.msi` and `ide.noasserts.msi`
- Installer Options UI now has a new option to choose which variant to install, or both (see images below)
- Authoring for directories in shared.wxs to match the assert variant directories
- New upgrade codes for the new msi's
- New strings for the new msi's

## How does it work:
- If the bundler is built without `-IncludeNoAsserts`, noassert toolcahin is not included, and the user will see a grayed out entry that can not be changed. bundler will install asserts variant only, just like today (see first image below)
- If the bundler is built with `-IncludeNoAsserts`, both toolchain variants are included. the user has an option to install both (see second image), or only the noasserts variant (see third image). At least one has to be included. User can not be in a state where none is included (we ensure that through using enabled condition on the check boxes)
- If both variants are installed, the path will be set to the assert toolchain (to maintain backward compatibility). if only the noassert variant is chosen, the path will be set to the no-assert toolchain path.

## Screenshots

- Only Assert variant included:
<img width="1262" height="1058" alt="Asserets-only" src="https://github.com/user-attachments/assets/db9c53db-4868-45fd-9b19-643b1abac11a" />

- Both variants included:
<img width="1252" height="1046" alt="both" src="https://github.com/user-attachments/assets/d1b156e4-438b-4cde-b4b1-e270c65b3aca" />

- Only No-Assert included:
<img width="1256" height="1038" alt="noasserts-only" src="https://github.com/user-attachments/assets/88fd22cc-e211-48fc-9e66-520b9b701673" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants