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

Jackett "Standalone" aka build using .NET #4207

Merged
merged 8 commits into from
Feb 14, 2021

Conversation

publicarray
Copy link
Member

@publicarray publicarray commented Oct 6, 2020

Motivation: #3697 (comment)
Linked issues: #3697

CC @m4tt075

Caveats:

  • Only x64, ARM 8 and ARM 7 are supported, so I've moved it to a new package: jackett-dotnet
    * Currently the .NET framework keeps data in ~/.dotnet, so I used docker run --name spksrc --rm -it -v $HOME/git/spksrc:/spksrc:delegated -v :/root/.dotnet synocommunity/spksrc:latest /bin/bash to run docker

Build: https://github.com/publicarray/spksrc/releases/tag/jackett-dotnet-0.16.1583

Checklist

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

@m4tt075
Copy link
Contributor

m4tt075 commented Oct 6, 2020

@publicarray Thanks for copying me in. I've stopped using Synology NASs some time ago, and as such, am no longer maintaining this package. As such please feel free to put yourself or just SynoCommunity in as maintainer.

In any case, I remember very vividly that maintaining mono has been more than painful. As such, this PR and your efforts here to circumvent the mono dependency will clearly be beneficial and appreciated by the community!

@publicarray
Copy link
Member Author

publicarray commented Oct 6, 2020

Oh I am curious, Can I ask what you are using instead for storage?

Thank you for your kind words 🙏

Most of the hard work was done in the Jackett repository and by their maintainers. But thanks none the less 😄

@m4tt075
Copy link
Contributor

m4tt075 commented Oct 6, 2020

I've built my own NAS. If you are interested in the background and you understand (some) German, you can find the whole story here: https://www.kodinerds.net/index.php/Thread/65922-Neues-NAS-Server/?pageNo=1.

@publicarray
Copy link
Member Author

@m4tt075 Thank you! That is very interesting. (Ich kann Deutsch sprechen 😄)

Copy link
Contributor

@ymartin59 ymartin59 left a comment

Choose a reason for hiding this comment

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

I recommend to replace original "jackett" (with Mono runtime) with new version compiled by dotNetCore and to confirm upgrade process allows user to keep application configuration and data.

@publicarray publicarray force-pushed the jackett branch 2 times, most recently from a7057e5 to a383a5d Compare December 4, 2020 12:11
@publicarray
Copy link
Member Author

@ymartin59 Done, I replaced the original jackett. Note that some older 32-bit architectures are not supported. I've also created generic makefiles for .net

@publicarray publicarray added the dotnet Related to dotnet (core) label Dec 7, 2020
@mreid-tt mreid-tt mentioned this pull request Dec 10, 2020
3 tasks
@publicarray publicarray mentioned this pull request Dec 13, 2020
4 tasks
@publicarray publicarray requested a review from th0ma7 December 21, 2020 08:50
@hgy59 hgy59 mentioned this pull request Jan 9, 2021
@publicarray publicarray force-pushed the jackett branch 2 times, most recently from a84da92 to 7f773de Compare January 11, 2021 07:54
@publicarray publicarray mentioned this pull request Jan 11, 2021
3 tasks
@hgy59 hgy59 changed the title Jackett "Standalone" aka build using .NET framework Jackett "Standalone" aka build using .NET Jan 16, 2021
@ymartin59
Copy link
Contributor

@publicarray So it means package is no longer available for "evansport" whereas this architecture is still supported with DSM 7? It is quite annoying. What prevents i686 compilation to work with dotnet-core?

@hgy59
Copy link
Contributor

hgy59 commented Jan 17, 2021

@publicarray So it means package is no longer available for "evansport" whereas this architecture is still supported with DSM 7? It is quite annoying. What prevents i686 compilation to work with dotnet-core?

There is no support for 32 bit linux with .NET (formerly named dotnet core). 32 bit is supported only on ARM (linux arm32) and windows (x86).
see current versions

Copy link
Contributor

@ymartin59 ymartin59 left a comment

Choose a reason for hiding this comment

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

Looks good. But I would request effort to keep Jackett for archs not supported by dotnetcore, thanks to a conditional build with Mono. At least for archs still under support with DSM 7...

spk/jackett/Makefile Show resolved Hide resolved
REQUIRED_DSM = 5.0
# no PPC support for mono, see cross/mono/Makefile for details
UNSUPPORTED_ARCHS = $(PPC_ARCHS)
UNSUPPORTED_ARCHS = $(PPC_ARCHS) $(ARMv5_ARCHS) $(i686_ARCHS) $(ARMv7L_ARCHS)
Copy link
Contributor

Choose a reason for hiding this comment

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

What about to conditionally produce Mono package version for these "unsupported archs"?
Same package name but different dependencies, build target and startup script according to arch with either Mono or dotnetcore support...

Copy link
Member Author

Choose a reason for hiding this comment

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

I gave it a go, let me know what you think.

native/dotnet-sdk-5.0/Makefile Outdated Show resolved Hide resolved
native/dotnet-sdk-5.0/Makefile Outdated Show resolved Hide resolved
native/dotnet-sdk-3.1/Makefile Outdated Show resolved Hide resolved
native/dotnet-sdk-3.1/Makefile Outdated Show resolved Hide resolved
The native build use pre-build binaries to speed up compile time.
I don't see a reason to compile dotnet-sdk
This commit drops support for i686 and ARMv5
Copy link
Contributor

@ymartin59 ymartin59 left a comment

Choose a reason for hiding this comment

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

Thanks for this effort. Looks good.
Does it really make sense to include dotnet-sdk-3.1 here? You may keep files aside for you/future applications, but I guess there is little chance an application remains on old sdk version?
Sorry but I still have some minor improvements. Then I will test this "branching" package as I have evansport.

DESCRIPTION = "Jackett works as a proxy server. It translates queries from apps into tracker-site-specific http queries, parses the html response, then sends results back to the requesting software. Jackett is a single repository of maintained indexer scraping and translation logic - removing the burden from other apps."
RELOAD_UI = yes
DISPLAY_NAME = Jackett
STARTABLE = yes
CHANGELOG = "Add workaround for mono bug with armv5/88f6281"
CHANGELOG = "Compile using .NET Core"
Copy link
Contributor

Choose a reason for hiding this comment

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

I would manage ChangeLog conditionally according to target arch... either mono or dotnetcore

Comment on lines 33 to 44
ifeq ($(findstring $(ARCH),$(ARMv5_ARCHS)),$(ARCH))
DEPENDS = cross/$(SPK_NAME)-mono
SERVICE_SETUP = src/service-setup-mono.sh
endif
ifeq ($(findstring $(ARCH),$(i686_ARCHS)),$(ARCH))
DEPENDS = cross/$(SPK_NAME)-mono
SERVICE_SETUP = src/service-setup-mono.sh
endif
ifeq ($(findstring $(ARCH),$(ARMv7L_ARCHS)),$(ARCH))
DEPENDS = cross/$(SPK_NAME)-mono
SERVICE_SETUP = src/service-setup-mono.sh
endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Same statements. Please use a single "ifeq" condition with all of them, and include ChangeLog here

@publicarray
Copy link
Member Author

jellyfin is still on 3.1 (at least until 10.7 is released). But generally agree.
3.1 is almost supported for another 2 years (2022-12-03). So I would keep it just in case for now.

@publicarray publicarray merged commit 6fafc45 into SynoCommunity:master Feb 14, 2021
@hgy59 hgy59 mentioned this pull request Feb 19, 2021
@wkobiela
Copy link
Contributor

After upgrading on DS218+, couldn't start package. Had to manually downgrade to last working version.

@publicarray
Copy link
Member Author

Thanks @Wuszek. Sigh. Why is it never simple... Are there any logs?

@wkobiela
Copy link
Contributor

wkobiela commented Feb 21, 2021

Where do I look @publicarray ? Now I have installed Jackett from the previous release (and this mono version installed and started fine), but maybe logs are still somewhere over there

This is part of synopkg.log, from upgrade to uninstall. Maybe I should install it from the scratch, because upgrade didn't work?
https://pastebin.com/G4a37rwb

This is fragment of synoservice.log
https://pastebin.com/UnvfRFCA

@publicarray
Copy link
Member Author

publicarray commented Feb 21, 2021

Thanks @Wuszek, Sorry do you have a log file at cat /var/packages/jackett/target/var/jackett.log ?

@wkobiela
Copy link
Contributor

@publicarray ok, so I just upgraded Jackett in Package Center and I get "Couldnt start up package" notification. This is jackett.log:

Sun Feb 21 13:21:56 CET 2021
Starting jackett command env HOME=/volume1/@appstore/jackett/var PATH=/volume1/@appstore/jackett/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin LD_LIBRARY_PATH=/volume1/@appstore/jackett/lib /volume1/@appstore/jackett/share/jackett --PIDFile /volume1/@appstore/jackett/var/jackett.pid
/volume1/@appstore/jackett/share/jackett: /lib64/libstdc++.so.6: no version information available (required by /volume1/@appstore/jackett/share/jackett)
/volume1/@appstore/jackett/share/jackett: /lib64/libstdc++.so.6: no version information available (required by /volume1/@appstore/jackett/share/jackett)
/volume1/@appstore/jackett/share/jackett: /lib64/libstdc++.so.6: no version information available (required by /volume1/@appstore/jackett/share/jackett)
/volume1/@appstore/jackett/share/jackett: /lib64/libstdc++.so.6: no version information available (required by /volume1/@appstore/jackett/share/jackett)
/volume1/@appstore/jackett/share/jackett: /lib64/libstdc++.so.6: no version information available (required by /volume1/@appstore/jackett/share/jackett)
/volume1/@appstore/jackett/share/jackett: /lib64/libstdc++.so.6: no version information available (required by /volume1/@appstore/jackett/share/jackett)
/volume1/@appstore/jackett/share/jackett: relocation error: /volume1/@appstore/jackett/share/jackett: symbol _ZNSt25__codecvt_utf8_utf16_baseIDsED2Ev, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference

@publicarray
Copy link
Member Author

publicarray commented Feb 21, 2021

Thanks that explains it clearly. The glibc is too old. The x64 I'm testing on must have a slightly newer version.

@wkobiela
Copy link
Contributor

Is there a command to check which version I am using? I tried
strings /usr/lib/libstdc++.so.6 | grep LIBCXX

but there is no strings command

@wkobiela
Copy link
Contributor

@publicarray ping me pls when there would be fix for this, Im willing to test this

@publicarray
Copy link
Member Author

publicarray commented Feb 21, 2021

Thanks @Wuszek what is the output of ls -l /usr/lib/libstdc++.so.6 ?

ls -l /lib64/libc.so.6
lrwxrwxrwx 1 root root 20 Dec 14 17:36 /lib64/libc.so.6 -> libc-2.20-2014.11
ls -l /lib64/libstdc++.so.6
lrwxrwxrwx 1 root root 19 Dec 14 17:36 /usr/lib/libstdc++.so.6 -> libstdc++.so.6.0.20

As a workaround you can copy the lib from a linux box:

$ scp /lib64/libstdc++.so.6 user@synology:/tmp/libstdc++.so.6
$ ssh user@synology
# sudo mv /tmp/libstdc++.so.6 /var/packages/jackett/target/lib/libstdc++.so.6

I've deactivated the .NET versions of the package for now

My host libstdc++.so.6

ls -l /lib64/libstdc++.so.6
lrwxrwxrwx 19 root 9 Nov 2020 /lib64/libstdc++.so.6 -> libstdc++.so.6.0.28

$ strings /lib64/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.26
GLIBCXX_3.4.27
GLIBCXX_3.4.28

@wkobiela
Copy link
Contributor

wkobiela commented Feb 21, 2021

@publicarray output:

root@SynologyNAS_WK:~# ls -l /lib64/libc.so.6
lrwxrwxrwx 1 root root 20 May 26  2020 /lib64/libc.so.6 -> libc-2.20-2014.11.so
root@SynologyNAS_WK:~# ls -l /usr/lib/libstdc++.so.6
lrwxrwxrwx 1 root root 19 May 26  2020 /usr/lib/libstdc++.so.6 -> libstdc++.so.6.0.20

OK, I tried your fix and scp this library from linux mint (it is 6.0.28). There was no /var/packages/jackett/target/lib/ folder, so I made one. App still won't start, the same information in logs as before. I can see, that this copy is not a symbolic link.

root@SynologyNAS_WK:/var/packages/jackett/target/lib# ls -l libstdc++.so.6 
-rwxrwxrwx 1 root root 1952928 Feb 22 08:30 libstdc++.so.6

Found this, may be helpful dotnet/runtime#33384
I can see, that DSM libstdc version is 6.0.20 and on DSM7 it will be 6.0.24.

@ta264
Copy link
Contributor

ta264 commented Mar 1, 2021

@Wuszek We're also very keen to finalize the switch away from mono for Radarr... Would you be up for joining the radarr discord and trying out a few ideas? https://radarr.video/discord

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/needs-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants