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

Don't include windows PInvokes on Unix for System.Drawing #49405

Merged
merged 3 commits into from
Mar 11, 2021

Conversation

safern
Copy link
Member

@safern safern commented Mar 10, 2021

Fixes: #49275

@ghost
Copy link

ghost commented Mar 10, 2021

Tagging subscribers to this area: @safern, @tarekgh
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes: #49275

Author: safern
Assignees: -
Labels:

area-System.Drawing

Milestone: -

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

LGTM otherwise. Thanks!

@safern
Copy link
Member Author

safern commented Mar 10, 2021

I made some changes to conform with Interop guidelines so that ExternDll.Unix.cs didn't include any windows specific library names.

There is more cleanup to do, it would be nice if SafeNativeMethods followed the Interop guidelines as well but that would be a very large change. I would like to do that in a separate PR if that's OK.

@jkotas
Copy link
Member

jkotas commented Mar 10, 2021

Yes, that's ok. Thanks!

@safern
Copy link
Member Author

safern commented Mar 10, 2021

FYI: @JeremyKuhne

<Compile Include="misc\ExternDll.Unix.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs"
Link="Common\Interop\Unix\Interop.Libraries.cs" />
<Compile Include="Interop\Unix\Interop.Libraries.cs" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you also please update to not target Unix? I think we effectively support this library on Linux and macOS only not on any Unix* RIDs like tvOS or solaris.

Copy link
Member Author

Choose a reason for hiding this comment

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

This library is cross compiled for windows and Unix. IIRC Unix is a parent of Linux, Solaris and macOS, so I'm just following the convention we have in other libraries here. I think whenever we start cross targeting for macOS or other targets if we ever do then we can adjust the paths for that.

<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent);netcoreapp3.0-windows;netcoreapp3.0-Unix;netcoreapp3.0</TargetFrameworks>

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, which is not wrong because the library is not supported on "Unix". I'll open another issue if you don't want to mix the fix with this change

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, which is not wrong because the library is not supported on "Unix".

You mean that cause Unix would imply iOS/tvOS and others we don't support right?

I'll open another issue if you don't want to mix the fix with this change

Sounds good. I rather keep this PR as is and have another issue to fix this.

@safern
Copy link
Member Author

safern commented Mar 11, 2021

Failures are unrelated and following up with dnceng.

@safern safern merged commit f20d19d into dotnet:main Mar 11, 2021
@safern safern deleted the DrawingWindowsPinvoke branch March 11, 2021 02:02
@ghost ghost locked as resolved and limited conversation to collaborators Apr 10, 2021
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Linux] System.Drawing.Common not working on Linux
4 participants