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

dotnet: add dotnet 6.0 runtime #4976

Merged
merged 5 commits into from
Apr 14, 2022
Merged

Conversation

hgy59
Copy link
Contributor

@hgy59 hgy59 commented Nov 22, 2021

Motivation: Introduce dotnet runtime as the new .NET 6 is an LTS version
Linked issues: #3892

Checklist

  • Build rule all-supported completed successfully
  • Package upgrade completed successfully
  • New installation of package completed successfully

Remarks

.net (former .net core) has limitted platform support.
not supported archs are:

  • evansport (i686, x86, i.e. 32-bit intel)
  • PPC (all flowers of Power Processor)
  • ARMv7L (hi2525)
  • May be we need to exclude armadaxp and alpine. from generic armv7 package as reported in dotnet: mark armadaxp and alpine as unsupported #4793 for Radarr and Jellyfin packages.

Framework fixes and enhancements

  • fix use of PLIST.auto with spksrc.install-resources.mk
  • allow multiple files in digests with different urls (dist names)

@hgy59 hgy59 added the dotnet Related to dotnet (core) label Nov 22, 2021
Comment on lines 56 to 57
ifeq ($(strip $(PLIST_TRANSFORM)),)
PLIST_TRANSFORM= cat
endif
plist: install
include ../../mk/spksrc.plist.mk
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch!

@publicarray
Copy link
Member

just an FYI I reverted the exclude armadaxp and alpine in #4824 because it appears to be dependent on the code/cpu feature/compiler

Jellyfin and armadaxp (DS414) do not work (exits with Illegal instruction)
Radarr and alpine (DS715) do not work (exits with Illegal instruction)

Please report the issue upstream. Could be an issue with Synology/CPU, the App (Jellyfin/Radarr) or dotnet. Either way a coredump is the only way to investigate this further.

hgy59 added a commit to hgy59/spksrc that referenced this pull request Dec 21, 2021
- depends on dotnet-runtime package (SynoCommunity#4976)
- patch pwsh to use library path of dotnet-runtime
hgy59 added a commit to hgy59/spksrc that referenced this pull request Dec 22, 2021
- depends on dotnet-runtime package (SynoCommunity#4976)
- patch pwsh to use library path of dotnet-runtime
@picrap
Copy link

picrap commented Mar 29, 2022

Hi there, any progress on this pull request?

@hgy59
Copy link
Contributor Author

hgy59 commented Apr 5, 2022

Hi there, any progress on this pull request?

@picrap If you are interested in this package, you can download packages created by github build action (within 90 days since last build).
So far there is no other package that depends on dotnet runtime package.
I am still unsure whether we sould create a dotnet runtime or a dotnet sdk package (we cannot deploy two packages for runtime and sdk, as there will be only one dotnet reachable in the path, and those cannot be installed into the same folder - or sharing the same folders), and the most important fact: it is not possible to create packages that dynamically depend on dotnet runtime or dotnet skd.

@picrap
Copy link

picrap commented Apr 6, 2022

I manually installed the generated dotnet-runtime_x64-7.0_6.0.3-1.spk but it doesn’t seem to contain any binary:

/var/services/homes/admin#  ls -laRL /var/packages/dotnet-runtime/
/var/packages/dotnet-runtime/:
total 52
drwxr-xr-x  5 root              root           4096 Apr  6 10:20 .
drwxr-xr-x 21 root              root           4096 Apr  6 10:21 ..
drwxr-xr-x  2 root              root           4096 Apr  6 10:20 conf
-rw-r--r--  1 root              root              0 Apr  6 10:20 enabled
drwxr-xr-x  1 sc-dotnet-runtime synocommunity     0 Apr  6 10:20 etc
drwx------  1 sc-dotnet-runtime synocommunity     0 Apr  6 10:20 home
-rw-r--r--  1 root              root          31566 Apr  6 10:20 INFO
drwxr-xr-x  2 root              root           4096 Apr  5 23:55 scripts
drwxr-xr-x  1 sc-dotnet-runtime synocommunity    12 Apr  6 10:20 target
drwxr-xr-x  1 sc-dotnet-runtime synocommunity     0 Apr  6 10:20 tmp
drwxr-xr-x  1 sc-dotnet-runtime synocommunity     0 Apr  6 10:20 var
drwxr-xr-x  2 root              root           4096 Apr  5 23:55 WIZARD_UIFILES

/var/packages/dotnet-runtime/conf:
total 20
drwxr-xr-x 2 root root 4096 Apr  6 10:20 .
drwxr-xr-x 5 root root 4096 Apr  6 10:20 ..
-rw-r--r-- 1 root root  115 Apr  5 23:55 privilege
-rw------- 1 root root   70 Apr  6 10:20 resource
-rw------- 1 root root   51 Apr  6 10:20 resource.own

/var/packages/dotnet-runtime/etc:
total 0
drwxr-xr-x 1 sc-dotnet-runtime synocommunity   0 Apr  6 10:20 .
drwxr-xr-x 1 root              root          272 Apr  6 10:20 ..

/var/packages/dotnet-runtime/home:
total 0
drwx------ 1 sc-dotnet-runtime synocommunity   0 Apr  6 10:20 .
drwxr-xr-x 1 root              root          328 Apr  6 10:20 ..

/var/packages/dotnet-runtime/scripts:
total 52
drwxr-xr-x 2 root root 4096 Apr  5 23:55 .
drwxr-xr-x 5 root root 4096 Apr  6 10:20 ..
-rwxr-xr-x 1 root root 3140 Apr  5 23:55 functions
-rwxr-xr-x 1 root root 7054 Apr  5 23:55 installer
-rwxr-xr-x 1 root root   73 Apr  5 23:55 postinst
-rwxr-xr-x 1 root root   73 Apr  5 23:55 postuninst
-rwxr-xr-x 1 root root   73 Apr  5 23:55 postupgrade
-rwxr-xr-x 1 root root   73 Apr  5 23:55 preinst
-rwxr-xr-x 1 root root   73 Apr  5 23:55 preuninst
-rwxr-xr-x 1 root root   73 Apr  5 23:55 preupgrade
-rwxr-xr-x 1 root root  314 Apr  5 23:55 service-setup
-rwxr-xr-x 1 root root  206 Apr  5 23:55 start-stop-status

/var/packages/dotnet-runtime/target:
total 0
drwxr-xr-x 1 sc-dotnet-runtime synocommunity  12 Apr  6 10:20 .
drwxr-xr-x 1 root              root          190 Apr  6 10:21 ..
drwxr-xr-x 1 sc-dotnet-runtime synocommunity  12 Apr  5 23:55 app
drwxr-xr-x 1 sc-dotnet-runtime synocommunity 528 Apr  5 23:55 lib

/var/packages/dotnet-runtime/target/app:
total 0
drwxr-xr-x 1 sc-dotnet-runtime synocommunity  12 Apr  5 23:55 .
drwxr-xr-x 1 sc-dotnet-runtime synocommunity  12 Apr  6 10:20 ..
drwxr-xr-x 1 sc-dotnet-runtime synocommunity 296 Apr  5 23:55 images

/var/packages/dotnet-runtime/target/app/images:
total 36
drwxr-xr-x 1 sc-dotnet-runtime synocommunity   296 Apr  5 23:55 .
drwxr-xr-x 1 sc-dotnet-runtime synocommunity    12 Apr  5 23:55 ..
-rw-r--r-- 1 sc-dotnet-runtime synocommunity   722 Apr  5 23:55 dotnet-runtime-16.png
-rw-r--r-- 1 sc-dotnet-runtime synocommunity  1315 Apr  5 23:55 dotnet-runtime-24.png
-rw-r--r-- 1 sc-dotnet-runtime synocommunity 10031 Apr  5 23:55 dotnet-runtime-256.png
-rw-r--r-- 1 sc-dotnet-runtime synocommunity  1118 Apr  5 23:55 dotnet-runtime-32.png
-rw-r--r-- 1 sc-dotnet-runtime synocommunity  1680 Apr  5 23:55 dotnet-runtime-48.png
-rw-r--r-- 1 sc-dotnet-runtime synocommunity  2433 Apr  5 23:55 dotnet-runtime-64.png
-rw-r--r-- 1 sc-dotnet-runtime synocommunity  2765 Apr  5 23:55 dotnet-runtime-72.png

/var/packages/dotnet-runtime/target/lib:
total 104076
drwxr-xr-x 1 sc-dotnet-runtime synocommunity      528 Apr  5 23:55 .
drwxr-xr-x 1 sc-dotnet-runtime synocommunity       12 Apr  6 10:20 ..
-rwxr-xr-x 1 sc-dotnet-runtime synocommunity 28570240 Apr  5 23:55 libicudata.so
-rwxr-xr-x 1 sc-dotnet-runtime synocommunity 28570240 Apr  5 23:55 libicudata.so.68
-rwxr-xr-x 1 sc-dotnet-runtime synocommunity 28570240 Apr  5 23:55 libicudata.so.68.2
-rwxr-xr-x 1 sc-dotnet-runtime synocommunity  4034528 Apr  5 23:55 libicui18n.so
-rwxr-xr-x 1 sc-dotnet-runtime synocommunity  4034528 Apr  5 23:55 libicui18n.so.68
-rwxr-xr-x 1 sc-dotnet-runtime synocommunity  4034528 Apr  5 23:55 libicui18n.so.68.2
-rwxr-xr-x 1 sc-dotnet-runtime synocommunity    68328 Apr  5 23:55 libicuio.so
-rwxr-xr-x 1 sc-dotnet-runtime synocommunity    68328 Apr  5 23:55 libicuio.so.68
-rwxr-xr-x 1 sc-dotnet-runtime synocommunity    68328 Apr  5 23:55 libicuio.so.68.2
-rwxr-xr-x 1 sc-dotnet-runtime synocommunity    82080 Apr  5 23:55 libicutest.so
-rwxr-xr-x 1 sc-dotnet-runtime synocommunity    82080 Apr  5 23:55 libicutest.so.68
-rwxr-xr-x 1 sc-dotnet-runtime synocommunity    82080 Apr  5 23:55 libicutest.so.68.2
-rwxr-xr-x 1 sc-dotnet-runtime synocommunity   328400 Apr  5 23:55 libicutu.so
-rwxr-xr-x 1 sc-dotnet-runtime synocommunity   328400 Apr  5 23:55 libicutu.so.68
-rwxr-xr-x 1 sc-dotnet-runtime synocommunity   328400 Apr  5 23:55 libicutu.so.68.2
-rwxr-xr-x 1 sc-dotnet-runtime synocommunity  2427456 Apr  5 23:55 libicuuc.so
-rwxr-xr-x 1 sc-dotnet-runtime synocommunity  2427456 Apr  5 23:55 libicuuc.so.68
-rwxr-xr-x 1 sc-dotnet-runtime synocommunity  2427456 Apr  5 23:55 libicuuc.so.68.2

/var/packages/dotnet-runtime/tmp:
total 0
drwxr-xr-x 1 sc-dotnet-runtime synocommunity   0 Apr  6 10:20 .
drwxr-xr-x 1 root              root          198 Apr  6 10:21 ..

/var/packages/dotnet-runtime/var:
total 0
drwxr-xr-x 1 sc-dotnet-runtime synocommunity   0 Apr  6 10:20 .
drwxr-xr-x 1 root              root          328 Apr  6 10:20 ..

/var/packages/dotnet-runtime/WIZARD_UIFILES:
total 12
drwxr-xr-x 2 root root 4096 Apr  5 23:55 .
drwxr-xr-x 5 root root 4096 Apr  6 10:20 ..
-rwxr-xr-x 1 root root  484 Apr  5 23:55 uninstall_uifile

@hgy59
Copy link
Contributor Author

hgy59 commented Apr 7, 2022

Indeed, the packages created by github build action are incomplete.

My locally built packages are about 50MB and the libraries are installed into /var/packages/dotnet-runtime/target/share/

$ dotnet --info

Host (useful for support):
  Version: 6.0.3
  Commit:  c24d9a9c91

.NET SDKs installed:
  No SDKs were found.

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.3 [/volume1/@appstore/dotnet-runtime/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.3 [/volume1/@appstore/dotnet-runtime/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download

dotnet executable is:

~$ ls -la $(which dotnet)
lrwxrwxrwx 1 root root 55 Apr  7 17:20 /usr/local/bin/dotnet -> /var/packages/dotnet-runtime/target/share/dotnet/dotnet

hgy59 added 3 commits April 7, 2022 17:34
- fix use of PLIST.auto with spksrc.install-resources.mk
- allow multiple files in digests with different urls (dist names)
@picrap
Copy link

picrap commented Apr 13, 2022

dotnet 6.0.4 is just released (so you can update the script 😉)

@hgy59
Copy link
Contributor Author

hgy59 commented Apr 13, 2022

@picrap the build of dotnet-runtime packages is fixed, and updated to v6.0.4

@picrap
Copy link

picrap commented Apr 13, 2022

@picrap the build of dotnet-runtime packages is fixed, and updated to v6.0.4

And this totally works! Brilliant! (we’ll run a few tests to be sure)

@picrap
Copy link

picrap commented Apr 13, 2022

We have a problem loading native assemblies (which are in runtime/«platform»/native) because the loader only looks in the standard lib directories, so the native libraries are not found. I’ll try to investigate and see what can be done.

@hgy59
Copy link
Contributor Author

hgy59 commented Apr 13, 2022

We have a problem loading native assemblies (which are in runtime/«platform»/native) because the loader only looks in the standard lib directories, so the native libraries are not found. I’ll try to investigate and see what can be done.

@picrap on which platform are you testing? (DSM Version, arch like x64/armv7/aarch64)

What native assemblies are not found by the loader? I cannot see any runtime folder in the package.

@picrap
Copy link

picrap commented Apr 13, 2022

@hgy59 this is not dotnet package-related. The problem is when an application is built with native libraries (.so) they are placed in that runtime/… directory, and the dotnet runtime fails to find them because it looks only in standard libraries directories.

So here is my sample case: we have a DSM7 with AMD64 architecture. We use the Mono.Posix package which ends up adding a runtime/linux-x64/native/libMono.Unix.so in the application directory. The dotnet runtime tries to load that libMono.Unix.so only from /lib64 and /etc/lib64, and fails to find it (because it is in the runtime/linux-x64/native subdirectory).
As a proof-of-concept, manually copying the libMono.Unix.so in /lib64 and the application works fine.

I’ll try tomorrow to override the LD_LIBRARY_PATH to see if it fixes it. I’ll also look on a Debian distribution to see how it handles such case.
Then I’ll let you know, so we can see if there is a working solution that can be embedded in the build (but since you use directly the official dotnet files without rebuild, I don’t know if we can patch it).

@hgy59
Copy link
Contributor Author

hgy59 commented Apr 13, 2022

@picrap probably you find a solution in dotnet/runtime#34711 (comment)

@picrap
Copy link

picrap commented Apr 14, 2022

Nailed it: it is related to a mount point (I run an app generated on my PC with a CIFS mount on DSM), so coyping everything in local (on the DSM) works. The dotnet package seems to run fine.

@hgy59 hgy59 merged commit 515cd62 into SynoCommunity:master Apr 14, 2022
@hgy59 hgy59 deleted the add_dotnet6 branch April 14, 2022 15:21
@hgy59 hgy59 added the status/published Published and activated (may take up to 48h until visible in DSM package manager) label Apr 14, 2022
@smaarn smaarn mentioned this pull request May 1, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet Related to dotnet (core) status/published Published and activated (may take up to 48h until visible in DSM package manager)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants