All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Package for .NET Core runtime
@ 2020-08-13 18:28 Andrey Nechypurenko
  2020-08-13 19:28 ` Thomas Petazzoni
  0 siblings, 1 reply; 7+ messages in thread
From: Andrey Nechypurenko @ 2020-08-13 18:28 UTC (permalink / raw)
  To: buildroot

Hi Folks,

There was a need for me to integrate .NET Core runtime in our
Buildroot-based build process. Since there is no corresponding package
available, I created the new one and am happy to share it (in
attachment).

Lack of deep knowledge of Buildroot and time pressure prevents me from
creating it as general as I would like it to be. Nevertheless, I think
it could be useful for some developers (at least as a starting point).

The following are some points which might be improved.

1. I made the package explicitly depending on glibc. However, as I
understand from reading installation script provided by Microsoft
(https://dotnet.microsoft.com/download/dotnet-core/scripts),
musl-based systems are also supported. There are also couple of
additional dependencies I derived from this script and put them
explicitly into Config.in . So they must be satisfied before the
package will appear in menuconfig.

2. This package installs 32 bit ARM version regardless of the target
system selected. Microsoft also provides versions for 64 bit ARM and
x86/64 . It was sufficient for our concrete target using it as a
package in an external tree. It would be probably a blocking issue for
including the package as is in Buildroot. I do not know yet how to
handle this issue. Maybe someone more knowledgeable as I am can
improve it.

3. There are several options how to tell the .net core executables
where the runtime is located. Please read the comment in
dotnet-runtime.mk for more details. Maybe these options could be made
available for the user via menuconfig somehow.

Anyway, it works with Buildroot 2020.05.01 for 32-bit ARM (tested with
STM32MP157C-DK2 board).

Just as an information - to get an advantage of the shared runtime,
executables should be generated as NOT self-contained (otherwise, the
whole runtime will be duplicated). It could be done with the following
command:
$ dotnet publish -c Release -r linux-arm --self-contained false

Hope it will be useful for someone and can save some time for fellow developers.

Regards,
Andrey.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dotnet-runtime-pkg.tgz
Type: application/x-compressed-tar
Size: 1023 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20200813/df90c383/attachment.bin>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] Package for .NET Core runtime
  2020-08-13 18:28 [Buildroot] Package for .NET Core runtime Andrey Nechypurenko
@ 2020-08-13 19:28 ` Thomas Petazzoni
  2020-08-15 12:25   ` Andrey Nechypurenko
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2020-08-13 19:28 UTC (permalink / raw)
  To: buildroot

Hello Andrey,

On Thu, 13 Aug 2020 20:28:24 +0200
Andrey Nechypurenko <andreynech@gmail.com> wrote:

> There was a need for me to integrate .NET Core runtime in our
> Buildroot-based build process. Since there is no corresponding package
> available, I created the new one and am happy to share it (in
> attachment).
> 
> Lack of deep knowledge of Buildroot and time pressure prevents me from
> creating it as general as I would like it to be. Nevertheless, I think
> it could be useful for some developers (at least as a starting point).
> 
> The following are some points which might be improved.
> 
> 1. I made the package explicitly depending on glibc. However, as I
> understand from reading installation script provided by Microsoft
> (https://dotnet.microsoft.com/download/dotnet-core/scripts),
> musl-based systems are also supported. There are also couple of
> additional dependencies I derived from this script and put them
> explicitly into Config.in . So they must be satisfied before the
> package will appear in menuconfig.
> 
> 2. This package installs 32 bit ARM version regardless of the target
> system selected. Microsoft also provides versions for 64 bit ARM and
> x86/64 . It was sufficient for our concrete target using it as a
> package in an external tree. It would be probably a blocking issue for
> including the package as is in Buildroot. I do not know yet how to
> handle this issue. Maybe someone more knowledgeable as I am can
> improve it.
> 
> 3. There are several options how to tell the .net core executables
> where the runtime is located. Please read the comment in
> dotnet-runtime.mk for more details. Maybe these options could be made
> available for the user via menuconfig somehow.
> 
> Anyway, it works with Buildroot 2020.05.01 for 32-bit ARM (tested with
> STM32MP157C-DK2 board).
> 
> Just as an information - to get an advantage of the shared runtime,
> executables should be generated as NOT self-contained (otherwise, the
> whole runtime will be duplicated). It could be done with the following
> command:
> $ dotnet publish -c Release -r linux-arm --self-contained false

Thanks for the contribution and the details? The package doesn't seem
to be that complicated. Do you think you could take the time to address
the few issues you've pointed out, and submit it as a proper patch for
inclusion ?

In any case, could you give some details on how this .NET Core runtime
is meant to be used ? For example, would I need to take the SDK for
x86-64 from https://dotnet.microsoft.com/download/dotnet-core/3.1,
build a program with it, place the binary on the target, where it can
run thanks to the .NET Core runtime you have packaged ?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] Package for .NET Core runtime
  2020-08-13 19:28 ` Thomas Petazzoni
@ 2020-08-15 12:25   ` Andrey Nechypurenko
  2020-08-15 14:04     ` Thomas Petazzoni
  0 siblings, 1 reply; 7+ messages in thread
From: Andrey Nechypurenko @ 2020-08-15 12:25 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

> Thanks for the contribution and the details? The package doesn't seem
> to be that complicated. Do you think you could take the time to address
> the few issues you've pointed out, and submit it as a proper patch for
> inclusion ?

It would be interesting for me to improve the package and I would
definitely try to do it. However, I could not commit to any particular
deadline since tasks with higher priority could preempt this activity
:-) . I will post to the list when I progress on this.

> In any case, could you give some details on how this .NET Core runtime
> is meant to be used ? For example, would I need to take the SDK for
> x86-64 from https://dotnet.microsoft.com/download/dotnet-core/3.1,
> build a program with it, place the binary on the target, where it can
> run thanks to the .NET Core runtime you have packaged ?

Yes, that is right. The host compiler generates binaries which could
be executed on the target. As I understand, .NET Core runtime is
essentially a bunch of libraries which are required to run the
application. Advantage of having the runtime installed ist that these
libraries could be used by multiple applications. As an alternative,
on the host, it is possible to generate so-called self-contained
applications. They contain the binary itself and the copy of runtime.
So if there are multiple applications, runtime can save the space on
target. Whether the application is self-contained or framework
(runtime) dependent is controlled by compilation with --self-contained
parameter:
$ dotnet publish -c Release -r linux-arm --self-contained false

What would be really cool is to provide support for .NET Core
applications similar to how it is made, for example, with Golang
($(eval $(golang-package))). Together with the runtime package it will
enable a rather smooth way to build .NET applications with Buildroot.

Regards,
Andrey.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] Package for .NET Core runtime
  2020-08-15 12:25   ` Andrey Nechypurenko
@ 2020-08-15 14:04     ` Thomas Petazzoni
  2020-08-18  9:19       ` Andrey Nechypurenko
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2020-08-15 14:04 UTC (permalink / raw)
  To: buildroot

Hello Andrey,

On Sat, 15 Aug 2020 14:25:42 +0200
Andrey Nechypurenko <andreynech@gmail.com> wrote:

> It would be interesting for me to improve the package and I would
> definitely try to do it. However, I could not commit to any particular
> deadline since tasks with higher priority could preempt this activity
> :-) . I will post to the list when I progress on this.

No worries, we also don't have any specific deadline in Buildroot :-)

Perhaps you could start by sending with "git send-email" the patch you
already have, so we can start giving some initial feedback ?

> Yes, that is right. The host compiler generates binaries which could
> be executed on the target. As I understand, .NET Core runtime is
> essentially a bunch of libraries which are required to run the
> application. Advantage of having the runtime installed ist that these
> libraries could be used by multiple applications. As an alternative,
> on the host, it is possible to generate so-called self-contained
> applications. They contain the binary itself and the copy of runtime.
> So if there are multiple applications, runtime can save the space on
> target. Whether the application is self-contained or framework
> (runtime) dependent is controlled by compilation with --self-contained
> parameter:
> $ dotnet publish -c Release -r linux-arm --self-contained false
> 
> What would be really cool is to provide support for .NET Core
> applications similar to how it is made, for example, with Golang
> ($(eval $(golang-package))). Together with the runtime package it will
> enable a rather smooth way to build .NET applications with Buildroot.

Thanks for those details! Considering what you said, I believe it would
make sense to also package the .NET SDK as a host package in Buildroot,
so that a user can easily have both the compiler on the build machine
and the runtime on the target machine. What do you think ?

Best regards,

Thomas Petazzoni
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] Package for .NET Core runtime
  2020-08-15 14:04     ` Thomas Petazzoni
@ 2020-08-18  9:19       ` Andrey Nechypurenko
  0 siblings, 0 replies; 7+ messages in thread
From: Andrey Nechypurenko @ 2020-08-18  9:19 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

> Perhaps you could start by sending with "git send-email" the patch you
> already have, so we can start giving some initial feedback ?

Will do it during the week.

> > What would be really cool is to provide support for .NET Core
> > applications similar to how it is made, for example, with Golang
> > ($(eval $(golang-package))). Together with the runtime package it will
> > enable a rather smooth way to build .NET applications with Buildroot.
>
> Thanks for those details! Considering what you said, I believe it would
> make sense to also package the .NET SDK as a host package in Buildroot,
> so that a user can easily have both the compiler on the build machine
> and the runtime on the target machine. What do you think ?

You are absolutely right. This is how it should be and I am currently
learning how to do this with Buildroot.

Regards,
Andrey.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] Package for .net core runtime
  2020-09-03  9:27 [Buildroot] Package for .net core runtime Andrey Nechypurenko
@ 2020-09-03 19:03 ` Christian Stewart
  0 siblings, 0 replies; 7+ messages in thread
From: Christian Stewart @ 2020-09-03 19:03 UTC (permalink / raw)
  To: buildroot

Hi Andrey,

On Thu, Sep 3, 2020 at 2:27 AM Andrey Nechypurenko <andreynech@gmail.com> wrote:
> I have posted a patch for .net core runtime package some time weeks ago:
> http://lists.busybox.net/pipermail/buildroot/2020-August/289607.html
>
> Since I did not receive any response yet, I am wondering if there is
> in general an interest in integrating it?

That's such a clean  & simple package that I really do hope it gets merged.

I'll try to test it out.

Best regards,
Christian Stewart

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] Package for .net core runtime
@ 2020-09-03  9:27 Andrey Nechypurenko
  2020-09-03 19:03 ` Christian Stewart
  0 siblings, 1 reply; 7+ messages in thread
From: Andrey Nechypurenko @ 2020-09-03  9:27 UTC (permalink / raw)
  To: buildroot

Hi,

I have posted a patch for .net core runtime package some time weeks ago:
http://lists.busybox.net/pipermail/buildroot/2020-August/289607.html

Since I did not receive any response yet, I am wondering if there is
in general an interest in integrating it?

Best regards,
Andrey.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-09-03 19:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-13 18:28 [Buildroot] Package for .NET Core runtime Andrey Nechypurenko
2020-08-13 19:28 ` Thomas Petazzoni
2020-08-15 12:25   ` Andrey Nechypurenko
2020-08-15 14:04     ` Thomas Petazzoni
2020-08-18  9:19       ` Andrey Nechypurenko
2020-09-03  9:27 [Buildroot] Package for .net core runtime Andrey Nechypurenko
2020-09-03 19:03 ` Christian Stewart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.