SynoCommunity / spksrc

Cross compilation framework to create native packages for the Synology's NAS
https://synocommunity.com
Other
3.03k stars 1.23k forks source link

[Update Request] Mono #2808

Closed Stanzilla closed 6 years ago

Stanzilla commented 7 years ago

Requesting an update to Mono 5 as per https://github.com/Jackett/Jackett/issues/1454#issuecomment-310906029

KaraokeStu commented 7 years ago

This requires checking all other packages that depend on mono to see if they will work with mono 5

M0UL commented 7 years ago

i know sonarr has problems with mono 5. it will crash without a workaround. see https://github.com/Sonarr/Sonarr/issues/1928

epheterson commented 7 years ago

+1

Ironically, Jackett suggested I get Mono v5 to improve stability. And I'm only using Jackett to use Sonarr, so I guess I'm torn.

Stanzilla commented 7 years ago

Maybe ship two packages then, Mono5 and Mono4?

Stanzilla commented 7 years ago

Any news here? 4.6 is pretty old and Jackett seems to have a lot of problems with it.

epheterson commented 7 years ago

Yeah Iā€™d like an update too, Jackett is essentially always down.

m4tt075 commented 7 years ago

@Stanzilla @epheterson I have got a branch containing an update to mono 5.8.0.22 here: https://github.com/m4tt075/spksrc/tree/mono-6.1 Created it for another user once. It compiled for his platform, but I don't use it, never tested it and never received any feedback. Feel free to clone or cherry-pick, test and prepare a proper PR if you like to. I won't pursue this further at this stage...

kaso17 commented 6 years ago

The problem causing sonarr to crash is fixed since the mono-5.4.0.167 release. It would be great if you could upgrade the package to a recent mono version.

@m4tt075 is there a package (easy install) available for your branch? Probably can find some testers for it.

Besides that it looks like the mono certificate-store doesn't get initialized (it changed with mono 4.8). Without it TLS connections will fail due do missing CA certificates. I'm not sure if synology has a system wide ca-bundle file containing trusted root certificates. If it doesn't I would recommend to use the curl bundle (https://curl.haxx.se/ca/cacert.pem). Could you add a call to the mono cert-sync tool (cert-sync /path/to/ca-bundle.pem) to the post install/update script? The cert-sync binary is not listed in the PLIST file, so you might have to add it there too.

Stanzilla commented 6 years ago

yeah a package for easy install testing would be nice.

m4tt075 commented 6 years ago

@Stanzilla @epheterson @kaso17 OK, but you will have to test it and report back then. Otherwise this is a complete waste of time. I need your platform and firmware combinations, e.g. evansport-5.2, apollolake-6.1, etc. What do you need?

Stanzilla commented 6 years ago

I have a DS212, so Marvell Kirkwood ARMv5TE 88F6282 on DSM 6.1.4

m4tt075 commented 6 years ago

Here you go: https://www.dropbox.com/sh/zl67clwy5rio8kn/AADpWJhkHQ6RgqaCbLxbNIJoa?dl=0 I included the certificate synchronization command @kaso17 suggested. Let me know if it works, ok?

Stanzilla commented 6 years ago

Installed and so far things seem to be working. Will monitor the situation and report back, thank you!

kaso17 commented 6 years ago

Feedback from @Feniz:

It fixed the issue for me, I was not able to run 0.8.423.0 on my synology DS213 and now it starts (and it seems also to be more reactive)

m4tt075 commented 6 years ago

Thanks, chaps. @kaso17 Any chance for you to figure out whether that cert-sync is working correctly? I implemented that in "free flight mode" based on your information and a workaround I found from some Synology mono user on the internet. Just want to make sure this does not just work "by chance"...

kaso17 commented 6 years ago

As I don't have a Synology myself I can't test it properly. I couldn't find any new commits on your mono branch to review either.

@Stanzilla @Feniz maybe you can confirm that HTTPS is working fine (Just try any jackett indexer with a HTTPS URL)? Or did you import the certificates manually?

Feniz commented 6 years ago

I tested The Pirate Bay indexer, which is an https, the test is fine. I just added the indexer from the list of the configured ones. Is that enough? I'm not such a big expert, if you need specific verification let me know.

kaso17 commented 6 years ago

Unless you manually executed a cert-sync command earlier it seems like it's working.

Feniz commented 6 years ago

I did not execute manual commands, that is sure :-)

m4tt075 commented 6 years ago

OK, I will cross-compile for all architectures and see whether that works. If it does, I will PR the update against master. But keep sending test package requests, keep testing and report back, so that we gain sufficient certainty that the updated package is reliable.

Kilay commented 6 years ago

I manually updated to your version (on DS413j - arch 88f628x) and even if it said that update failed, Mono was updated to version 5.8.0.22-9. Jackett is working great now, even with --debug parameter. It works on https indexers too (tried elite-tracker and yggtorrent).

Thank you for your time.

m4tt075 commented 6 years ago

@Kilay Thanks for the feedback. Any kind of indications, why it said the update failed? And could you let me know what firmware you are running?

jasonmotec commented 6 years ago

I am also after the latest Mono for my Synology! I have a DS116, with the Marvell ARMADA 385 1.8 GHz processor (armada38x) on DSM 6.1.4

Kindly compile a version of the latest Mono for me, so that I am able to use Jackett - its currently crashing for me, and I am using a very old version of Mono

HinksUK commented 6 years ago

DS416j here with MARVELL Armada 388 88F6828 looking for an update package for Mono. @m4tt075 are you able to create one for me please?

Thanks

Safihre commented 6 years ago

I updated my TravisCI automated building script to also be able to build DSM6 packages for all supported toolchains and automatically put them online as a GitHub release for distribution. All DSM 6.1 builds for mono will appear here, after they are done compiling here. Link removed as the package did not work

@m4tt075 I can give you access to my repo if you would like? Any new git tag will automatically be build for all available toolchains and the script is super simple to update to build other packages (DSM6.1 or DSM5.2). Or you can make your own TravisCI setup of course šŸ‘

Stanzilla commented 6 years ago

Would [v2.0.0.5059] System.NotSupportedException: HttpCurl method HEAD not supported in Sonarr be a hint to there being a problem with your Mono package or unrelated?

u35tniyh commented 6 years ago

@Safihre, I tried mono_evansport-6.1_5.8.0.22-9.spk for my DS415play (I think that's the correct package?), running DSM 6.1.3-15152 Update 8 and Jackett 0.8.402. When I attempt to search for an update, I get this error:

2017-11-19 18:52:45.6976 Debug IWebClient.GetString(Url:https://api.github.com/repos/Jackett/Jackett/releases) 2017-11-19 18:52:48.8590 Error Error checking for updates. System.Net.Http.HttpRequestException: An error occurred while sending the request ---> System.Net.WebException: Error: SecureChannelFailure (One or more errors occurred.) ---> System.AggregateException: One or more errors occurred. ---> System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> System.DllNotFoundException: /volume1/@appstore/mono/lib/../lib/libmono-btls-shared.so at (wrapper managed-to-native) Mono.Btls.MonoBtlsSslCtx.mono_btls_ssl_ctx_new() at Mono.Btls.MonoBtlsSslCtx..ctor () [0x00000] in /spksrc/native/mono/work-native/mono-5.8.0.22/mcs/class/System/Mono.Btls/MonoBtlsSslCtx.cs:103 at Mono.Btls.MonoBtlsContext.InitializeConnection () [0x00000] in /spksrc/native/mono/work-native/mono-5.8.0.22/mcs/class/System/Mono.Btls/MonoBtlsContext.cs:223 at Mono.Btls.MonoBtlsContext.StartHandshake () [0x00000] in /spksrc/native/mono/work-native/mono-5.8.0.22/mcs/class/System/Mono.Btls/MonoBtlsContext.cs:128 at Mono.Net.Security.MobileAuthenticatedStream.ProcessHandshake (Mono.Net.Security.AsyncOperationStatus status) [0x00014] in /spksrc/native/mono/work-native/mono-5.8.0.22/mcs/class/System/Mono.Net.Security/MobileAuthenticatedStream.cs:603 at (wrapper remoting-invoke-with-check) Mono.Net.Security.MobileAuthenticatedStream.ProcessHandshake(Mono.Net.Security.AsyncOperationStatus) at Mono.Net.Security.AsyncHandshakeRequest.Run (Mono.Net.Security.AsyncOperationStatus status) [0x00000] in /spksrc/native/mono/work-native/mono-5.8.0.22/mcs/class/System/Mono.Net.Security/AsyncProtocolRequest.cs:283 at Mono.Net.Security.AsyncProtocolRequest+d__24.MoveNext () [0x000ff] in /spksrc/native/mono/work-native/mono-5.8.0.22/mcs/class/System/Mono.Net.Security/AsyncProtocolRequest.cs:221

Safihre commented 6 years ago

The libmono-btls-shared.so seems to be possibly platform dependent: https://github.com/Jackett/Jackett/issues/1123 Although that post seems to suggest newer Jacket's should ignore it and switch to libcurl. Not really sure what the problem is.

jasonmotec commented 6 years ago

I have the exact same error as @silentmiles on my DS116, with the Marvell ARMADA 385 (armada38x) on DSM 6.1.4 Downloaded and installed, appears to be working - but update will not work on Jackett 0.7.1483.0 (I am still stuck on this version and cannot move forward)

Safihre commented 6 years ago

Links removed, packages did not function

jasonmotec commented 6 years ago

Thanks @Safihre - can you also kindly upload a version for the armada 38x as well

jasonmotec commented 6 years ago

@Safihre I have tried the second link you provided above ("Possibly together with new 6.1 Jackett package") - installed it, and it would not start Jackett when I attempted to install over the existing Jackett 0.7.1483.0 - I uninstalled it and attempted to install the version you provided from the second link above (to suit my version - 38x), it won't install... then attempted to install Jackett from the Synology store (the initial 0.7.1483.0) and then your version straight after, and got 'fail to update' error message

u35tniyh commented 6 years ago

Hi @Safihre. I tried the new mono build and am still receiving the same error on update. I assume this is the actual error?

System.DllNotFoundException: /volume1/@appstore/mono/lib/../lib/libmono-btls-shared.so

What's strange is that I checked and can confirm that the above path does exist.

Kilay commented 6 years ago

@m4tt075 My Synology is a DS413j (CPU Model : Marvell Kirkwood 88F6282 - Package Arch : 88f628x) on DSM 6.1.4-15217 Update 1. I don't have a clue for this message, myabe you can direct me to some logs (via ssh) in order to help you ?

jasonmotec commented 6 years ago

Hi @Safihre I experience the same result as @silentmiles with my DS116, with the Marvell ARMADA 385 (armada38x) on DSM 6.1.4

Safihre commented 6 years ago

I have removed the links as they are clearly not resulting in a functional package. I only was optimizing the TravisCI pipeline and don't really know enough about mono to say what is the problem. If @m4tt075 find the possible cause of the problem I will gladly compile again, if desired šŸ‘

m4tt075 commented 6 years ago

@kaso17 You were right. The library was missing from the PLIST file. I have added it back in again. @Safihre It would be great if you could trigger another round of test builds including my latest commit. Might fix the problem.

Stanzilla commented 6 years ago

Just to make sure, my [v2.0.0.5059] System.NotSupportedException: HttpCurl method HEAD not supported from Sonarr is not related, right?

Safihre commented 6 years ago

Build started, they will start showing up here.

EDIT: @m4tt075 the build fails for some platforms with No such file or directory errors at the end, maybe you know why?

m4tt075 commented 6 years ago

@Safihre Thanks for building. Most architectures are fine with the fix, surprisingly even hi3535 builds. However, the fix breaks 88f6281, which is an ARM5 platform.

Everybody, who is not on ARM5, could you retest with @Safihre 's builds above and report back again, please (including the architecture and firmware version you have tested)?

@kaso17 From some quick search on the intternet, it seems you have encountered this problem with ARM5 platforms before. Can you fix this upstream? If not, I'd probably just add that platform as unsupported.

stefan0028 commented 6 years ago

@Safihre good day is the build also working for Synology DS216 PlaY ?

Safihre commented 6 years ago

@stefan0028 try the monaco package.

stefan0028 commented 6 years ago

@Safihre i did the monaco package and it work i was enable to install mono. but i have a issu with Jackett now i can not updated it and it gives this error

Test failed for torrentz2: An error occurred while sending the request: Error: TrustFailure (One or more errors occurred.)

kaso17 commented 6 years ago

@m4tt075 I've never tried to compile mono on ARM. From what I know BTLS hasn't been tested on ARM platforms except on Android. there was a bug that when running the cert-sync utility it crashed on some raspberry pi environments which compiled mono without BTLS support with the boring-tls.so missing error because the utility expected that BTLS is always included. that has been fixed a while ago. Unfortunately using mono without BTLS makes it very useless as the legacy TLS implementation only supports very old crypto/TLS standards which doesn't work anymore with webservers, etc. following best practices regarding TLS configuration. The mono team decided to add BTLS as new standard TLS implementation with mono 4.8. I can confirm that the first packages provided by you via dropbox don't included working BTLS support either (@Feniz: thank you for testing). Most .NET cross platform programs decided to add a fallback to libcurl on linux for mono version without BTLS support instead of using the .NET standard HttpClient implementation (@Stanzilla: The "HttpCurl method HEAD not supported" is caused by this libcurl fallback mechanism in Sonarr and just indicates that the mono version doesn't support BTLS).

Unfortunately the build logs seem to be incomplete, e.g. the complete output of the configure output is missing, at the end it should look like this (indication BTLS support status):

        mcs source:    mcs
        C# Compiler:   roslyn

   Engine:
        Host:          x86_64-pc-linux-gnu
        Target:        x86_64-pc-linux-gnu
        GC:            sgen (concurrent by default) and Included Boehm GC with typed GC and parallel mark
        TLS:           __thread
        SIGALTSTACK:   no
        Engine:        Building and using the JIT
        BigArrays:     no
        DTrace:        no
        LLVM Back End: no (dynamically loaded: no)

   Libraries:
        .NET 4.x:        yes
        Xamarin.Android: no
        Xamarin.iOS:     no
        Xamarin.WatchOS: no
        Xamarin.TVOS:    no
        Xamarin.Mac:     no
        Windows AOT:     no
        Orbis:           no
        Unreal:          no
        WebAssembly:     no
        Test profiles:   AOT Full (no), AOT Hybrid (no)
        JNI support:     IKVM Native
        libgdiplus:      assumed to be installed
        zlib:            system zlib
        BTLS:            yes (x86_64)

@m4tt075 @Safihre do you know where I can find the complete build log?

@Feniz @Stanzilla can you try the packages provided by @Safihre from https://github.com/Safihre/spksrc/releases/tag/mono-2-dsm61 and check if BTLS is working?

I've build a small tool to test it:

Can you please try downloading this file to the NAS: https://www.file-upload.net/download-12824822/MonoBTLSTest.exe.html

And then try to run the following commands and post the output?:

/volume1/@appstore/mono/bin/mono .../MonoBTLSTest.exe
MONO_TLS_PROVIDER=btls /volume1/@appstore/mono/bin/mono .../MonoBTLSTest.exe
MONO_TLS_PROVIDER=legacy /volume1/@appstore/mono/bin/mono .../MonoBTLSTest.exe
kaso17 commented 6 years ago

@stefan0028 can you please share the following lines from the error message? Or try the MonoBTLSTest.exe from by previous post?

m4tt075 commented 6 years ago

@Safihre On the failed builds:

@kaso17 Here the configure output from the x86 build I have just created

        mcs source:    mcs
    C# Compiler:   roslyn

   Engine:
    Host:          x86_64-unknown-linux-gnu
    Target:        x86_64-unknown-linux-gnu
    GC:        sgen (concurrent by default) and Included Boehm GC with typed GC and parallel mark
    TLS:           __thread
    SIGALTSTACK:   yes
    Engine:        Building and using the JIT
    BigArrays:     no
    DTrace:        no
    LLVM Back End: no (dynamically loaded: no)
    Interpreter:   no

   Libraries:
    .NET 4.x:        yes
    Xamarin.Android: no
    Xamarin.iOS:     no
    Xamarin.WatchOS: no
    Xamarin.TVOS:    no
    Xamarin.Mac:     no
    Windows AOT:     no
    Orbis:           no
    Unreal:          no
    Test profiles:   AOT Full (no), AOT Hybrid (no)
    JNI support:     IKVM Native
    libgdiplus:      assumed to be installed
    zlib:            system zlib
    BTLS:            yes (x86_64)
Stanzilla commented 6 years ago

I'd need a Marvell Kirkwood ARMv5TE 88F6282 build from @Safihre then I can test.

m4tt075 commented 6 years ago

@Stanzilla We have just cross-posted. Unfortunately we are not able to build an ARM5 version with btls support. I could give you a version without btls support, but according to @kaso17 the usability would be severely limited. Maybe somebody else is able to tweak the package and make it possible. Unfortunately, I'm not. Sorry...

Stanzilla commented 6 years ago

Hrm okay, makes sense. No worries.

stefan0028 commented 6 years ago

@kaso17

jackett