Skip to content

WiX: create and distribute SxS and flat style MSMs for developers#533

Open
compnerd wants to merge 5 commits into
swiftlang:mainfrom
compnerd:msm
Open

WiX: create and distribute SxS and flat style MSMs for developers#533
compnerd wants to merge 5 commits into
swiftlang:mainfrom
compnerd:msm

Conversation

@compnerd

Copy link
Copy Markdown
Member

This pull request introduces significant improvements to how Windows and Android platform build configurations manage and reference runtime libraries, SDK modules, and installer options. The changes centralize and standardize the definition of module and component group lists, streamline variable naming, and add support for distinguishing between "bound" and "unbound" redistributable runtime libraries in the Windows installer.

Key changes include:

Centralization and Standardization of Module/Component Lists

  • Introduced a new RuntimeLibraries.props file that defines all Swift, Foundation, Dispatch, and overlay modules, as well as their grouping for both Windows and Android platforms. This centralizes and standardizes the way these lists are maintained and referenced. (platforms/Windows/RuntimeLibraries.props)
  • Updated Directory.Build.props to import the new RuntimeLibraries.props and to use its properties for defining build variables, ensuring consistency across the build system. (platforms/Windows/Directory.Build.props) [1] [2]

Windows Installer Improvements

  • Refactored the Windows installer and bundle to distinguish between "bound" and "unbound" redistributable runtime libraries for each architecture, updating variable names and references throughout the installer configuration and source code. (platforms/Windows/bundle/installer.wxs, platforms/Windows/bundle/baf/baf.cc) [1] [2] [3] [4]
  • Added logic to set the MergeModuleStyle and RuntimeLibraryLayout properties based on project and build conditions, supporting the new bound/unbound model. (platforms/Windows/Directory.Build.props)

Android Build and Installer Updates

  • Updated the Android platform project and installer to use the new centralized module and component group lists from RuntimeLibraries.props, replacing hardcoded lists and simplifying maintenance. (platforms/Windows/platforms/android/android.wixproj, platforms/Windows/platforms/android/android.wxs) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

These changes make the build and installer configuration more maintainable, flexible, and consistent across platforms, and set the stage for future enhancements to runtime library packaging and deployment.

@compnerd

Copy link
Copy Markdown
Member Author

UI changes:
image

@compnerd compnerd force-pushed the msm branch 3 times, most recently from 6ebb8d7 to 7f815d0 Compare June 13, 2026 06:57
compnerd added 5 commits June 13, 2026 10:17
The shared runtime merge-module fragment only needs the selected
RuntimeRoot. SDKRoot is supplied by the platform projects for SDK
packaging and is not referenced in this fragment.

Split this cleanup out before the runtime MSM changes so later commits
only describe packaging behavior.
Replace the hand-maintained SDK and runtime library properties with
Module and Library item declarations. Derive SDK Swift module
names, shared-linkage and static-linkage SDK component groups,
developer tools shared-linkage groups, runtime redistributable
libraries, and static runtime dependencies from that metadata.

Use the final projection rules from the start. Shared and Static are
positive library availability flags, SDKSharedLinkage admits special
static-only items into the shared-linkage SDK slice, SDK and runtime
platforms are selected once, and static SDK component ids use the
generated lib-prefixed shape.

Model the special SDK cases directly: Cxx and CxxStdlib include static
libraries in the shared-linkage SDK, while _FoundationCollections
ships shared-linkage swiftmodule and swiftdoc files without a library.

This keeps each library named once while allowing the Windows and
Android packages, shared runtime library fragment, and static runtime
merge module to consume the same definitions. Import the metadata only
for WiX projects so native projects do not consume the Library items.
Make flat redistributable filenames carry the SxS layout segment for
both linkage families: rtl.shared.unbound.<arch>.msm and
rtl.static.unbound.<arch>.msm.

This makes each MSM name a consistent tuple of linkage, SxS layout,
and architecture before adding the bound variants.
Build bound variants for both shared and static runtime merge modules,
so redistributables cover the full linkage x SxS layout x
architecture matrix.

The bound layout places each DLL in a basename directory for private
SxS binding, while the unbound layout keeps the existing flat runtime
directory. Separate module GUIDs and intermediate paths keep the
variants distinct.
Expose the redistributable merge modules as layout-level bundle
options instead of one per linkage/layout combination. The BA tree
now shows SxS for bound MSMs and flat for unbound MSMs under each
Windows SDK architecture.

Default SxS to selected and flat to unselected, and forward each
layout choice to both shared and static MSM components in the
Windows platform MSI.
@compnerd

Copy link
Copy Markdown
Member Author

@etcwilde etcwilde left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You say "bound" and "unbound" and "flat" vs "SxS" a lot. The changes themselves look fine, but I don't know the definitions of these terms. Can you please include definitions of "bound" vs "unbound" in the readme. You do refer to the Side-by-Side strategy elsewhere in the readme, but I don't see anything tying SxS to the term "Swift-by-Side". The section describing what a Side-by-Side install is should at least contain a single SxS in it, ideally something like, "Side-by-Side (SxS) installs allow you to blah blah blah".

Please include a definition of "bound" and "unbound" in the context of a redistributable runtime.

@compnerd

Copy link
Copy Markdown
Member Author

You say "bound" and "unbound" and "flat" vs "SxS" a lot. The changes themselves look fine, but I don't know the definitions of these terms. Can you please include definitions of "bound" vs "unbound" in the readme. You do refer to the Side-by-Side strategy elsewhere in the readme, but I don't see anything tying SxS to the term "Swift-by-Side". The section describing what a Side-by-Side install is should at least contain a single SxS in it, ideally something like, "Side-by-Side (SxS) installs allow you to blah blah blah".

Please include a definition of "bound" and "unbound" in the context of a redistributable runtime.

Where should we add that explanation? Neither of these are really terms of art; I believe that the Microsoft naming is "shared assembly (WinSxS)" and "private assembly (app-local)" for the two models. https://devblogs.microsoft.com/cppblog/how-to-redistribute-the-visual-c-libraries-with-your-application/ is the closest thing to a reference I can find.

@etcwilde

Copy link
Copy Markdown
Member

@compnerd and I talked about this offline. The issue is that we're already using "shared" vs "static" for the library type and "shared.shared" for a shared shared-assembly library is not meaningful. Instead of "shared" library, we'll use "dynamic" vs "static" and "shared" vs "private" to align with the existing terms.

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