Skip to content

Conversation

@nguerrera
Copy link
Contributor

  • Shared items from .projitems projects with HasSharedItems=true property get their Link metadata assigned by AssignLinkMetadata target
  • XliffTasks needs this Link metadata to work correctly
  • XliffTasks had no manifested dependency on AssignLinkMetadata
  • Without UpdateXlfOnBuild set, XliffTasks got lucky and ran after AssignLinkMetadata
  • With UpdateXlfOnBuild, XliffTasks registers itself to do some work before BeforeBuild which causes it to run before AssignLinkMetadata, which breaks it.

The fix here is to manifest a dependency on AssignLinkMetadata.

To double check:

No, I have done only manual testing. Please take over this PR from me and test as appropriate. 😆

Here is the minimal repro that I used to debug this: nguerrera/repros@392d4bb

Please make this into a test that can run automatically to prevent regression. When you run repro.cmd, it will build with and without UpdateXlfOnBuild and put binlogs and ildasmed fr resource dlls in tmp/with_update. Diff the ildasm output and you will see that without this fix, there is a bad resource name used:

$ diff tmp\without_update\XliffResourceNames.il tmp\with_update\XliffResourceNames.il | grep .resources
< .mresource public XliffResourceNames.Test.fr.resources
> .mresource public XliffResourceNames.D_.Src.repros.OutsideXliffResourceNames.Test.fr.resources
<   // WARNING: managed resource file XliffResourceNames.Test.fr.resources created
>   // WARNING: managed resource file XliffResourceNames.D_.Src.repros.OutsideXliffResourceNames.Test.fr.resources created``

Fix #15296

* Shared items from .projitems projects get their Link metadata assigned by AssignLinkMetadata target
* XliffTasks needs this Link metadata to work correctly
* XliffTasks had no manifested dependency on AssignLinkMetadata
* Without UpdateXlfOnBuild set, XliffTasks gets lucky and runs after AssignLinkMetadata
* With UpdateXlfOnBuild, XliffTasks does some work before BeforeBuild and hence before AssignLinkMetadata

The fix here is to manifest a dependency on AssignLinkMetadata.
@nguerrera
Copy link
Contributor Author

@jaredpar

@jaredpar
Copy link
Member

jaredpar commented Dec 4, 2024

Awesome thank you!!

@jaredpar jaredpar merged commit c1723e5 into dotnet:main Dec 6, 2024
11 checks passed
@nguerrera nguerrera deleted the fix-xliff-with-projitems branch December 6, 2024 18:06
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.

The UpdateXlfOnBuild on build property is making resource DLL builds non-reproducable

2 participants