Jump to content


Photo

Cannot build 3.1.1 in docker container anymore.

linux docker build

Best Answer scr09 , 25 December 2016 - 03:05 AM

I fixed my error and successfully compiled by commenting this in the build script

#mono Nuget/nuget.exe restore MediaBrowser.Mono.sln

and installing referenceassemblies-pcl

apt-get install referenceassemblies-pcl
Go to the full post


  • Please log in to reply
8 replies to this topic

#1 toneman77 OFFLINE  

toneman77

    Newbie

  • Members
  • 6 posts
  • Local time: 06:35 AM

Posted 23 December 2016 - 12:21 PM

Hey guys.

When trying to build emby-server in a docker container, the following worked untill 3.0.8500:

sudo apt-get install -y --no-install-recommends \                                                             
    ca-certificates \                                                                                         
    git \                                                                                                     
    libmono-system-core4.0-cil \                                                                              
    mono-devel  \                                                                                             
    mono-runtime  \                                                                                           
    mono-utils  \                                                                                             
    mono-xbuild \                                                                                             
    wget                                                                                                      
cd $HOME \                                                                                                    
    && git clone --depth 1 https://github.com/MediaBrowser/Emby.git

I then change to Tools/Linux_Build_Scripts/ and launch MediaBrowser.Mono.Build.sh

 

But since 3.1.1 (I must have missed 3.1.0) I get:

...

========================================
           Requirements
========================================
           
Check if folder mediabrowser exist
Creating folder: mediabrowser
                       
========================================
       Nuget: Restoring packages
========================================
                                           
Restoring NuGet package                         
MSBuild auto-detection: using msbuild version '4.0' from '/usr/lib/mono/4.5'.
MsBuild.exe does not exist at '/usr/lib/mono/4.5/msbuild.exe'.

Result is the same, no matter if I use a debian docker or ubuntu.

What did I do wrong? Anything I am missing here?

 



#2 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 156655 posts
  • Local time: 12:35 AM

Posted 23 December 2016 - 12:25 PM

Hi, why not just follow the Docker instructions from the website?



#3 toneman77 OFFLINE  

toneman77

    Newbie

  • Members
  • 6 posts
  • Local time: 06:35 AM

Posted 23 December 2016 - 12:42 PM

Hi. you mean this: https://github.com/M...Getting-Started ?

That only builds a docker container with an already installed emby in it. I like building stuff and mostly for the sake of learning, that's why I build some packages myself.



#4 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 156655 posts
  • Local time: 12:35 AM

Posted 23 December 2016 - 01:07 PM

I see. Make sure you have mono 4.6. You will need that in order to build now.



#5 toneman77 OFFLINE  

toneman77

    Newbie

  • Members
  • 6 posts
  • Local time: 06:35 AM

Posted 24 December 2016 - 11:35 AM

I adjusted the instructions at github and used 4.6.2 as the version. Installed all the prerequisites. Sadly, still the same error.

I then searched around more and found this error stating that the wrong version of nuget ignores the correct path to xbuild and looks for msbuild.exe. This issue is fixed if I understood everything correctly with nuget 3.5 upstream. So I downloaded the current release from here and placed it in the NuGet folder.

 

And now I get this error:

========================================
           Requirements
========================================
           
Check if folder mediabrowser exist
mediabrowser exist, checking for old binaries folder
                     
========================================
       Nuget: Restoring packages
========================================
                                             
Restoring NuGet package                                    
MSBuild auto-detection: using msbuild version '14.0' from '/usr/lib/mono/xbuild/14.0/bin'.
MSBUILD: error MSBUILD0005: Invalid syntax. Property name and value expected as <prop name>=[<prop value>]

Ok, well. The line in the MediaBrowser.Mono.Build.sh script that triggers the error is:

mono Nuget/nuget.exe restore MediaBrowser.Mono.sln

So i searched around and found out that nuget can be more verbose, so I changed into the main Emby folder and executed: (also tried to add verbosity in the script itself. result is the same)

~/Emby# mono Nuget/nuget.exe restore MediaBrowser.Mono.sln -Verbosity detailed
and the result was:
NuGet Version: 3.5.0.1938
MSBuild auto-detection: using msbuild version '14.0' from '/usr/lib/mono/xbuild/14.0/bin'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild.
MSBuild P2P timeout [ms]: 120000
MSBUILD: error MSBUILD0005: Invalid syntax. Property name and value expected as <prop name>=[<prop value>]
System.AggregateException: One or more errors occurred. ---> NuGet.CommandLine.CommandLineException
  at NuGet.CommandLine.MsBuildUtility.GetProjectReferences (System.String msbuildDirectory, System.String[] projectPaths, System.Int32 timeOut) [0x0023a] in <eca5fa3af2c04391bafa6fe58e194074>:0 
  at NuGet.CommandLine.RestoreCommand.DetermineRestoreInputs () [0x00114] in <eca5fa3af2c04391bafa6fe58e194074>:0 
  at NuGet.CommandLine.RestoreCommand+<ExecuteCommandAsync>d__22.MoveNext () [0x000c5] in <eca5fa3af2c04391bafa6fe58e194074>:0                       
   --- End of inner exception stack trace ---
  at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00014] in <8f2c484307284b51944a1a13a14c0266>:0   
  at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00052] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Threading.Tasks.Task.Wait () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0 
  at NuGet.CommandLine.Command.Execute () [0x000bd] in <eca5fa3af2c04391bafa6fe58e194074>:0 
  at NuGet.CommandLine.Program.MainCore (System.String workingDirectory, System.String[] args) [0x001f8] in <eca5fa3af2c04391bafa6fe58e194074>:0                        
---> (Inner Exception #0) NuGet.CommandLine.CommandLineException
  at NuGet.CommandLine.MsBuildUtility.GetProjectReferences (System.String msbuildDirectory, System.String[] projectPaths, System.Int32 timeOut) [0x0023a] in <eca5fa3af2c04391bafa6fe58e194074>:0 
  at NuGet.CommandLine.RestoreCommand.DetermineRestoreInputs () [0x00114] in <eca5fa3af2c04391bafa6fe58e194074>:0 
  at NuGet.CommandLine.RestoreCommand+<ExecuteCommandAsync>d__22.MoveNext () [0x000c5] in <eca5fa3af2c04391bafa6fe58e194074>:0 <---

And now after 2h of searching, I'm lost...



#6 scr09 OFFLINE  

scr09

    Newbie

  • Members
  • 2 posts
  • Local time: 04:35 AM

Posted 24 December 2016 - 10:13 PM

I have the same error trying to build Emby with the same instructions on Ubuntu (not for docker). mono is at version 4.6.2.


  • toneman77 likes this

#7 scr09 OFFLINE  

scr09

    Newbie

  • Members
  • 2 posts
  • Local time: 04:35 AM

Posted 25 December 2016 - 03:05 AM   Best Answer

I fixed my error and successfully compiled by commenting this in the build script

#mono Nuget/nuget.exe restore MediaBrowser.Mono.sln

and installing referenceassemblies-pcl

apt-get install referenceassemblies-pcl

  • toneman77 likes this

#8 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 156655 posts
  • Local time: 12:35 AM

Posted 25 December 2016 - 03:57 PM

Thanks for reporting back !



#9 toneman77 OFFLINE  

toneman77

    Newbie

  • Members
  • 6 posts
  • Local time: 06:35 AM

Posted 25 December 2016 - 05:16 PM

Well at first I had some major problems because I build on debian, but run on alpine linux. Then I changed to tklx (smaller debian) but that didn't work out either. After using debian:wheezy in my Dockerfile, everything ran. Thanks a lot.

The one thing I had to do manually is make a symbolic link:

ln -s /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 /usr/lib/libsqlite3.so

or else emby crashed on start. @scr09: did your build run without manual intervention?

 

Out of interest: What does "...nuget restore..." and why is it not neccesary?

@scr09: you are my hero (emby devs/admins are heroes anyways)

 

@Luke: Somebody should update the instructions @github, in case someone else tries to build versions higher than 3.0.xxxx

 

Thanks a lot guys


Edited by toneman77, 26 December 2016 - 07:28 AM.






Also tagged with one or more of these keywords: linux, docker, build

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users