mitchcapper / CefSharpDockerfiles

Automated chrome cef building and cefsharp building with docker and build scripts
34 stars 10 forks source link

consistent nuget restore error in cefsharp_set_versions_and_restore.ps1 #12

Open tuarua opened 3 years ago

tuarua commented 3 years ago

Many thanks for providing this repo. I have successfully used it to build CefSharp 83 12 months ago.

However now I am consistently getting the following error when building via azure. I am using recommended Standard_F32s_v2 (Windows Server 1903)

Step 18/21 : RUN ./cefsharp_set_versions_and_restore.ps1
 ---> Running in 369e6974d2e3

SUCCESS: Specified value was saved.
doing C:\code\cefsharp\CefSharp\CefSharp.csproj
doing C:\code\cefsharp\CefSharp\CefSharp.netcore.csproj
doing C:\code\cefsharp\CefSharp.Core\CefSharp.Core.csproj
doing C:\code\cefsharp\CefSharp.Core\CefSharp.Core.netcore.csproj
doing C:\code\cefsharp\CefSharp.Example\CefSharp.Example.csproj
doing C:\code\cefsharp\CefSharp.Example\CefSharp.Example.netcore.csproj
doing C:\code\cefsharp\CefSharp.OffScreen\CefSharp.OffScreen.csproj
doing C:\code\cefsharp\CefSharp.OffScreen\CefSharp.OffScreen.netcore.csproj
doing C:\code\cefsharp\CefSharp.OffScreen.Example\CefSharp.OffScreen.Example.csproj
Updated C:\code\cefsharp\CefSharp.OffScreen.Example\CefSharp.OffScreen.Example.csproj
doing C:\code\cefsharp\CefSharp.OffScreen.Example\CefSharp.OffScreen.Example.netcore.csproj
doing C:\code\cefsharp\CefSharp.Test\CefSharp.Test.csproj
Updated C:\code\cefsharp\CefSharp.Test\CefSharp.Test.csproj
doing C:\code\cefsharp\CefSharp.Test\CefSharp.Test.netcore.csproj
doing C:\code\cefsharp\CefSharp.WinForms\CefSharp.WinForms.csproj
doing C:\code\cefsharp\CefSharp.WinForms\CefSharp.WinForms.netcore.csproj
doing C:\code\cefsharp\CefSharp.WinForms.Example\CefSharp.WinForms.Example.csproj
Updated C:\code\cefsharp\CefSharp.WinForms.Example\CefSharp.WinForms.Example.csproj
doing C:\code\cefsharp\CefSharp.WinForms.Example\CefSharp.WinForms.Example.netcore.csproj
doing C:\code\cefsharp\CefSharp.Wpf\CefSharp.Wpf.csproj
doing C:\code\cefsharp\CefSharp.Wpf\CefSharp.Wpf.netcore.csproj
doing C:\code\cefsharp\CefSharp.Wpf.Example\CefSharp.Wpf.Example.csproj
Updated C:\code\cefsharp\CefSharp.Wpf.Example\CefSharp.Wpf.Example.csproj
doing C:\code\cefsharp\CefSharp.Wpf.Example\CefSharp.Wpf.Example.netcore.csproj
restore failed running 'C:\code\cefsharp\.\nuget\NuGet.exe restore -source
"C:/code/cef-binary/cef-binary-master/NuGet" -FallbackSource
https://api.nuget.org/v3/index.json CefSharp3.sln' with exit code 0x1
At C:\code\cefsharp\cefsharp_set_versions_and_restore.ps1:98 char:2
+     throw ("restore failed running '$nuget $args' with exit code 0x$r ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (restore failed ...h exit code
    0x1:String) [], RuntimeException
    + FullyQualifiedErrorId : restore failed running 'C:\code\cefsharp\.\nuget
   \NuGet.exe restore -source "C:/code/cef-binary/cef-binary-master/NuGet" -F
  allbackSource https://api.nuget.org/v3/index.json CefSharp3.sln' with exit
  code 0x1

The command 'powershell -Command $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; ./cefsharp_set_versions_and_restore.ps1' returned a non-zero code: 1
Caught an exception: Process docker build --memory=30g --build-arg CEFSHARP_BRANCH="cefsharp/93" --build-arg CEFSHARP_VERSION="93.1.140" --build-arg CEF_VERSION_STR="auto" --build-arg CHROME_BRANCH="4577" -f Dockerfile_cefsharp -t cefsharp . exited with non zero code: 1 aborting!
        Exception Type: System.Management.Automation.RuntimeException
        Stack Trace: at RunProc, C:\CefSharpDockerfiles\functions.ps1: line 82
        at <ScriptBlock>, C:\CefSharpDockerfiles\build.ps1: line 96
        at <ScriptBlock>, <No file>: line 1

from az_create.ps1

[CmdletBinding()]
Param(
    [Parameter(Mandatory=$true)]
    [PSCredential] $admin_creds,
    [String] $shutdown_email,
    [String] $RESOURCE_GROUP="CEFTest",
    [String] $LOCATION="West Europe",
    [String] $MACHINE_SIZE="Standard_F32s_v2",
    [String] $SHUTDOWN_TIME="04:30",
    [String] $RANDOM_STR=""
)
...

from versions_src.ps1

$VAR_CHROME_BRANCH="4606";
$VAR_CEFSHARP_VERSION="94.4.110";
$VAR_CEFSHARP_BRANCH="cefsharp/94";
$VAR_BASE_DOCKER_FILE="mcr.microsoft.com/windows/servercore:1903-amd64";#mcr.microsoft.com/windows/servercore:1903-amd64
$VAR_DUAL_BUILD="0"; #set to 1 to build all arches together, mainly to speed up linking which is single threaded, note may need excess ram.
$VAR_BUILD_ARCHES="x86 x64";
$VAR_GN_DEFINES="is_official_build=true proprietary_codecs=true ffmpeg_branding=Chrome";
$VAR_CEF_BUILD_MOUNT_VOL_NAME=""; #force using this volume for building, allows resuming MUST BE LOWER CASE
$VAR_GN_ARGUMENTS="--ide=vs2019 --sln=cef --filters=//cef/*";
$VAR_GYP_DEFINES="";
$VAR_CEF_BUILD_ONLY=$false;#Only build CEF do not build cefsharp or the cef-binary.
$VAR_CEF_USE_BINARY_PATH=""; #If you want to use existing CEF binaries point this to a local folder where the cef_binary*.zip files are. It will skip the long CEF build step then but still must make the VS container for the cefsharp building.  Note will copy a dockerfile into this folder.
$VAR_REMOVE_VOLUME_ON_SUCCESSFUL_BUILD=$true;
$VAR_CEF_BINARY_EXT="zip"; #Can be zip,tar.bz2, 7z Generally do not change this off of Zip unless you are supplying your own binaries using $VAR_CEF_USE_BINARY_PATH above, and they have a different extension, will try to work with the other formats however
$VAR_CEF_SAVE_SOURCES="0"; #normally sources are deleted before finishing the CEF build step.  Set to 1 to create a /code/sources.zip archive that has them (note it is left in docker image, must use docker cp to copy it out, it is also around 30GB).
$VAR_CEF_VERSION_STR="auto"; #can set to "3.3239.1723" or similar if you have multiple binaries that Docker_cefsharp might find
$VAR_HYPERV_MEMORY_ADD="--memory=30g"; #only matters if using HyperV, Note your swap file alone must be this big or able to grow to be this big, 30G is fairly safe for single build will need 60G for dual build.

I have tried running build 5 times and each time it fails on the above step. It gives the same error when trying CefSharp 93 It looks like CEF is successfully built.

I have attached a fuller log which includes a larger tail of logging. cefsharp_error.txt

mitchcapper commented 3 years ago

Sorry I have built through 95 now with it. I will commit up the changes this week.

tuarua commented 2 years ago

Hi, if you are able to update GH with your latest changes that would be greatly appreciated.