joshuaboniface / Emby

A (hard) fork of the Emby media browser project - OBSOLETE - see jellyfin/jellyfin
GNU General Public License v2.0
40 stars 4 forks source link

Building with Mono fails for 3.4 and 3.3 releases #1

Closed joshuaboniface closed 6 years ago

joshuaboniface commented 6 years ago

Trying to build the repo versions of both 3.4.1.18 and 3.3.1.27 result in the same strange error during dh_clideps:

       Looking for ntdll.dll at ntdll.dll                                                                                                                                                                          Looking for libntdll.dll.so at libntdll.dll.so
dh_clideps: Error: Could not resolve moduleref: ntdll.dll for: System.Runtime.InteropServices.RuntimeInformation.dll!
        Ignoring moduleref kernel32.dll (case insensitive)
        running CLI parser command: LANG=C MONO_PATH= MONO_GAC_PREFIX=  MONO_GAC_PREFIX=$MONO_GAC_PREFIX:debian/emby-server/usr /usr/bin/ikdasm --assemblyref System.Runtime.InteropServices.RuntimeInformat
ion.dll 2>&1 > /tmp/dh_clideps.pZhi

[...]

dh_clideps: Error: unresolvable module references or missing shlibs entries, please check above errors!
debian/rules:34: recipe for target 'override_dh_clideps' failed
make[1]: *** [override_dh_clideps] Error 255
make[1]: Leaving directory '/srv/build/emby/Emby'
debian/rules:6: recipe for target 'binary' failed
make: *** [binary] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2

However building the version of 3.3.1 from the OpenSuse repo by Carlos Hernandez (https://download.opensuse.org/repositories/home:/emby/Debian_9.0/) works flawlessly.

dh_clideps: Error: Could not resolve moduleref: ntdll.dll for: System.Runtime.InteropServices.RuntimeInformation.dll! seems to be the operative line here, but from what I can gather this error has never been encountered before (nothing useful on the Google), so I'm working via trial-and-error. However, it looks like ultimately the problem is that "System.Runtime.InteropServices.RuntimeInformation.dll" isn't referenced anywhere in that repo, so there must be a change of some kind to eliminate this DLL.

It's worth noting that, so far, aside from this issue which occurs late in the build, using msbuild instead of xbuild from Mono 5.14 seems to work OK so far and successfully build from the repo.

joshuaboniface commented 6 years ago

This ended up being pretty easy to solve - using --exclude-moduleref=ntdll.dll in the dh_clideps section of the rules file allowed it to build successfully with Mono 5.14.