Flags is_official_build, proprietary_codecs and chrome_pgo_p

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Flags is_official_build, proprietary_codecs and chrome_pgo_p

Postby HarmlessDave » Tue May 16, 2023 3:24 pm

Building Windows x86, branch 5615

Log ago, the is_official_build=true flag was needed if using proprietary_codecs=true. Is this still the case?

I'm asking because I just tried to build CEF 112.x / branch 5615 with the flags I used for 106.x and received an error

Code: Select all
set GN_DEFINES=is_official_build=true proprietary_codecs=true ffmpeg_branding=Chrome use_thin_lto=false
set GYP_MSVS_VERSION=2022

...
79 patches total (78 applied, 1 skipped, 0 failed)

Generating CEF project files...
Creating E:\cef112056\chromium\src\out\Debug_GN_x64 directory.
Done. Made 17728 targets from 3188 files in 29920ms
Applying issue #1999 fix to E:\cef112056\chromium\src\out\Debug_GN_x64\obj\cef\libcef.ninja
Creating E:\cef112056\chromium\src\out\Release_GN_x64 directory.
Traceback (most recent call last):
  File "E:/cef112056/chromium/src/tools/update_pgo_profiles.py", line 154, in <module>
    sys.exit(main())
  File "E:/cef112056/chromium/src/tools/update_pgo_profiles.py", line 150, in main
    return args.func(args)
  File "E:/cef112056/chromium/src/tools/update_pgo_profiles.py", line 106, in _get_profile_path
    raise RuntimeError(
RuntimeError: requested profile "E:\cef112056\chromium\src\chrome\build\pgo_profiles\chrome-win64-5615-1680716428-8e5dbcb72fb3956bfc18e684258d4a2c2c6a5be2.profdata" doesn't exist, please make sure "checkout_pgo_profiles" is set to True in the "custom_vars" section of your .gclient file, e.g.:
solutions = [
  {
    "name": "src",
    # ...
    "custom_vars": {
      "checkout_pgo_profiles": True,
    },
  },
],
and then run "gclient runhooks" to download it. You can also simply disable the PGO optimizations by setting |chrome_pgo_phase = 0| in your GN arguments.


I found this discussion: https://groups.google.com/a/chromium.or ... 0t4s0RlmOI

...but I'm not clear what the consequences will be if I add chrome_pgo_phase=0, will CEF performance be hobbled? Would it be better to provide Google's PGO file for this branch? (Where to get that?)
HarmlessDave
Expert
 
Posts: 370
Joined: Fri Jul 11, 2014 2:02 pm

Re: Flags is_official_build, proprietary_codecs and chrome_p

Postby magreenblatt » Wed May 17, 2023 2:18 am

See the updated official build instructions: https://bitbucket.org/chromiumembedded/ ... figuration
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Flags is_official_build, proprietary_codecs and chrome_p

Postby HarmlessDave » Wed May 17, 2023 12:00 pm

Thanks. Should GYP_MSVS_VERSION be 2022 instead of 2019 now that the requirements list Visual Studio 2022?

Code: Select all
set GN_DEFINES=is_official_build=true
set GYP_MSVS_VERSION=2019
set CEF_ARCHIVE_FORMAT=tar.bz2
python3 automate-git.py --download-dir=%download_dir% --branch=%cef_branch% --minimal-distrib --client-distrib --force-clean --with-pgo-profiles
HarmlessDave
Expert
 
Posts: 370
Joined: Fri Jul 11, 2014 2:02 pm

Re: Flags is_official_build, proprietary_codecs and chrome_p

Postby magreenblatt » Wed May 17, 2023 12:19 pm

Should GYP_MSVS_VERSION be 2022 instead of 2019 now that the requirements list Visual Studio 2022?

Yes, need to update the docs.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Flags is_official_build, proprietary_codecs and chrome_p

Postby HarmlessDave » Fri May 19, 2023 12:05 pm

Was support for "with-pgo-profiles" added after branch 5615? I'm still getting an error after adding it:

Code: Select all
** Visual Studio 2022 Developer Command Prompt v17.6.0

E:\>SET PATH=e:\depot_tools;C:\Python27amd64\;%PATH%;
E:\>cd E:\cef112056\
E:\cef112056>set GN_DEFINES=is_official_build=true proprietary_codecs=true ffmpeg_branding=Chrome
E:\cef112056>set GYP_MSVS_VERSION=2022
E:\cef112056>set CEF_ARCHIVE_FORMAT=tar.bz2
E:\cef112056>python3 automate-git.py --download-dir=E:\cef112056\ --branch=5615  --minimal-distrib --client-distrib --force-clean --with-pgo-profiles

...

79 patches total (78 applied, 1 skipped, 0 failed)

Generating CEF project files...
Creating E:\cef112056\chromium\src\out\Debug_GN_x64 directory.
Done. Made 17728 targets from 3188 files in 22754ms
Applying issue #1999 fix to E:\cef112056\chromium\src\out\Debug_GN_x64\obj\cef\libcef.ninja
Creating E:\cef112056\chromium\src\out\Release_GN_x64 directory.
Traceback (most recent call last):
  File "E:/cef112056/chromium/src/tools/update_pgo_profiles.py", line 154, in <module>
    sys.exit(main())
  File "E:/cef112056/chromium/src/tools/update_pgo_profiles.py", line 150, in main
    return args.func(args)
  File "E:/cef112056/chromium/src/tools/update_pgo_profiles.py", line 106, in _get_profile_path
    raise RuntimeError(
RuntimeError: requested profile "E:\cef112056\chromium\src\chrome\build\pgo_profiles\chrome-win64-5615-1680716428-8e5dbcb72fb3956bfc18e684258d4a2c2c6a5be2.profdata" doesn't exist, please make sure "checkout_pgo_profiles" is set to True in the "custom_vars" section of your .gclient file, e.g.:
solutions = [
  {
    "name": "src",
    # ...
    "custom_vars": {
      "checkout_pgo_profiles": True,
    },
  },
],
and then run "gclient runhooks" to download it. You can also simply disable the PGO optimizations by setting |chrome_pgo_phase = 0| in your GN arguments.
ERROR at //build/config/compiler/pgo/BUILD.gn:81:23: Script returned non-zero exit code.
      pgo_data_path = exec_script("//tools/update_pgo_profiles.py",
                      ^----------
Current dir: E:/cef112056/chromium/src/out/Release_GN_x64/
Command: E:/cef112056/depot_tools/bootstrap-2@3_8_10_chromium_26_bin/python3/bin/python3.exe E:/cef112056/chromium/src/tools/update_pgo_profiles.py --target win64 get_profile_path
Returned 1.
See //build/config/BUILDCONFIG.gn:352:3: which caused the file to be included.
  "//build/config/compiler/pgo:default_pgo_flags",
  ^----------------------------------------------
Traceback (most recent call last):
  File "E:\cef112056\chromium\src\cef\tools\gclient_hook.py", line 149, in <module>
    RunAction(src_dir, cmd)
  File "E:\cef112056\chromium\src\cef\tools\gclient_util.py", line 35, in RunAction
    gclient_utils.CheckCallAndFilter(
  File "E:\cef112056\depot_tools\gclient_utils.py", line 715, in CheckCallAndFilter
    raise subprocess2.CalledProcessError(
subprocess2.CalledProcessError: Command 'gn gen out\\Release_GN_x64' returned non-zero exit status 1 in E:\cef112056\chromium\src
Traceback (most recent call last):
  File "E:/cef112056/chromium/src/tools/update_pgo_profiles.py", line 154, in <module>
    sys.exit(main())
  File "E:/cef112056/chromium/src/tools/update_pgo_profiles.py", line 150, in main
    return args.func(args)
  File "E:/cef112056/chromium/src/tools/update_pgo_profiles.py", line 106, in _get_profile_path
    raise RuntimeError(
RuntimeError: requested profile "E:\cef112056\chromium\src\chrome\build\pgo_profiles\chrome-win64-5615-1680716428-8e5dbcb72fb3956bfc18e684258d4a2c2c6a5be2.profdata" doesn't exist, please make sure "checkout_pgo_profiles" is set to True in the "custom_vars" section of your .gclient file, e.g.:
solutions = [
  {
    "name": "src",
    # ...
    "custom_vars": {
      "checkout_pgo_profiles": True,
    },
  },
],
and then run "gclient runhooks" to download it. You can also simply disable the PGO optimizations by setting |chrome_pgo_phase = 0| in your GN arguments.
ERROR at //build/config/compiler/pgo/BUILD.gn:81:23: Script returned non-zero exit code.
      pgo_data_path = exec_script("//tools/update_pgo_profiles.py",
                      ^----------
Current dir: E:/cef112056/chromium/src/out/Release_GN_x64/
Command: E:/cef112056/depot_tools/bootstrap-2@3_8_10_chromium_26_bin/python3/bin/python3.exe E:/cef112056/chromium/src/tools/update_pgo_profiles.py --target win64 get_profile_path
Returned 1.
See //build/config/BUILDCONFIG.gn:352:3: which caused the file to be included.
  "//build/config/compiler/pgo:default_pgo_flags",
  ^----------------------------------------------

Traceback (most recent call last):
  File "automate-git.py", line 1327, in <module>
    run('%s %s' % (python_exe, tool), cef_src_dir, depot_tools_dir)
  File "automate-git.py", line 66, in run
    return subprocess.check_call(
  File "e:\depot_tools\bootstrap-2@3_8_10_chromium_20_bin\python3\bin\lib\subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['E:\\cef112056\\depot_tools\\python3.bat', 'E:\\cef112056\\chromium\\src\\cef\\tools\\gclient_hook.py']' returned non-zero exit status 1.


Before your first reply, I tried a build with "set GN_DEFINES=is_official_build=true proprietary_codecs=true ffmpeg_branding=Chrome use_thin_lto=false chrome_pgo_phase=0" instead of adding "--with-pgo-profiles" to automate-git.py and it completed without errors, but if I understand the discussion topic that would be without the optimizations.

Edit: also, are the build scripts trying to use the 64-bit profile for a 32-bit build?

Code: Select all
RuntimeError: requested profile "E:\cef112056\chromium\src\chrome\build\pgo_profiles\chrome-win64-5615-1680716428-8e5dbcb72fb3956bfc18e684258d4a2c2c6a5be2.profdata"


I checked E:\cef112056\chromium\src\chrome\build\win32.pgo.txt and it lists chrome-win32-5615-1680716428-0b02c88261b2226e831a6aca86a6a14cce11afaa.profdata -- "win32" not "win64"
HarmlessDave
Expert
 
Posts: 370
Joined: Fri Jul 11, 2014 2:02 pm

Re: Flags is_official_build, proprietary_codecs and chrome_p

Postby magreenblatt » Fri May 19, 2023 2:11 pm

Was support for "with-pgo-profiles" added after branch 5615?

No, but it requires changes to the .gclient file. If you’re changing flags on an existing checkout add --force-config.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Flags is_official_build, proprietary_codecs and chrome_p

Postby HarmlessDave » Fri May 19, 2023 10:29 pm

That fixed it, thanks again.
HarmlessDave
Expert
 
Posts: 370
Joined: Fri Jul 11, 2014 2:02 pm

Re: Flags is_official_build, proprietary_codecs and chrome_p

Postby ssaraf » Tue Oct 24, 2023 12:54 am

Using chrome_pgo_phase=false worked for you? How was the linking errors in 32 & 64 resolved ?
ssaraf
Techie
 
Posts: 32
Joined: Mon Nov 09, 2020 2:18 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 208 guests