Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[release/9.0-preview4] Update dependencies from dotnet/winforms #9055

Conversation

dotnet-maestro[bot]
Copy link
Contributor

@dotnet-maestro dotnet-maestro bot commented Apr 25, 2024

This pull request updates the following dependencies

Coherency Updates

The following updates ensure that dependencies with a CoherentParentDependency
attribute were produced in a build used as input to the parent dependency's build.
See Dependency Description Format

  • Coherency Updates:
    • System.Reflection.MetadataLoadContext: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.Windows.Extensions: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • Microsoft.NETCore.Platforms: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.Resources.Extensions: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • Microsoft.NETCore.App.Ref: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • Microsoft.NETCore.App.Runtime.win-x64: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • VS.Redist.Common.NetCore.SharedFramework.x64.9.0: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • Microsoft.Win32.Registry.AccessControl: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • Microsoft.Win32.SystemEvents: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.CodeDom: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.ComponentModel.Composition: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.Configuration.ConfigurationManager: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.Data.Odbc: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.Data.OleDb: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.Diagnostics.EventLog: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.Diagnostics.PerformanceCounter: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.DirectoryServices.AccountManagement: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.DirectoryServices.Protocols: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.DirectoryServices: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.IO.Packaging: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.IO.Ports: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.Management: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.Reflection.Context: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.Runtime.Caching: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.Security.Cryptography.Pkcs: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.Security.Cryptography.ProtectedData: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.Security.Cryptography.Xml: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.Security.Permissions: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.ServiceModel.Syndication: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.ServiceProcess.ServiceController: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.Speech: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.Text.Encoding.CodePages: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.Threading.AccessControl: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)
    • System.ComponentModel.Composition.Registration: from 9.0.0-preview.4.24219.3 to 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms)

From https://github.com/dotnet/winforms

  • Subscription: a0a18057-b2d6-4f65-ea86-08dc64520d3d
  • Build: 20240429.5
  • Date Produced: April 29, 2024 7:44:32 PM UTC
  • Commit: cc9c41d8a603ed11155bf9fbb5bfa9f4944c293a
  • Branch: refs/heads/release/9.0-preview4
Microsoft Reviewers: Open in CodeFlow

…40425.2

Microsoft.Dotnet.WinForms.ProjectTemplates , Microsoft.Private.Winforms , System.Drawing.Common
 From Version 9.0.0-preview.4.24222.2 -> To Version 9.0.0-preview.4.24225.2

Dependency coherency updates

System.Reflection.MetadataLoadContext,System.Windows.Extensions,Microsoft.NETCore.Platforms,System.Resources.Extensions,Microsoft.NETCore.App.Ref,Microsoft.NETCore.App.Runtime.win-x64,VS.Redist.Common.NetCore.SharedFramework.x64.9.0,Microsoft.Win32.Registry.AccessControl,Microsoft.Win32.SystemEvents,System.CodeDom,System.ComponentModel.Composition,System.Configuration.ConfigurationManager,System.Data.Odbc,System.Data.OleDb,System.Diagnostics.EventLog,System.Diagnostics.PerformanceCounter,System.DirectoryServices.AccountManagement,System.DirectoryServices.Protocols,System.DirectoryServices,System.IO.Packaging,System.IO.Ports,System.Management,System.Reflection.Context,System.Runtime.Caching,System.Security.Cryptography.Pkcs,System.Security.Cryptography.ProtectedData,System.Security.Cryptography.Xml,System.Security.Permissions,System.ServiceModel.Syndication,System.ServiceProcess.ServiceController,System.Speech,System.Text.Encoding.CodePages,System.Threading.AccessControl,System.ComponentModel.Composition.Registration
 From Version 9.0.0-preview.4.24219.3 -> To Version 9.0.0-preview.4.24225.7 (parent: Microsoft.Private.Winforms
@dotnet-maestro dotnet-maestro bot requested a review from a team as a code owner April 25, 2024 23:13
Copy link
Contributor

@dotnet-policy-service dotnet-policy-service bot left a comment

Choose a reason for hiding this comment

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

Go, you big red fire engine!

@dotnet-policy-service dotnet-policy-service bot added the PR metadata: Label to tag PRs, to facilitate with triage label Apr 25, 2024
@mmitche
Copy link
Member

mmitche commented Apr 26, 2024

@singhashish-wpf can you take a look?

@ThomasGoulet73
Copy link
Contributor

Could this be caused by dotnet/runtime#95830 ?

@mmitche
Copy link
Member

mmitche commented Apr 26, 2024

Yes. I beleive this requires reaction in downstream repos. /cc @carlossanlop

@singhashish-wpf
Copy link
Member

singhashish-wpf commented Apr 26, 2024

I was trying to fix this by changing the types from ICollection to IEnumerable in the LocalizedStrings.h and related files, however there is a problem with changing those types that it doesn't fit well with the IDictionary interface where ICollection is expected. Checking more on this. Also I am unclear on the effects of this change and the potential issues which could arise due to this, we change it this way.

@carlossanlop
Copy link
Member

@eiriktsarpalis @tannergooding ptal

@tannergooding
Copy link
Member

tannergooding commented Apr 26, 2024

I was trying to fix this by changing the types from ICollection to IEnumerable in the LocalizedStrings.h and related files, however there is a problem with changing those types that it doesn't fit well with the IDictionary interface where ICollection is expected. Checking more on this. Also I am unclear on the effects of this change and the potential issues which could arise due to this, we change it this way.

The general issue is the same as would exist if you had implemented both IDictionary<TKey, TValue> and IReadOnlyDictionary<TKey, TValue> before-hand (which is what Dictionary<TKey, TValue> itself does). -- It's notably also the same general issue that exists for IEnumerator<T> IEnumerable<T>.GetEnumerator() vs IEnumerator IEnumerable.GetEnumerator which you handle here: https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/DirectWriteForwarder/CPP/DWriteWrapper/LocalizedStrings.h#L299-L308

C++/CLI doesn't support covariant returns and doesn't properly understand DIMs, so you need to explicitly implement the conflicting member. Simply doing something similar to the following will resolve the source break

property System::Collections::Generic::IEnumerable<CultureInfo^>^ Keys2
{
    virtual System::Collections::Generic::IEnumerable<CultureInfo^>^ get() sealed =
        System::Collections::Generic::IReadOnlyDictionary<CultureInfo^, String^>::Keys::get;
}
property System::Collections::Generic::IEnumerable<String^>^ Values2
{
    virtual System::Collections::Generic::IEnumerable<String^>^ get() sealed =
        System::Collections::Generic::IReadOnlyDictionary<CultureInfo^, String^>::Values::get;
}

@singhashish-wpf
Copy link
Member

Thanks @tannergooding
I tried adding to LocalizedString.h

            property System::Collections::Generic::IEnumerable<CultureInfo^>^ Keys2
            {
                virtual System::Collections::Generic::IEnumerable<CultureInfo^>^ get() sealed =
                    System::Collections::Generic::IReadOnlyDictionary<CultureInfo^, String^>::Keys::get;
            }
            property System::Collections::Generic::IEnumerable<String^>^ Values2
            {
                virtual System::Collections::Generic::IEnumerable<String^>^ get() sealed =
                    System::Collections::Generic::IReadOnlyDictionary<CultureInfo^, String^>::Values::get;
            }

Also added the below to LocalizedStrings.cpp

   IEnumerable<CultureInfo^>^ LocalizedStrings::Keys2::get()
    {
        return (IEnumerable<CultureInfo^>^)KeysArray;
    }

    IEnumerable<String^>^ LocalizedStrings::Values2::get()
    {
        return (IEnumerable<String^>^)ValuesArray;
    }

Currently facing multiple instances of below error:

C:\Users\singhashish\source\repos\wpf\src\Microsoft.DotNet.Wpf\src\System.Printing\CPP\src\gdiexporter\gdibitmap.cpp(151,30): error C2668: 'System::Collections::Generic::IReadOnlyCollection<System::Windows::M
edia::Color>::Count::get': ambiguous call to overloaded function [C:\Users\singhashish\source\repos\wpf\src\Microsoft.DotNet.Wpf\src\System.Printing\System.Printing.vcxproj]
C:\Users\singhashish\source\repos\wpf\src\Microsoft.DotNet.Wpf\src\System.Printing\CPP\src\gdiexporter\gdipath.cpp(574,1): error C2668: 'System::Collections::Generic::IReadOnlyCollection<System::Windows::Poin
t>::Count::get': ambiguous call to overloaded function [C:\Users\singhashish\source\repos\wpf\src\Microsoft.DotNet.Wpf\src\System.Printing\System.Printing.vcxproj]
C:\Users\singhashish\source\repos\wpf\src\Microsoft.DotNet.Wpf\src\System.Printing\CPP\src\gdiexporter\gdipath.cpp(576,1): error C2668: 'System::Collections::Generic::IReadOnlyCollection<System::Windows::Poin
t>::Count::get': ambiguous call to overloaded function [C:\Users\singhashish\source\repos\wpf\src\Microsoft.DotNet.Wpf\src\System.Printing\System.Printing.vcxproj]

Looks like I am missing something here, Any further pointers?

@tannergooding
Copy link
Member

tannergooding commented Apr 27, 2024

These can be resolved by doing something similar to count = static_cast<ICollection<Color>^>(colors)->Count; or count = static_cast<IReadOnlyCollection<Color>^>(colors)->Count;.

C++/CLI doesn't like that both int IReadOnlyCollection<T>.Count { get; } and int ICollection<T>.Count { get; } exist and wants you to explicitly indicate which you want to call by casting. C# has a tie-breaking rule to avoid such ambiguities, and while C++/CLI has gotten some improvements to handle similar cases, this one looks to not be handled yet.

@jkotas
Copy link
Member

jkotas commented Apr 27, 2024

C++/CLI doesn't like that both int IReadOnlyCollection.Count { get; } and int ICollection.Count { get; } exist and wants you to explicitly indicate which you want to call by casting.

I do not think that this is acceptable workaround. We should revert the change that introduced the break in dotnet/runtime.

@tannergooding
Copy link
Member

We should revert the change that introduced the break in dotnet/runtime.

I think it’s worth explicitly calling out that there’s seemingly 3 lines needing changed here, for what is very likely temporary workaround here (C++/CLI has taken tie breaking improvements several times over the past few years) and that the change is inline with how regular C++ expects such ambiguities to be resolved (this type of workaround is not unique to C++/CLI)

The alternative is backing out one of the more highly requested changes, which goes back to .NET Framework 4.5 when the new interfaces were introduced, and where we will miss the biggest opportunity to get early feedback on it from the broader ecosystem. Given the years of deliberating taken to even try it this time, backing it out may substantially hinder future efforts (either to try this ask again or to look at similar asks in the future)

Given that, I personally think it’s worth at least a little further discussion around this, the general impact, and the likelihood of a new tie breaker being added to avoid the issue by the time November rolls around

@jkotas
Copy link
Member

jkotas commented Apr 27, 2024

Given the years of deliberating taken to even try it this time, backing it out may substantially hinder future efforts (either to try this ask again or to look at similar asks in the future)

As you know from internal discussions, we have cut corners with C/C++ validation and dismissed concerns that some people involved had about it.

The learning for future efforts like this is that cutting corners is not acceptable. It has very high chance of firing back. It is not the first time we have learned it with efforts like this. We just keep re-learning it.

@jkotas
Copy link
Member

jkotas commented Apr 27, 2024

The offending change was reverted in dotnet/runtime: dotnet/runtime#101645. We need to wait for the new build to flow into this PR.

@singhashish-wpf
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

…40429.5

Microsoft.Dotnet.WinForms.ProjectTemplates , Microsoft.Private.Winforms , System.Drawing.Common
 From Version 9.0.0-preview.4.24222.2 -> To Version 9.0.0-preview.4.24229.5

Dependency coherency updates

System.Reflection.MetadataLoadContext,System.Windows.Extensions,Microsoft.NETCore.Platforms,System.Resources.Extensions,Microsoft.NETCore.App.Ref,Microsoft.NETCore.App.Runtime.win-x64,VS.Redist.Common.NetCore.SharedFramework.x64.9.0,Microsoft.Win32.Registry.AccessControl,Microsoft.Win32.SystemEvents,System.CodeDom,System.ComponentModel.Composition,System.Configuration.ConfigurationManager,System.Data.Odbc,System.Data.OleDb,System.Diagnostics.EventLog,System.Diagnostics.PerformanceCounter,System.DirectoryServices.AccountManagement,System.DirectoryServices.Protocols,System.DirectoryServices,System.IO.Packaging,System.IO.Ports,System.Management,System.Reflection.Context,System.Runtime.Caching,System.Security.Cryptography.Pkcs,System.Security.Cryptography.ProtectedData,System.Security.Cryptography.Xml,System.Security.Permissions,System.ServiceModel.Syndication,System.ServiceProcess.ServiceController,System.Speech,System.Text.Encoding.CodePages,System.Threading.AccessControl,System.ComponentModel.Composition.Registration
 From Version 9.0.0-preview.4.24219.3 -> To Version 9.0.0-preview.4.24227.4 (parent: Microsoft.Private.Winforms
@dotnet-maestro dotnet-maestro bot merged commit dab0b09 into release/9.0-preview4 Apr 29, 2024
12 checks passed
@dotnet-maestro dotnet-maestro bot deleted the darc-release/9.0-preview4-ed5bd20c-e299-4484-8192-7a50bf29542f branch April 29, 2024 20:23
@github-actions github-actions bot locked and limited conversation to collaborators May 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants