Skip to content

Commit d191d3c

Browse files
committed
Changes for Chrome 94, also build architecture limiting support
Manual sandbox building to avoid linker error. Initial work for building only select architectures. NOTE: CefSharp does NOT support this yet (but should be coming). This will work for CEF however. Updated VS to 2019 builds and newer packages as needed for modern CEF releases. Initial work on shallow clone support for CEF building. This would greatly speed up builds, however I do not believe it actually works. It will fail if the commands are run twice, and even if all commands work on the first try gsync still seems to end up pulling the repo down at a later point in the build (despite the shallow param being passed). Cloning the repos manually first allows the build to get much further (but still fail).
1 parent 584d755 commit d191d3c

8 files changed

+140
-70
lines changed

Dockerfile_cef

+9-8
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ FROM vs
22

33
RUN $env:Path = 'c:/Program Files/Git/bin/;' + $env:Path;setx /M PATH $env:Path;
44
RUN Invoke-WebRequest 'https://storage.googleapis.com/chrome-infra/depot_tools.zip' -OutFile 'C:/code/depot_tools.zip';
5-
RUN Expand-Archive C:/code/depot_tools.zip -DestinationPath "C:/code/depot_tools";
6-
RUN $env:Path = 'c:/code/depot_tools/;' + $env:Path;setx /M PATH $env:Path;
5+
RUN Expand-Archive C:/code/depot_tools.zip -DestinationPath "c:/code/depot_tools";
76
ARG GN_DEFINES="is_debug=false"
87
ARG GN_ARGUMENTS="--ide=vs2019 --sln=cef --filters=//cef/*"
98
ENV DEPOT_TOOLS_WIN_TOOLCHAIN 0
@@ -13,14 +12,16 @@ ARG DUAL_BUILD="0"
1312
ARG BINARY_EXT="zip"
1413
ARG GYP_DEFINES="target_arch=x64 "
1514
ARG CEF_SAVE_SOURCES
15+
ARG ARCHES
1616
ARG CHROME_BRANCH=3239
17-
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";
17+
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 ARCHES "$env:ARCHES";setx /M CEF_SAVE_SOURCES "$env:CEF_SAVE_SOURCES";setx /M CHROME_BRANCH "$env:CHROME_BRANCH";
1818

1919
ADD https://bitbucket.org/chromiumembedded/cef/raw/master/tools/automate/automate-git.py c:/code/automate/
20-
RUN cd c:/code/depot_tools/;update_depot_tools.bat;git checkout .\cipd.ps1;update_depot_tools.bat;
21-
20+
ADD automate-git.py c:/code/automate/
21+
RUN cd c:/code/depot_tools/;./update_depot_tools.bat;./update_depot_tools.bat;
22+
RUN $env:Path = 'c:/code/depot_tools/;' + $env:Path;setx /M PATH $env:Path;
2223
ADD functions.ps1 cef_build.ps1 cef_patch.ps1 cef_patch_*.diff c:/code/
23-
# Comment out the next step if you want to do it by hand, make sure to change the build args to env options like:
24-
# -e DUAL_BUILD="0" -e GN_DEFINES="is_official_build=true proprietary_codecs=true ffmpeg_branding=Chrome" -e GYP_DEFINES="" -e CHROME_BRANCH="3396"
25-
#RUN c:/code/cef_build.ps1
24+
25+
26+
2627
CMD ["powershell", "c:/code/cef_build.ps1"]

Dockerfile_cef_binary

+9-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ WORKDIR /code/cef-binary/cef-binary-master/
1111
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;
1212
RUN 'New-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0 -Name VCTargetsPath -PropertyType String -Value "`$`(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\"'
1313
ARG BINARY_EXT="zip"
14-
#ADD tmp_cef_bin_build.ps1 /code/cef-binary/cef-binary-master/build.ps1
15-
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;
14+
ARG ARCHES
15+
16+
##Next lines incase trying custom build items before in master
17+
#ADD cef-binary-build.ps1 /code/cef-binary/cef-binary-master/build.ps1
18+
#Add chromiumembeddedframework.runtime.nuspec.template /code/cef-binary/cef-binary-master/NuGet/
19+
#Add chromiumembeddedframework.runtime.win.nuspec /code/cef-binary/cef-binary-master/NuGet/
20+
21+
RUN ./build.ps1 -Verbose -DownloadBinary local -CefBinaryDir /code/binaries/ -CefVersion auto -NoDebugBuild -Extension $env:BINARY_EXT -BuildArches $env:ARCHES -Target vs2019;
22+
RUN ./build.ps1 -DownloadBinary local -CefBinaryDir /code/binaries/ -CefVersion auto -NoDebugBuild -Extension $env:BINARY_EXT -BuildArches $env:ARCHES -Target nupkg-only;
1623
RUN Compress-Archive -Path NuGet -CompressionLevel Fastest -DestinationPath C:\packages

Dockerfile_cefsharp

+6-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@ RUN cp ../build.ps1 .
1313
ARG CEF_VERSION_STR=auto
1414
ARG CHROME_BRANCH=3239
1515
ENV PACKAGE_SOURCE C:/code/cef-binary/cef-binary-master/NuGet
16-
16+
ARG ARCHES
1717
ADD cefsharp_patch_*.diff cefsharp_set_versions_and_restore.ps1 functions.ps1 cefsharp_patch.ps1 c:/code/cefsharp/
1818
RUN ./cefsharp_patch.ps1
1919
RUN ./cefsharp_set_versions_and_restore.ps1
20-
#ADD tmp_cefsharp_build.ps1 /code/cefsharp/build.ps1
21-
RUN [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12;./build.ps1 -Verbose -Target vs2019 -Version $env:CEFSHARP_VERSION -AssemblyVersion $env:CEFSHARP_VERSION;
20+
21+
##Next line for manually testing a replacement cefsharp build script before in master
22+
#ADD cefsharp_build.ps1 /code/cefsharp/build.ps1
23+
24+
RUN [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12;./build.ps1 -BuildArches $env:ARCHES -Verbose -Target vs2019 -Version $env:CEFSHARP_VERSION -AssemblyVersion $env:CEFSHARP_VERSION;
2225
RUN cp $env:PACKAGE_SOURCE/*.nupkg C:/code/cefsharp/nuget/
2326
RUN Compress-Archive -Path C:/code/cefsharp/nuget/*.nupkg -CompressionLevel Fastest -DestinationPath C:\packages_cefsharp

Dockerfile_vs

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ FROM $BASE_DOCKER_FILE
33
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
44

55
ENV COMPLUS_NGenProtectedProcess_FeatureEnabled 0
6-
RUN mkdir c:\code\automate;mkdir c:\temp\;mkdir c:\code\depot_tools;
6+
RUN mkdir c:\code\automate;mkdir c:\temp\;mkdir c:\code\chromium_git;;mkdir c:\code\chromium_git\depot_tools
77
RUN Invoke-WebRequest 'https://aka.ms/vscollect.exe' -OutFile 'C:\TEMP\collect.exe';
8-
RUN Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/v4.1.0/nuget.exe' -OutFile 'c:\code\depot_tools\;';
8+
RUN Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/v4.1.0/nuget.exe' -OutFile 'c:\code\chromium_git\depot_tools\;';
99

1010
RUN Invoke-WebRequest 'https://www.7-zip.org/a/7z1801-x64.msi' -OutFile '/code/7zip.msi';
1111
RUN Start-Process msiexec.exe -Wait -ArgumentList '/i c:\code\7zip.msi /quiet /norestart /L*v install.log'
@@ -14,10 +14,10 @@ RUN Start-Process msiexec.exe -Wait -ArgumentList '/i c:\code\7zip.msi /quiet /n
1414
WORKDIR "Program Files"
1515
#Powershell 50 char limit fix
1616
RUN Remove-Item -Recurse -Force '.\WindowsPowerShell\Modules\PSReadLine'
17-
WORKDIR c:\\code\\depot_tools
17+
WORKDIR c:\\code\\chromium_git\\depot_tools
1818

1919
#Not sure why the community installer doesn't instal the debugger with --all but all the same this is a quick fix.
20-
RUN Invoke-WebRequest https://go.microsoft.com/fwlink/?linkid=864422 -OutFile 'C:\code\winsdksetup.exe';
20+
RUN Invoke-WebRequest https://go.microsoft.com/fwlink/?linkid=2120843 -OutFile 'C:\code\winsdksetup.exe';
2121
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) }
2222

2323

@@ -26,4 +26,4 @@ RUN Invoke-WebRequest 'https://aka.ms/vs/16/release/vs_community.exe' -OutFile '
2626
#3010 is fine, as that is just restart requested.
2727
# https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community
2828
# Some of these are more needed for cefsharp like 4.5.2 and 4.6.2 (it uses both targets depending on project)
29-
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\'
29+
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 --add Microsoft.VisualStudio.Component.Windows10SDK.19041 --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\'

build.ps1

+4-2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ RunProc -proc "docker" -redirect_output:$redirect_output -opts "pull $VAR_BASE_D
6666
TimerNow("Pull base file");
6767
RunProc -proc "docker" -redirect_output:$redirect_output -opts "build $VAR_HYPERV_MEMORY_ADD --build-arg BASE_DOCKER_FILE=`"$VAR_BASE_DOCKER_FILE`" -f Dockerfile_vs -t vs ."
6868
TimerNow("VSBuild");
69+
6970
if ($VAR_CEF_USE_BINARY_PATH -and $VAR_CEF_USE_BINARY_PATH -ne ""){
7071
$docker_file_name="Dockerfile_cef_create_from_binaries";
7172

@@ -78,18 +79,19 @@ if ($VAR_CEF_USE_BINARY_PATH -and $VAR_CEF_USE_BINARY_PATH -ne ""){
7879
RunProc -proc "docker" -redirect_output:$redirect_output -opts "build $VAR_HYPERV_MEMORY_ADD --build-arg BINARY_EXT=`"$VAR_CEF_BINARY_EXT`" -f $docker_file_name -t cef ."
7980
Set-Location $ORIGINAL_WORKING_DIR;
8081
} else {
81-
RunProc -proc "docker" -redirect_output:$redirect_output -opts "build $VAR_HYPERV_MEMORY_ADD --build-arg CEF_SAVE_SOURCES=`"$VAR_CEF_SAVE_SOURCES`" --build-arg BINARY_EXT=`"$VAR_CEF_BINARY_EXT`" --build-arg GN_ARGUMENTS=`"$VAR_GN_ARGUMENTS`" --build-arg DUAL_BUILD=`"$VAR_DUAL_BUILD`" --build-arg GN_DEFINES=`"$VAR_GN_DEFINES`" --build-arg GYP_DEFINES=`"$VAR_GYP_DEFINES`" --build-arg CHROME_BRANCH=`"$VAR_CHROME_BRANCH`" -f Dockerfile_cef -t cef_build_env ."
82+
RunProc -proc "docker" -redirect_output:$redirect_output -opts "build $VAR_HYPERV_MEMORY_ADD --build-arg CEF_SAVE_SOURCES=`"$VAR_CEF_SAVE_SOURCES`" --build-arg ARCHES=`"$VAR_BUILD_ARCHES`" --build-arg BINARY_EXT=`"$VAR_CEF_BINARY_EXT`" --build-arg GN_ARGUMENTS=`"$VAR_GN_ARGUMENTS`" --build-arg DUAL_BUILD=`"$VAR_DUAL_BUILD`" --build-arg GN_DEFINES=`"$VAR_GN_DEFINES`" --build-arg GYP_DEFINES=`"$VAR_GYP_DEFINES`" --build-arg CHROME_BRANCH=`"$VAR_CHROME_BRANCH`" -f Dockerfile_cef -t cef_build_env ."
8283
$exit_code = RunProc -errok -proc "docker" -opts "tag i_$($VAR_CEF_BUILD_MOUNT_VOL_NAME) cef"; #if this fails we know it didn't build correctly and to continue
8384
if ($exit_code -ne 0){
8485
RunProc -errok -proc "docker" -opts "rm c_$($VAR_CEF_BUILD_MOUNT_VOL_NAME)_tmp"
8586
RunProc -proc "docker" -redirect_output:$redirect_output -opts "run $VAR_HYPERV_MEMORY_ADD -v $($VAR_CEF_BUILD_MOUNT_VOL_NAME):C:/code/chromium_git --name c_$($VAR_CEF_BUILD_MOUNT_VOL_NAME)_tmp cef_build_env"
87+
8688
$exit_code = RunProc -errok -proc "docker" -opts "commit c_$($VAR_CEF_BUILD_MOUNT_VOL_NAME)_tmp i_$($VAR_CEF_BUILD_MOUNT_VOL_NAME)";
8789
$exit_code = RunProc -errok -proc "docker" -opts "tag i_$($VAR_CEF_BUILD_MOUNT_VOL_NAME) cef";
8890
}
8991
}
9092
TimerNow("CEF Build");
9193
if (! $VAR_CEF_BUILD_ONLY){
92-
RunProc -proc "docker" -redirect_output:$redirect_output -opts "build $VAR_HYPERV_MEMORY_ADD --build-arg BINARY_EXT=`"$VAR_CEF_BINARY_EXT`" -f Dockerfile_cef_binary -t cef_binary ."
94+
RunProc -proc "docker" -redirect_output:$redirect_output -opts "build $VAR_HYPERV_MEMORY_ADD --build-arg ARCHES=`"$VAR_BUILD_ARCHES`" --build-arg BINARY_EXT=`"$VAR_CEF_BINARY_EXT`" -f Dockerfile_cef_binary -t cef_binary ."
9395
TimerNow("CEF Binary compile");
9496
RunProc -proc "docker" -redirect_output:$redirect_output -opts "build $VAR_HYPERV_MEMORY_ADD --build-arg CEFSHARP_BRANCH=`"$VAR_CEFSHARP_BRANCH`" --build-arg CEFSHARP_VERSION=`"$VAR_CEFSHARP_VERSION`" --build-arg CEF_VERSION_STR=`"$VAR_CEF_VERSION_STR`" --build-arg CHROME_BRANCH=`"$VAR_CHROME_BRANCH`" -f Dockerfile_cefsharp -t cefsharp ."
9597
TimerNow("CEFSharp compile");

0 commit comments

Comments
 (0)