Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Libraries should not merge PRIs from references into their own PRI #4124

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

evelynwu-msft
Copy link
Contributor

@evelynwu-msft evelynwu-msft commented Jan 27, 2024

(Addresses microsoft/microsoft-ui-xaml#8857)

The MRT Core targets are incorrectly merging the PRIs of references into the final PRI in all cases. Suppose you have Package A which contains some WinUI controls, which results in some XBFs being inserted as resources into its PRI. There is also a Package B that relies on Package A version 1.0. Finally, there is an App C that relies on both Package A (version 1.1) and Package B. Because Package B is including the PRI resources from Package A version 1.0 in its own PRI, when App C attempts to merge the PRI resources from all of its dependencies a conflict will arise and break the build.

Package B should not be including the PRI resources from Package A in its own PRI, and instead should advertise the dependency and allow App C to resolve it and perform the PRI resource merge itself. In the UWP targets, this was done by checking to see if the project was producing a package but since Windows App SDK needs to also handle unpackaged apps, the correct way to achieve the same goal is to check if the project is a library (i.e. not producing an executable) and not merge PRI resources from dependencies if that is the case.

Note: Libraries (including Nuget packages) affected by this bug will need to be recompiled.

@evelynwu-msft
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@evelynwu-msft
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@bpulliam bpulliam added this to the 1.5 milestone Jan 31, 2024
@evelynwu-msft evelynwu-msft merged commit ecc2c50 into main Jan 31, 2024
24 checks passed
@evelynwu-msft evelynwu-msft deleted the user/evelynwu/fix-pri-generation-for-libraries branch January 31, 2024 22:52
evelynwu-msft added a commit that referenced this pull request Jan 31, 2024
evelynwu-msft added a commit that referenced this pull request Feb 1, 2024
evelynwu-msft added a commit that referenced this pull request Feb 1, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate assets when referencing a chain of nuget packages
3 participants