runtime icon indicating copy to clipboard operation
runtime copied to clipboard

System.Native.a in System.Console package

Open gkhanna79 opened this issue 11 years ago • 14 comments

System.Native.so is part of the System.Console package. This works well for CoreCLR scenario where the PAL is a shared object.

For CoreRT console scenarios, we need to link the PAL into the application and thus, need System.Native.a to be part of the nuget package.

@stephentoub - please share your thoughts on this :)

@brthor @MichalStrehovsky @schellap - FYI

gkhanna79 avatar Nov 18 '15 20:11 gkhanna79

@tarekgh can you please track this work with the other CoreRT PAL work we are have.

weshaggard avatar Nov 18 '15 20:11 weshaggard

Last I knew, our working plan for the shims is what @ericstj outlined at: https://github.com/dotnet/corefx/issues/2302#issuecomment-156132918 so assuming we stick with that, if System.Native.so is in the System.Console package today, I wouldn't expect it to be longer term.

But that's neither here nor there... the real request is for the .a to be in whatever package includes the corresponding .so / .dylib / etc. I don't have any fundamental concerns with that. How much would we expect it'll increase the size of the relevant package? My assumption is not by very much, in which case seems reasonable to me, barring any other concerns that are aired.

stephentoub avatar Nov 18 '15 20:11 stephentoub

Just FYI, I had to #if 0 out ShmOpen and ShmUnlink implementations to get it linking for dotnet-cli. Please let me know when this is ready for PR so we can test this out.

schellap avatar Nov 18 '15 21:11 schellap

I had to #if 0 out ShmOpen and ShmUnlink implementations to get it linking for dotnet-cli

Why? What was the problem?

stephentoub avatar Nov 18 '15 21:11 stephentoub

shm_open and shm_unlink weren't found if I just exported the System.Native.so as a static library.

Are we supposed to link differently? I saw this option: -lrt

schellap avatar Nov 18 '15 22:11 schellap

Are we supposed to link differently? I saw this option: -lrt

Yes, those functions are exported from librt, so one needs to link with -lrt, e.g. see http://linux.die.net/man/3/shm_open.

stephentoub avatar Nov 18 '15 22:11 stephentoub

System.Native.so is part of the System.Console package.

This is not correct. System.Native.so is currently part of the Microsoft.NETCore.Runtime.CoreCLR packages.

We already have https://github.com/dotnet/corefx/issues/2302#issuecomment-156132918 tracking pulling that out of the runtime package and packaging shims independently.

If this is indeed tracking inclusion of some new .a file in the same package that includes the .so, please outline the requirements for the .a file.

Where does it build? What is it? What does the build system need to do with it? All of these will influence how it is packaged.

ericstj avatar Nov 24 '15 18:11 ericstj

@stephentoub could you please help answering @ericstj question if we need to include the .a and .dylib files too?

tarekgh avatar Nov 25 '15 17:11 tarekgh

I thought I already did :smile: :

the real request is for the .a to be in whatever package includes the corresponding .so / .dylib / etc. I don't have any fundamental concerns with that. How much would we expect it'll increase the size of the relevant package? My assumption is not by very much, in which case seems reasonable to me, barring any other concerns that are aired.

I've not heard an answer to the question from @gkhanna79, but assuming including the .a's addresses the concern and no one raises any other concerns with it, sounds fine.

Where does it build? What is it?

They'd be built at the same time as the .so / .dylib. .so is for dynamic linking whereas .a is for static linking.

stephentoub avatar Nov 25 '15 17:11 stephentoub

@stephentoub Yes, including the .a should address the concern. The question that will remain is knowing which nuget package will contain them :)

gkhanna79 avatar Nov 25 '15 17:11 gkhanna79

@gkhanna79 from Eric's comment

We already have dotnet/runtime#14821 (comment) tracking pulling that out of the runtime package and packaging shims independently.

tarekgh avatar Nov 25 '15 17:11 tarekgh

This is done and now the package is in myget and also containing the static library (.a).

@schellap is going to do the integration in corert to consume such packages

tarekgh avatar Jan 21 '16 22:01 tarekgh

@schellap @tarekgh Is there a corresponding issue for updating CoreRT repo to consume this?

gkhanna79 avatar Jan 22 '16 15:01 gkhanna79

@schellap @gkhanna79 I have created a new issue in corert and linked it to this issue. the new issue track the work of integrating System.Native to corert toolchain

tarekgh avatar Jan 22 '16 16:01 tarekgh