Skip to content

Commit

Permalink
Building through v81 added along with new build through volumes scheme.
Browse files Browse the repository at this point in the history
Switch to volumes for storing source during build (faster commit times, resume support, and microsoft/hcsshim#708 bug work around).
To resume see Readme by default will not resume builds.
Moved to vs2019 support for compiling (needs cef patch cef_patch_find_vs2019_tools.diff from sample_patches)
  • Loading branch information
mitchcapper committed Apr 3, 2020
1 parent c67f9fe commit 3e8f2b7
Show file tree
Hide file tree
Showing 13 changed files with 121 additions and 74 deletions.
4 changes: 2 additions & 2 deletions AzureTemplateFile.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@
},
"imageReference": {
"publisher": "MicrosoftWindowsServer",
"offer": "WindowsServerSemiAnnual",
"sku": "Datacenter-Core-1809-with-Containers-smalldisk",
"offer": "WindowsServer",
"sku": "Datacenter-Core-1903-with-Containers-smalldisk",
"version": "latest"
}
},
Expand Down
11 changes: 7 additions & 4 deletions Dockerfile_cef
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@ RUN Invoke-WebRequest 'https://storage.googleapis.com/chrome-infra/depot_tools.z
RUN Expand-Archive C:/code/depot_tools.zip -DestinationPath "C:/code/depot_tools";
RUN $env:Path = 'c:/code/depot_tools/;' + $env:Path;setx /M PATH $env:Path;
ARG GN_DEFINES="is_debug=false"
ARG GN_ARGUMENTS="--ide=vs2019 --sln=cef --filters=//cef/*"
ENV DEPOT_TOOLS_WIN_TOOLCHAIN 0
ENV CEF_USE_GN 1
ENV GYP_MSVS_VERSION 2017
ENV GYP_MSVS_VERSION 2019
ARG DUAL_BUILD="0"
ARG BINARY_EXT="zip"
ARG GYP_DEFINES="target_arch=x64 "
RUN setX /M DEPOT_TOOLS_WIN_TOOLCHAIN 0;setX /M GYP_MSVS_VERSION 2017;setx /M GN_DEFINES "$env:GN_DEFINES";setx /M GYP_DEFINES "$env:GYP_DEFINES";setx /M DUAL_BUILD "$env:DUAL_BUILD";
ARG CEF_SAVE_SOURCES
ARG CHROME_BRANCH=3239
RUN setX /M DEPOT_TOOLS_WIN_TOOLCHAIN 0;setX /M GYP_MSVS_VERSION "$env:GN_DEFINES";setx /M GN_DEFINES "$env:GN_DEFINES";setx /M GN_ARGUMENTS "$env:GN_ARGUMENTS";setx /M GYP_DEFINES "$env:GYP_DEFINES";setx /M DUAL_BUILD "$env:DUAL_BUILD";setx /M BINARY_EXT "$env:BINARY_EXT";setx /M CEF_SAVE_SOURCES "$env:CEF_SAVE_SOURCES";setx /M CHROME_BRANCH "$env:CHROME_BRANCH";

ADD https://bitbucket.org/chromiumembedded/cef/raw/master/tools/automate/automate-git.py c:/code/automate/
RUN cd c:/code/depot_tools/;update_depot_tools.bat;git checkout .\cipd.ps1;update_depot_tools.bat;

ADD functions.ps1 cef_build.ps1 cef_patch.ps1 cef_patch_*.diff c:/code/
# Comment out the next step if you want to do it by hand, make sure to change the build args to env options like:
# -e DUAL_BUILD="0" -e GN_DEFINES="is_official_build=true proprietary_codecs=true ffmpeg_branding=Chrome" -e GYP_DEFINES="" -e CHROME_BRANCH="3396"
ARG CEF_SAVE_SOURCES
RUN c:/code/cef_build.ps1
#RUN c:/code/cef_build.ps1
CMD ["powershell", "c:/code/cef_build.ps1"]
5 changes: 3 additions & 2 deletions Dockerfile_cef_binary
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref
RUN [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12;Invoke-WebRequest 'https://github.com/cefsharp/cef-binary/archive/master.zip' -OutFile '/code/master.zip';
RUN Expand-Archive c:\code\master.zip -DestinationPath "C:\code\cef-binary";
WORKDIR /code/cef-binary/cef-binary-master/
RUN $env:Path = 'c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\;' + $env:Path;setx /M PATH $env:Path;
RUN $env:Path = 'c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\;' + $env:Path;setx /M PATH $env:Path;
RUN 'New-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0 -Name VCTargetsPath -PropertyType String -Value "`$`(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\"'
ARG BINARY_EXT="zip"
RUN ./build.ps1 -DownloadBinary local -CefBinaryDir /code/binaries/ -CefVersion auto -NoDebugBuild -Extension $env:BINARY_EXT -Target vs2017;./build.ps1 -DownloadBinary local -CefBinaryDir /code/binaries/ -CefVersion auto -NoDebugBuild -Extension $env:BINARY_EXT -Target nupkg-only;
#ADD tmp_cef_bin_build.ps1 /code/cef-binary/cef-binary-master/build.ps1
RUN ./build.ps1 -Verbose -DownloadBinary local -CefBinaryDir /code/binaries/ -CefVersion auto -NoDebugBuild -Extension $env:BINARY_EXT -Target vs2019;./build.ps1 -DownloadBinary local -CefBinaryDir /code/binaries/ -CefVersion auto -NoDebugBuild -Extension $env:BINARY_EXT -Target nupkg-only;
RUN Compress-Archive -Path NuGet -CompressionLevel Fastest -DestinationPath C:\packages
5 changes: 2 additions & 3 deletions Dockerfile_cefsharp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ ARG CEF_VERSION_STR=auto
ARG CHROME_BRANCH=3239
ENV PACKAGE_SOURCE C:/code/cef-binary/cef-binary-master/NuGet

#This next line is not used just skipped as a check at this point
ENV VS141COMNTOOLS C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build
ADD cefsharp_patch_*.diff cefsharp_set_versions_and_restore.ps1 functions.ps1 cefsharp_patch.ps1 c:/code/cefsharp/
RUN ./cefsharp_patch.ps1
RUN ./cefsharp_set_versions_and_restore.ps1
RUN [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12;./build.ps1 -Target vs2017 -Version $env:CEFSHARP_VERSION -AssemblyVersion $env:CEFSHARP_VERSION;
#ADD tmp_cefsharp_build.ps1 /code/cefsharp/build.ps1
RUN [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12;./build.ps1 -Verbose -Target vs2019 -Version $env:CEFSHARP_VERSION -AssemblyVersion $env:CEFSHARP_VERSION;
RUN cp $env:PACKAGE_SOURCE/*.nupkg C:/code/cefsharp/nuget/
RUN Compress-Archive -Path C:/code/cefsharp/nuget/*.nupkg -CompressionLevel Fastest -DestinationPath C:\packages_cefsharp
12 changes: 6 additions & 6 deletions Dockerfile_vs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARG BASE_DOCKER_FILE="mcr.microsoft.com/windows/servercore:1809-amd64"
ENV COMPLUS_NGenProtectedProcess_FeatureEnabled 0
ARG BASE_DOCKER_FILE="mcr.microsoft.com/windows/servercore:1903-amd64"
FROM $BASE_DOCKER_FILE
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

ENV COMPLUS_NGenProtectedProcess_FeatureEnabled 0
RUN mkdir c:\code\automate;mkdir c:\temp\;mkdir c:\code\depot_tools;
RUN Invoke-WebRequest 'https://aka.ms/vscollect.exe' -OutFile 'C:\TEMP\collect.exe';
RUN Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/v4.1.0/nuget.exe' -OutFile 'c:\code\depot_tools\;';
Expand All @@ -18,12 +18,12 @@ WORKDIR c:\\code\\depot_tools

#Not sure why the community installer doesn't instal the debugger with --all but all the same this is a quick fix.
RUN Invoke-WebRequest https://go.microsoft.com/fwlink/?linkid=864422 -OutFile 'C:\code\winsdksetup.exe';
RUN $p = Start-Process -Wait -PassThru -FilePath C:\code\winsdksetup.exe -ArgumentList ' /features OptionId.WindowsDesktopDebuggers /quiet /Log #"%TEMP%\\winsdksetup.log /norestart'; if (($ret = $p.ExitCode) -and ($ret -ne 3010)) { throw ('Install failed with exit code 0x{0:x}' -f $ret) }
RUN $p = Start-Process -Wait -PassThru -FilePath C:\code\winsdksetup.exe -ArgumentList ' /features OptionId.WindowsDesktopDebuggers /quiet /Log #"%TEMP%\\winsdksetup.log /norestart'; if (($ret = $p.ExitCode) -and ($ret -ne 3010)) { $log_path=$env:Temp; $err = 'Install ' + 'failed with exit code 0x{0:x} error logs in: ' + $log_path + '\winsdksetup.log'; throw ($err -f $ret) }


RUN Invoke-WebRequest 'https://aka.ms/vs/15/release/vs_community.exe' -OutFile 'C:\code\vs_community.exe';
RUN Invoke-WebRequest 'https://aka.ms/vs/16/release/vs_community.exe' -OutFile 'C:\code\vs_community.exe';

#3010 is fine, as that is just restart requested.
# https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community
# Some of these are more needed for cefsharp, especially the older sdks (win8.1 and 4.52). Note Microsoft.Net.Component.4.6.1.SDK is needed also for cefsharp to get mscoree for some reason the 4.7.1 version does not get found. The older CEF requirements add about 3GB (possibly more removes on the Win81SDK 4.5.2 targetting and 46.2 could cut down on this.
RUN $p = Start-Process -Wait -PassThru -FilePath C:\code\vs_community.exe -ArgumentList ' --quiet --wait --norestart --nocache --add Microsoft.Net.Component.4.7.1.SDK --add Microsoft.VisualStudio.Component.Windows10SDK --add Microsoft.Net.Component.4.6.1.SDK --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Win81 --add Microsoft.VisualStudio.Component.Windows81SDK --add Microsoft.Net.Component.4.5.2.TargetingPack --add Microsoft.Net.Component.4.6.2.TargetingPack --add Microsoft.Net.Component.4.6.2.SDK --add Microsoft.VisualStudio.Component.Windows10SDK.16299.Desktop --add Microsoft.VisualStudio.Component.Windows10SDK.17134 --add Microsoft.VisualStudio.Component.Git --add Microsoft.VisualStudio.Component.Windows10SDK.15063.Desktop --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.ATLMFC --includeRecommended --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 --remove Component.Android.NDK.R12B --remove Component.Android.SDK23.Private --remove Component.MDD.Android --remove Component.Unreal.Android --remove Component.Android.NDK.R15C --remove Component.Android.SDK19 --remove Component.Android.SDK22 --remove Component.Android.SDK23 --remove Component.Android.SDK25 --remove Component.MDD.Android --remove Component.Android.NDK.R12B --remove Component.Android.NDK.R12B_3264 --remove Component.Android.NDK.R13B --remove Component.Android.NDK.R13B_3264 --remove Component.Android.NDK.R15C_3264 --remove Component.Google.Android.Emulator.API23.V2 --remove Component.Android.SDK25 --remove Component.Google.Android.Emulator.API25 --remove Component.Android.SDK23.Private --remove Component.Google.Android.Emulator.API23.Private --remove Component.Android.Emulator --remove Component.Android.NDK.R11C --remove Component.Android.NDK.R11C_3264 --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 --remove Microsoft.VisualStudio.Component.Phone.Emulator.15254 --remove Microsoft.VisualStudio.Component.Phone.Emulator.15254 --remove Microsoft.VisualStudio.Component.Phone.Emulator --remove Microsoft.VisualStudio.Component.Phone.Emulator.15063 --remove Component.Anaconda3.x64 --remove Component.Anaconda2.x64 --remove Component.Anaconda2.x86 --remove Component.Anaconda3.x86 --remove Microsoft.VisualStudio.Component.Unity --remove Component.UnityEngine.x64 --remove Component.UnityEngine.x86 --remove Component.Incredibuild --remove Component.IncredibuildMenu --remove Microsoft.VisualStudio.Component.Sharepoint.Tools --remove Microsoft.VisualStudio.Component.TeamOffice --remove Component.Cocos;'; if (($ret = $p.ExitCode) -and ($ret -ne 3010)) { C:\TEMP\collect.exe; throw ('Install failed with exit code 0x{0:x}' -f $ret) }; Remove-Item -Recurse -Force 'c:\ProgramData\Package Cache\'
# Some of these are more needed for cefsharp like 4.5.2 and 4.6.2 (it uses both targets depending on project)
RUN $p = Start-Process -Wait -PassThru -FilePath C:\code\vs_community.exe -ArgumentList ' --quiet --wait --norestart --nocache --add Microsoft.Net.Component.4.7.2.SDK --add Microsoft.VisualStudio.Component.Windows10SDK --remove Microsoft.Net.Component.4.6.1.SDK --remove Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Win81 --remove Microsoft.VisualStudio.Component.Windows81SDK --add Microsoft.Net.Component.4.5.2.TargetingPack --add Microsoft.Net.Component.4.6.2.TargetingPack --add Microsoft.Net.Component.4.7.2.TargetingPack --add Microsoft.Net.Component.4.6.2.SDK --add Microsoft.VisualStudio.Component.Windows10SDK.18362 --remove Microsoft.VisualStudio.Component.Windows10SDK.16299.Desktop --remove Microsoft.VisualStudio.Component.Windows10SDK.17134 --add Microsoft.VisualStudio.Component.Git --remove Microsoft.VisualStudio.Component.Windows10SDK.15063.Desktop --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.ATLMFC --includeRecommended --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 --remove Component.Android.NDK.R12B --remove Component.Android.SDK23.Private --remove Component.MDD.Android --remove Component.Unreal.Android --remove Component.Android.NDK.R15C --remove Component.Android.SDK19 --remove Component.Android.SDK22 --remove Component.Android.SDK23 --remove Component.Android.SDK25 --remove Component.MDD.Android --remove Component.Android.NDK.R12B --remove Component.Android.NDK.R12B_3264 --remove Component.Android.NDK.R13B --remove Component.Android.NDK.R13B_3264 --remove Component.Android.NDK.R15C_3264 --remove Component.Google.Android.Emulator.API23.V2 --remove Component.Android.SDK25 --remove Component.Google.Android.Emulator.API25 --remove Component.Android.SDK23.Private --remove Component.Google.Android.Emulator.API23.Private --remove Component.Android.Emulator --remove Component.Android.NDK.R11C --remove Component.Android.NDK.R11C_3264 --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 --remove Microsoft.VisualStudio.Component.Phone.Emulator.15254 --remove Microsoft.VisualStudio.Component.Phone.Emulator.15254 --remove Microsoft.VisualStudio.Component.Phone.Emulator --remove Microsoft.VisualStudio.Component.Phone.Emulator.15063 --remove Component.Anaconda3.x64 --remove Component.Anaconda2.x64 --remove Component.Anaconda2.x86 --remove Component.Anaconda3.x86 --remove Microsoft.VisualStudio.Component.Unity --remove Component.UnityEngine.x64 --remove Component.UnityEngine.x86 --remove Component.Incredibuild --remove Component.IncredibuildMenu --remove Microsoft.VisualStudio.Component.Sharepoint.Tools --remove Microsoft.VisualStudio.Component.TeamOffice --remove Component.Cocos;'; if (($ret = $p.ExitCode) -and ($ret -ne 3010)) { C:\TEMP\collect.exe;$log_path = $env:Temp;$err='Install failed with exit code 0x{0:x} error logs in: ' + $log_path + '\vslogs.zip'; throw ($err -f $ret) }; Remove-Item -Recurse -Force 'c:\ProgramData\Package Cache\'
Loading

0 comments on commit 3e8f2b7

Please sign in to comment.