-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Conversation
Well. Builds are failing with error
I had the same error in the first PR and I do not know what it means and how to get rid of it. I added reference to So I need help here what to do. Thanks |
The build is failing because we can't add the System.Drawing.Common dependency to System.ComponentModel.TypeConverter because System.Drawing.Common ships as an OOB package and it is not part of the inbox .NET Core Framework closure. Since System.ComponentModel.TypeConverter ships as part of the framework it can't depend on something that is not part of the framework closure. So I think here what we would need to do is add this types into System.Drawing.Common and add the converter's to their corresponding types through a @ericstj correct me if I'm wrong. |
Well, we specifically don't want the dependency to be from Drawing.Common > TypeConverter. At least that was @weshaggard goal here: https://github.com/dotnet/corefx/issues/21129#issuecomment-309170203 To understand the error, look at the context:
So the problem is that TypeConverters is part of the shared framework but Drawing.Common is not, as @safern mentioned. For now, lets add Drawing.Common to the shared framework. You can do so by setting I'd also recommend you open an issue and assign it to @weshaggard for reviewing this decision, since he is out at the moment. We need to decide if its worth it to preserve layering goals at the cost of shared framework growth. |
Then we would need to add it to Uap as well right? However it will be odd to have a Turd assembly being part of the UAP framework: https://github.com/dotnet/corefx/blob/master/src/System.Drawing.Common/src/System.Drawing.Common.csproj#L15 |
@@ -98,6 +103,9 @@ | |||
<LastGenOutput>TestResx.Designer.cs</LastGenOutput> | |||
</EmbeddedResource> | |||
</ItemGroup> | |||
<ItemGroup /> | |||
<ItemGroup> | |||
<EmbeddedResource Include="Resources\TestIcon.ico" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typically we don't add binaries to the CoreFx repo. Instead we add them to https://github.com/dotnet/corefx-testdata and consume the package in CoreFx.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I will move them.
Not necessarily. You can ifdef these converters out of the UAP build if they aren't supported there. |
@safern So what to do next? Add |
I don't have a problem with adding System.Drawing.Common to the NETCoreApp as I expect it will end up there for other reasons as well. If we are only adding these converters so that mono can share share sources we could also just #ifdef that source code and not worry about adding support for these converters to .NET Core and UAP. So far I've not seen any requests for them beyond the source sharing aspects so I'd be included to not have them. |
/cc @Tanya-Solyanik |
@ericstj - yes, converters are primarily used by the design time and binding. They are also used in winforms propertygrid runtime control, I don't see Font or Image converters needed when the OOB package is not included though. |
What is status of this PR? There hasn't been any activity for last 4 weeks? |
I think since this is needed for Winforms what we should do is add System.Drawing.Common to the framework (I would only add it to netcoreapp since in UAP it is a not supported assembly). And then in |
@weshaggard I guess wpf/winforms now is a strong reason to include this converters to netcoreapp and not if def them just for Mono sources. |
I don't have an issue with having these TypeConverters added to the TypeConverter library. |
@karelz Well. I did not have too much time to look again at this in last weeks. But i will certainly do in upcoming days. I I will need some assistance, I will write. |
It seems there is another problem with this. I added
And now I am getting the error which is the same as before but one level deeper - now with
So what now? Probably the same steps for the |
Hmm. Now I found that there is a constant |
@satano that just means the SystemEvents dependency is missing from NetCoreApp and if so we either need to pull that in as well or break the dependency. @ericstj looks like you added the dependency from System.Drawing.Common to Microsoft.Win32.SystemEvents in c56fdf1. Do you feel that dependency is important enough to warrant pulling in Microsoft.Win32.SystemEvents into the shared framework? |
That tracking is important so that WinForms apps can respond to theme changes IIRC (/cc @Tanya-Solyanik). I think this is still relevant in modern windows, though probably less so since Aero is the default theme. I imagine you could make it lightup, by hooking SystemEvents via reflection. That way we'd only react to the color changes if SystemEvents was present and it would be for a WinForms app. Alternatively we could look at lifting the dependency to the app model by exposing a new API. We could make WinForms itself responsible for hooking SystemEvents. We'd need to keep the tracker present since it registers on construction, then expose something publicly like Finally, if you just cut this entirely, I would imagine it would mean that an application would need to restart to react to theme changes. |
Well. I added
|
Interesting. Looks like that's only for InvalidAsynchronousStateException. We could push that exception down I suppose. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
test Linux-musl x64 Debug Build please |
@safern is anything blocking merge of this PR? |
This will bring an "external" dependency into the shared framework for Unix (libgdiplus) since System.Drawing.Common is being moved inbox into the framework in this PR. So we're evaluating if we want to have that dependency and think how to address that if so. I will update the PR once that is decided. We didn't think of that dependency when we decided it to move it inbox but it came up in one internal discussion. We're still going to use this code as is, but we're still deciding where would be the right place for it to go. |
Makes sense, marking as blocked until the decision is made. Any rough ETA? |
@safern any rough ETA on the decision? |
@safern ping? |
Sorry I missed this somehow. I will prioritize figuring out this tomorrow and update the PR accordingly. |
@safern any update? |
No, we're still discussing what to do. I'm doing some investigations on how adding a dependency to TypeConverters affects the Drawing closure. |
I'm still looking for the best solution on this. We don't have very clear what we want to do YET, since we are not sure if we want System.Drawing to be inbox yet just for the justification of not depending on TypeConverters. Since this TypeConverters are for Winforms, we're exploring other possibilities i.e add them to a separate assembly that is part of the Winforms framework instead of adding the converters directly in System.ComponentModel.TypeConverters |
@safern still blocked? |
No actually we came with a plan this week. I just hadn't updated the PR cause plan to work in it next week. But basically we're not taking the PR the way it is, it needs some changes because we don't want to pull in System.Drawing inbox just yet. @satano I'm sorry about this and that this have become more complicated that it seemed to be. I will be taking the code for the tests and typeconverters that you added and move them to another library that will be part of Winforms and then System.Drawing.Common will have a runtime dependency on it. If you feel like doing it I can definitely help you, if not, I totally understand and I'll update your PR or create a new one. |
@safern I can try to do it. But I do not understand what to do. 😃 |
Thanks for your will to help and still tackle this PR 😄, it helps a lot! Basically you would need to move the all the TypeConverters into Then to all the System.Drawing types that you're adding type converters you need to add the [TypeConverter("System.Drawing.FontConverter, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] Does it makes sense? |
Yes it does (for now). I will look at it in couple of days (during the weekend at the earliest). There is a notice here that there are some conflicts that needs to be resolved from |
Since we're completely changing the plan here I don't think it makes sense of going through the pain of solving merge conflicts. I would probably just open up a new PR in a clean branch since it will have a big change of where the types/tests are going to be and we don't need to to the IsNetCoreApp/UAP stuff, nor moving types down to other assemblies. So I think it will be less painfull for you to do it in a separate branch created from latest master. |
OK 👍 |
@safern I have problems with building corefx. I did not do it for a couple of weeks. I have pulled last version (even tried to clone the repo again) and the build is still failing. The last time the build worked I had a bit older Visual Studio. I do not know the exact version, but probably it was 15.7.x. The end of the output from
In the mentioned |
Hey @satano could you please validate that you have all the requirements to build correctly and that you're on the latest cmake machine? I've also hit issues like that when updating VS because I didn't restart my computer after the update, so after restarting my computer it worked fine. |
Hm. I was missing something, but just installing it did not help. I had to repair Visual Studio Installation. Now everything works. Thanks a lot. |
@satano any update on this? I guess you will be opening a new PR and we can close this one right? |
Yes. I have it halfway through on my computer. I will open a new PR in couple of days. |
Thanks you very much! |
Closes #21129
@safern I closed the first PR #28426, because I messed it with rebase onto master. So review this please.