Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upDouble write during publish #3257
Comments
This comment has been minimized.
This comment has been minimized.
cc @dsplaisted |
This comment has been minimized.
This comment has been minimized.
This differs from #3035 because that bug was caused by having an item being a member of two intermediate groups and sourcing the final group from both of those intermediate groups, thereby causing the duplicate. This bug, however, has Other than ideally having composite runtime packs that don't contain duplicates, how should we solve this? Should |
This comment has been minimized.
This comment has been minimized.
Not sure if it's relevant, but I remember seeing |
This comment has been minimized.
This comment has been minimized.
We now have folks hitting this when trying to trim+R2R their WPF apps, FYI:
|
This comment has been minimized.
This comment has been minimized.
I'll take a look. |
This comment has been minimized.
This comment has been minimized.
@swaroop-sridhar You are seeing more than Microsoft.Win32.Registry, can you provide more info on that here too. |
This comment has been minimized.
This comment has been minimized.
I think the difference between Microsoft.Win32.Registry and WindowsBase is that the latter have different versions between the runtime packs, engineered to make WindowsBase from WindowsDesktop pack win. Whereas registry is the same, but excluded from compile in base targeting pack, IIRC. cc @ericstj If that's right, (haven't proven yet), then we need to pick a deterministic strategy like first runtime pack wins. |
This comment has been minimized.
This comment has been minimized.
Yeah, they have the same version. Thinking about this, I think these shouldn't be in the runtime pack for windows desktop. It could be a flaw in how that is produced. |
This comment has been minimized.
This comment has been minimized.
Yes, I tried publishing a template Winforms app
The files that are duplicated are:
|
This comment has been minimized.
This comment has been minimized.
This issue did not exist in Preview 5, it is a new regression. |
This comment has been minimized.
This comment has been minimized.
Ok, looks like two issues here, but I'll fix them together. The resource assembly is being put twice in the resolved files with the same source, whereas the others are duplicated between runtime packs |
This comment has been minimized.
This comment has been minimized.
I have a test case that catches duplicates for publish, but it's for a console app and not WPF (we should probably change it to a theory that tests the supported framework references). Regarding the satellite assemblies for WPF, I recently implemented copying those locally, so not a regression, but a bug in the implementation I didn't catch. |
This comment has been minimized.
This comment has been minimized.
So today the fact that Registry isn’t available for reference from NETCore.App is intentional. You could solve this with conflict resolution if you make it behave the same as the host. This means providing correct package ranks for the layered shared frameworks. It makes me nervous to have this excluded from ref for NETCore.App and excluded for runtime in Window.Desktop, but I guess that’s not much different than having an assembly in WindowsDesktop use all the API exposed... I guess we could do that @dagood what do you think? |
This comment has been minimized.
This comment has been minimized.
I'll look into matching the host policy. |
This comment has been minimized.
This comment has been minimized.
I think understanding the framework layers is going to be painful. Can we say that equal versions means the choice is arbitrary. We'd then just pick something deterministic? @vitek-karas |
This comment has been minimized.
This comment has been minimized.
I probably don't know the full range of things to be nervous about with this--the concrete thing I can think of is the files disappearing from NETCoreApp's runtime, breaking WindowsDesktop runtime. I'm pretty sure But that just solves duplicates between NETCoreApp and WindowsDesktop, not sibling frameworks like WindowsDesktop and AspNetCore, so making |
This comment has been minimized.
This comment has been minimized.
Without running experiments (just looking at the code) the host will:
We've had this discussion already in some other context (can't find it now) and the outcome was basically: If the two files have the same assembly and file version, then we assume they are identical and thus it should not matter which one we pick. So if the SDK follows that logic as well, I think we're OK. It should definitely work for our assemblies as we would change file version on rebuilds, even if the assembly version stays the same. Note: For the sibling case (same assembly in |
This comment has been minimized.
This comment has been minimized.
I am pretty sure this was intentional. @steveharter and I agreed upon this behavior when this feature was added to the host. I believe there is a pretty big spec on this. (edit, I don't trust my memory here, consult spec)
No, we intentionally give WPF's dll a higher file version. In time it will have a higher assembly version as well: we were careful early in 3.0 not to change assembly versions so that some design time components could limp along using desktop as a proxy. Soon that will no longer be the case: corefx will stay at the desktop assembly version (since its a compat ship) and WPF will increment (since its a product assembly). |
This comment has been minimized.
This comment has been minimized.
Update: here's the discussion I was remembering. dotnet/core-setup#4047 |
This comment has been minimized.
This comment has been minimized.
I have a fix locally for the satellite duplicates. It comes down to an msbuild batching behavior that I don't actually understand yet. |
This comment has been minimized.
This comment has been minimized.
The satellite issue is entirely separate from the conflict resolution we're talking about. |
This comment has been minimized.
This comment has been minimized.
|
Publishing a self-contained WPF template app writes some files twice because
ResolvedFileToPublish
has the same dll from different runtime packs (for example, Microsoft.Win32.Registry.dll comes from both netcoreapp and the windowsdesktop pack).This causes crossgen failures when used together with
PublishReadyToRun=true
.Looks very similar to #3035 which was addressed in #3021, but I'm still seeing this with version
3.0.100-preview6-012031
./cc @fadimounir @nguerrera @peterhuene
edit: it fails during
PublishReadyToRun=true
only when used together with the linker. Without linking, the duplicates are already crossgen'd, and so they don't hit the failure. In any case,ResolvedFileToPublish
has duplicates that shouldn't be there, and we end up withDoubleWrites
of some files.