wap packaging: .xbf and .pri generation is not working for us #2546

Open
opened 2026-01-30 22:58:03 +00:00 by claunia · 0 comments
Owner

Originally created by @DHowett-MSFT on GitHub (Jul 4, 2019).

Originally assigned to: @DHowett-MSFT on GitHub.

The WAP packaging project, CascadiaPackage, consumes most of its important dependencies transitively. It depends on WindowsTerminal and Host.EXE.

By default, wapproj puts all files collected from a project into a subdirectory named after that project, even if those files were originally from a nested dependency. This includes the .exes.

We've suppressed that behavior so that WindowsTerminal and conhost can live in the appx package root next to their DLLs.

We must also do this so that the .winmd -> AppX Manifest generator works right -- if we don't, it will insert references like this:

<InProcessServer>
  <Path>Whatever.dll</Path>
</InProcessServer>

when our directory structure looks like this:

WindowsTerminal/Whatever.dll
WindowsTerminal/Whatever.xbf

This will fail validation (and activation)! This cannot be fixed, so we stomp the directory for DLL and EXE files.

eae920e5f9/src/cascadia/CascadiaPackage/CascadiaPackage.wapproj (L300-L310)

Well, we're also stomping the directory for XBF files. Therefore, MinMaxCloseControl.xbf and App.xbf end up in the appx root.

This works, because we've overridden their resource locator paths:

eae920e5f9/src/cascadia/TerminalApp/MinMaxCloseControl.cpp (L17-L18)

That works great when deployed from Visual Studio. However, when the project is deployed by MSBuild (like in our CI), those loose XBF files are missing. If you look in one of the PRI files, it says that the path is TerminalApp/MinMaxCloseControl.xbf.

Well, that never existed on disk (see above: wapproj would put it in WindowsTerminal/MinMaxCloseControl.xbf because it was a transitive dependency.)

It gets worse. That path would actually work because the XBF file has been merged into the PRI file(!). However, the PRI files from wapproj transitive dependencies do not get merged into the global resources.pri.

If the transitive dependency PRI files can be merged into resources.pri, we can skip overriding the resource loader and remove the loose XBF files from our package.

/cc @metathinker, who originally reported a crash from the CI builds.

Originally created by @DHowett-MSFT on GitHub (Jul 4, 2019). Originally assigned to: @DHowett-MSFT on GitHub. The WAP packaging project, CascadiaPackage, consumes most of its important dependencies transitively. It depends on WindowsTerminal and Host.EXE. By default, _wapproj_ puts all files collected from a project into a subdirectory _named after_ that project, even if those files were originally from a nested dependency. This includes the `.exe`s. We've suppressed that behavior so that `WindowsTerminal` and `conhost` can live in the appx package root next to their DLLs. **We must also do this** so that the `.winmd` -> AppX Manifest generator works right -- if we don't, it will insert references like this: ```xml <InProcessServer> <Path>Whatever.dll</Path> </InProcessServer> ``` when our directory structure looks like this: ``` WindowsTerminal/Whatever.dll WindowsTerminal/Whatever.xbf ``` This will fail validation (and activation)! This cannot be fixed, so we stomp the directory for DLL and EXE files. https://github.com/microsoft/terminal/blob/eae920e5f931d7efd33cc3e1bfb12f8c683b001b/src/cascadia/CascadiaPackage/CascadiaPackage.wapproj#L300-L310 Well, we're also stomping the directory for XBF files. Therefore, `MinMaxCloseControl.xbf` and `App.xbf` end up in the appx root. This works, because we've overridden their resource locator paths: https://github.com/microsoft/terminal/blob/eae920e5f931d7efd33cc3e1bfb12f8c683b001b/src/cascadia/TerminalApp/MinMaxCloseControl.cpp#L17-L18 That works great when deployed from Visual Studio. However, _when the project is deployed by MSBuild_ (like in our CI), those loose XBF files are missing. If you look in one of the _PRI_ files, it says that the path is `TerminalApp/MinMaxCloseControl.xbf`. Well, **that never existed on disk** (see above: _wapproj_ would put it in `WindowsTerminal/MinMaxCloseControl.xbf` because it was a transitive dependency.) It gets worse. That path would _actually work_ because the XBF file has been merged _into_ the PRI file(!). However, the PRI files from _wapproj_ transitive dependencies _do not get merged into the global `resources.pri`_. If the transitive dependency PRI files can be merged into `resources.pri`, we can skip overriding the resource loader _and_ remove the loose XBF files from our package. /cc @metathinker, who originally reported a crash from the CI builds.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#2546