cefpython icon indicating copy to clipboard operation
cefpython copied to clipboard

vpython error building cefpython66

Open shakraw opened this issue 5 years ago • 8 comments

Hi, I'm in need to make a custom build of cefpython66 branch because of this bug https://github.com/cztomczak/cefpython/issues/487

I spent a full day on trying to make the build without success... I also followed instruction I found here https://github.com/cztomczak/cefpython/issues/582

I'm building on MacOS Catalina 10.15.7 at the moment. I attached the full output from the build command. Here is the relevant part of the error I get when trying to build. Any suggestions on how to fix it?

Downloading https://commondatastorage.googleapis.com/chromium-browse
[build_out.log](https://github.com/cztomczak/cefpython/files/5574972/build_out.log)
r-clang/Mac/clang-325667-1.tgz .......... Done.
Running hooks:  32% (20/61) gn_mac           
________ running 'vpython src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-gn -s src/buildtools/mac/gn.sha1' in '/Users/luca/Downloads/cefpython.git/build/chromium'
0> Failed to fetch file gs://chromium-gn/a14b089cbae9c29ecbc781686ada8babac8550af for src/buildtools/mac/gn, skipping. [Err: /Users/luca/Downloads/cefpython.git/build/chromium/src/third_party/depot_tools/external_bin/gsutil/gsutil_4.28/gsutil/third_party/boto/boto/pyami/config.py:69: UserWarning: Unable to load AWS_CREDENTIAL_FILE ()
  warnings.warn('Unable to load AWS_CREDENTIAL_FILE (%s)' % full_path)
]
Failed to fetch file gs://chromium-gn/a14b089cbae9c29ecbc781686ada8babac8550af for src/buildtools/mac/gn. [Err: /Users/luca/Downloads/cefpython.git/build/chromium/src/third_party/depot_tools/external_bin/gsutil/gsutil_4.28/gsutil/third_party/boto/boto/pyami/config.py:69: UserWarning: Unable to load AWS_CREDENTIAL_FILE ()
  warnings.warn('Unable to load AWS_CREDENTIAL_FILE (%s)' % full_path)
]
Downloading 1 files took 3.312155 second(s)
Error: Command 'vpython src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-gn -s src/buildtools/mac/gn.sha1' returned non-zero exit status 1 in /Users/luca/Downloads/cefpython.git/build/chromium
Traceback (most recent call last):
  File "/Users/luca/Downloads/cefpython.git/tools/automate-git.py", line 1531, in <module>
    ('--reset ' if discard_local_changes else ''), chromium_dir, depot_tools_dir)
  File "/Users/luca/Downloads/cefpython.git/tools/automate-git.py", line 186, in run
    args, cwd=working_dir, env=env, shell=(sys.platform == 'win32'))
  File "/Users/luca/.pyenv/versions/2.7.17/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['gclient', 'sync', '--with_branch_heads', '--jobs', '16']' returned non-zero exit status 2
Traceback (most recent call last):
  File "automate.py", line 1109, in <module>
    main()
  File "automate.py", line 155, in main
    build_cef()
  File "automate.py", line 254, in build_cef
    run_automate_git()
  File "automate.py", line 1023, in run_automate_git
    return run_command("%s %s" % (sys.executable, command), working_dir)
  File "automate.py", line 974, in run_command
    return subprocess.check_call(args, cwd=working_dir, env=env, shell=shell)
  File "/Users/luca/.pyenv/versions/2.7.17/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/Users/luca/.pyenv/versions/cefpython-2.7.17/bin/python', '/Users/luca/Downloads/cefpython.git/tools/automate-git.py', '--x64-build', '--download-dir=/Users/luca/Downloads/cefpython.git/build', '--branch=3359', '--no-debug-build', '--verbose-build', '--force-build', '--no-cef-update', '--no-distrib-archive']' returned non-zero exit status 1

shakraw avatar Nov 20 '20 16:11 shakraw

Have you checked out proper revision of depot_tools? This is mentioned somewhere in build instructions for building old CEF versions.

You could fix

cztomczak avatar Nov 20 '20 18:11 cztomczak

Hi Czarek,

thank you for your feedback. After reading the build instructions I was able to move a bit forward but now I'm stuck on another error. I tried to search in docs here on GH but I found nothing related to this. Maybe I'm doing something wrong but don't know what exactly.

I launched the build using this command: DEPOT_TOOLS_UPDATE=0 python ../tools/automate.py --build-cef --fast-build --no-cef-update

Here is the new error I'm getting now. Any suggestion or any pointer to docs on about how to solve it?


src (ERROR)
----------------------------------------
[0:00:00] Started.
----------------------------------------
Traceback (most recent call last):
  File "/Users/luca/Downloads/cefpython.git/build/depot_tools/gclient.py", line 2947, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/Users/luca/Downloads/cefpython.git/build/depot_tools/gclient.py", line 2933, in main
    return dispatcher.execute(OptionParser(), argv)
  File "/Users/luca/Downloads/cefpython.git/build/depot_tools/subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "/Users/luca/Downloads/cefpython.git/build/depot_tools/gclient.py", line 2652, in CMDrevert
    return client.RunOnDeps('revert', args)
  File "/Users/luca/Downloads/cefpython.git/build/depot_tools/gclient.py", line 1559, in RunOnDeps
    patch_refs=patch_refs)
  File "/Users/luca/Downloads/cefpython.git/build/depot_tools/gclient_utils.py", line 1075, in run
    self.item.run(*self.args, **self.kwargs)
  File "/Users/luca/Downloads/cefpython.git/build/depot_tools/gclient.py", line 918, in run
    self.ParseDepsFile(expand_vars=(command != 'flatten'))
  File "/Users/luca/Downloads/cefpython.git/build/depot_tools/gclient.py", line 777, in ParseDepsFile
    self._postprocess_deps(deps, rel_prefix), use_relative_paths)
  File "/Users/luca/Downloads/cefpython.git/build/depot_tools/gclient.py", line 638, in _deps_to_objects
    condition, self.get_vars())
  File "/Users/luca/Downloads/cefpython.git/build/depot_tools/gclient_eval.py", line 603, in EvaluateCondition
    return _convert(main_node)
  File "/Users/luca/Downloads/cefpython.git/build/depot_tools/gclient_eval.py", line 562, in _convert
    condition))
ValueError: invalid "and": exactly 2 operands required (inside 'host_os == "linux" and checkout_fuchsia and checkout_fuchsia_for_arm64_host')
Traceback (most recent call last):
  File "/Users/luca/Downloads/cefpython.git/tools/automate-git.py", line 1511, in <module>
    run("gclient revert --nohooks", chromium_dir, depot_tools_dir)
  File "/Users/luca/Downloads/cefpython.git/tools/automate-git.py", line 186, in run
    args, cwd=working_dir, env=env, shell=(sys.platform == 'win32'))
  File "/Users/luca/.pyenv/versions/2.7.17/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['gclient', 'revert', '--nohooks']' returned non-zero exit status 1
Traceback (most recent call last):
  File "../tools/automate.py", line 1109, in <module>
    main()
  File "../tools/automate.py", line 155, in main
    build_cef()
  File "../tools/automate.py", line 254, in build_cef
    run_automate_git()
  File "../tools/automate.py", line 1023, in run_automate_git
    return run_command("%s %s" % (sys.executable, command), working_dir)
  File "../tools/automate.py", line 974, in run_command
    return subprocess.check_call(args, cwd=working_dir, env=env, shell=shell)
  File "/Users/luca/.pyenv/versions/2.7.17/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/Users/luca/.pyenv/versions/cefpython-2.7.17/bin/python', '/Users/luca/Downloads/cefpython.git/tools/automate-git.py', '--x64-build', '--download-dir=/Users/luca/Downloads/cefpython.git/build', '--branch=3359', '--no-debug-build', '--verbose-build', '--force-build', '--no-cef-update', '--no-distrib-archive']' returned non-zero exit status 1```

shakraw avatar Nov 26 '20 18:11 shakraw

Looks like an issue with python and depot_tools. Depot tools come with its own python and if you have wrong revision of depot_tools then you may encounter python errors due to wrong version of python. Add the --no-depot-tools-update arg to automate.py . There is no arg to set depot_tools path, so you have to run automate.py for the first time, encounter error, then checkout proper revision of build/depot_tools/ that was downlaoded. After that re-run automate.py with both env DEPOT_TOOLS_UPDATE=0 and arg --no-depot-tools-update. Make sure depot_tools was not updated when automate.py ran, otherwise something is wrong.

cztomczak avatar Nov 26 '20 18:11 cztomczak

Hi Czarek,

thanks again for your feedback, I was able to go little further with the build. I choosen the correct (I suppose) revisions for building cefpython66 ( chromium revision I'm using is 164c37e3f235134c88e80fac2a182cfba3f07f00, and depo_tools revision I'm using is babd098f3684f1bc965a0f72f96cb701eec91e52 - hope these revs are ok to build it ).

Using export DEPOT_TOOLS_UPDATE=0 ; python ../tools/automate.py --build-cef --fast-build --no-cef-update --no-depot-tools-update ```` now I get another error: gn.py: Could not find gn executable at: /Users/luca/Downloads/cefpython.git/build/chromium/buildtools/mac/gn```

the buildtools directory is completely missing inside chromium directory, no idea on how to move on from this. Have you any suggestions on how to solve this?

Here is the output from the command I run:

...
... already applied (skipping).

50 patches total (0 applied, 50 skipped, 0 failed)

Generating CEF project files...
________ running 'gn gen out/Debug_GN_x64' in '/Users/luca/Downloads/cefpython.git/build/chromium/src'
/Users/luca/Downloads/cefpython.git/build/chromium/.gclient_entries missing, .gclient file in parent directory /Users/luca/Downloads/cefpython.git/build/chromium might not be the file you want to use.
/Users/luca/Downloads/cefpython.git/build/chromium/.gclient_entries missing, .gclient file in parent directory /Users/luca/Downloads/cefpython.git/build/chromium might not be the file you want to use.
gn.py: Could not find gn executable at: /Users/luca/Downloads/cefpython.git/build/chromium/buildtools/mac/gn
Traceback (most recent call last):
  File "tools/gclient_hook.py", line 133, in <module>
    RunAction(src_dir, cmd)
  File "/Users/luca/Downloads/cefpython.git/build/chromium/src/cef/tools/gclient_util.py", line 39, in RunAction
    gclient_utils.CheckCallAndFilterAndHeader(command, cwd=dir, always=True)
  File "/Users/luca/Downloads/cefpython.git/build/depot_tools/gclient_utils.py", line 314, in CheckCallAndFilterAndHeader
    return CheckCallAndFilter(args, **kwargs)
  File "/Users/luca/Downloads/cefpython.git/build/depot_tools/gclient_utils.py", line 576, in CheckCallAndFilter
    rv, args, kwargs.get('cwd', None), None, None)
subprocess2.CalledProcessError: Command 'gn gen out/Debug_GN_x64' returned non-zero exit status 2 in /Users/luca/Downloads/cefpython.git/build/chromium/src
Traceback (most recent call last):
  File "/Users/luca/Downloads/cefpython.git/tools/automate-git.py", line 1621, in <module>
    run(path, cef_src_dir, depot_tools_dir)
  File "/Users/luca/Downloads/cefpython.git/tools/automate-git.py", line 186, in run
    args, cwd=working_dir, env=env, shell=(sys.platform == 'win32'))
  File "/Users/luca/.pyenv/versions/2.7.17/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/Users/luca/Downloads/cefpython.git/build/chromium/src/cef/cef_create_projects.sh']' returned non-zero exit status 1
Traceback (most recent call last):
  File "../tools/automate.py", line 1109, in <module>
    main()
  File "../tools/automate.py", line 155, in main
    build_cef()
  File "../tools/automate.py", line 254, in build_cef
    run_automate_git()
  File "../tools/automate.py", line 1023, in run_automate_git
    return run_command("%s %s" % (sys.executable, command), working_dir)
  File "../tools/automate.py", line 974, in run_command
    return subprocess.check_call(args, cwd=working_dir, env=env, shell=shell)
  File "/Users/luca/.pyenv/versions/2.7.17/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/Users/luca/.pyenv/versions/cefpython-2.7.17/bin/python', '/Users/luca/Downloads/cefpython.git/tools/automate-git.py', '--x64-build', '--download-dir=/Users/luca/Downloads/cefpython.git/build', '--branch=3359', '--no-depot-tools-update', '--no-debug-build', '--verbose-build', '--force-build', '--no-cef-update', '--no-distrib-archive']' returned non-zero exit status 1
```

shakraw avatar Nov 29 '20 20:11 shakraw

Remove the --no-cef-update flag and use the --cef-branch xxx arg.

cztomczak avatar Nov 29 '20 21:11 cztomczak

Try a new fresh build.

cztomczak avatar Nov 29 '20 21:11 cztomczak

Delete everything except depot_tools.

cztomczak avatar Nov 29 '20 21:11 cztomczak

Hi Czarek, thanks for your valuable suggestions. I'll give them a try tomorrow. Anyway, would you consider an offer from me to make a build of cefpython66 for mac with patch for "select" elements ? I need to use it in a custom software and it would be easier for me to use a pre-built build than building myself (never built cefpython from sources before!). Please let me know. Thanks

shakraw avatar Nov 30 '20 23:11 shakraw