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

Differentiating Between Win10 and Nano Server #7375

Closed
mattleibow opened this issue Oct 8, 2018 · 4 comments
Closed

Differentiating Between Win10 and Nano Server #7375

mattleibow opened this issue Oct 8, 2018 · 4 comments
Labels
Resolution:Question This issues appears to be a question, not a product defect

Comments

@mattleibow
Copy link

mattleibow commented Oct 8, 2018

I am not too sure if this is the correct place, but this is not really a problem - more a question.

I am building a library (SkiaSharp) that does some font subsetting using the FONTSUB.DLL. This may be an old feature that I shouldn't use, but right now I am (I will investigate this further).

As a result, SkiaSharp cannot be used on Nano Server due to this dll being unavailable. I can compile another binary that does not have this feature, but I still have to support the full set.

My question is this, if I have 2 binaries - one for Nano Server and one for Windows Server, but I can't see a way to distinguish between the two platforms. Right now I am using the runtimes folder in the NuGet - currently the win7-x64 sub-dir. Is there a nanoserver variant?

The original discussion is here with missing assemblies and entry points: mono/SkiaSharp#591 (comment)

@mattleibow mattleibow changed the title Differentiating Between Win10 and Nono Server Differentiating Between Win10 and Nano Server Oct 8, 2018
@rrelyea rrelyea added the Resolution:Question This issues appears to be a question, not a product defect label Oct 11, 2018
@rrelyea
Copy link
Contributor

rrelyea commented Oct 11, 2018

It sounds like you need to have runtime behavior be different for these two different environments.
I think you code needs to detect this case, and act differently.

Different runtimes won't solve this for you, even if NuGet did know the difference between different SKUs of the same version of windows. (As you'd want one set of binaries to be installed by your app/component)

@nkolev92
Copy link
Member

Closing per @rrelyea's comment.

@mattleibow
Copy link
Author

mattleibow commented Nov 16, 2019

So are you suggesting that I write some extra logic in the part that loads the native binaries to make sure I select the correct binary? This is a lot of extra work to get around the fact that Nano is a different windows. Technically, UWP is windows, yet they have their own RID. Now, sure, UWP is a different model, but if I had that feature, then I don't have to worry about loads of code selecting a dll based on the runtime. Literally, the R in RID is Runtime, so the dotnet run or dotnet publish should support this.

UWP is the perfect example actually, it is a win10, but has nativeassets of uap: runtimes/win10-x64/nativeassets/uap10.0/libSkiaSharp.dll

This was suggested on my other issue (#5042) and this feature was added to solve this very problem (#2782)

Can we not add nano? runtimes/win10-x64/nativeassets/nano/libSkiaSharp.dll

EDIT

Well actually, the nano is not a TFM so technically it is wrong. But maybe the spec for the case of /runtimes/{rid}/nativeassets/{txm}/ really is wrong. What is the point of having /runtimes/win10-x64/nativeassets/xamarin.ios/libSkiaSharp? That makes no actual sense. Even the concept of having uap under win10 is a bit weird. Why not have /runtimes/uap10.0/? Isn't that the who point of the runtimes folder? To select the correct native binaries for the runtime, based on the runtime? It looks to me if I have a native binary that works on both win10 and nano, then it should be fine to have it in /runtimes/win10-x64/ and it will use the same in both places. But if not, then I should be splitting it up under the nativeassets.

I think that my issue actually points out the real problem here. The original issue for this feature was to distinguish UWP from Win10, but in actual fact, they were wanting to distinguish between a feature-set or subset of features of a platform. So the base is win10, and then we have UWP or Nano.

This will bring in a feature support for macOS and the new Catalyst feature - running iOS apps on macOS. @migueldeicaza How are we doing this right now? Depending on the base of this feature, we may want to do something in the lines of:

  • /runtimes/xamarin.ios/native.framework
  • /runtimes/xamarin.ios/nativeassets/catalyst/native.framework
  • /runtimes/xamarin.mac/nativeassets/ios/native.framework

What this issue is really trying to do is distinguish between different variants of Win10. This might be further extended (as in the Catalyst example) to other operating systems that have variants with 90% features, but require distinct features.

@mattleibow
Copy link
Author

@rrelyea @nkolev92 Just pinging you so this issue isn't missed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution:Question This issues appears to be a question, not a product defect
Projects
None yet
Development

No branches or pull requests

3 participants