CEF 79, OSX. Fails to make binary distrib

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.

CEF 79, OSX. Fails to make binary distrib

Postby coder678 » Sun Jan 26, 2020 12:45 am

The build itself was successful, I could run cefclient. But it fails on building binary distribs.

Code: Select all
Creating /Volumes/MyPassport/cef_build/code/chromium_git/chromium/src/cef/binary_distrib/cef_binary_79.1.31+gfc9ef34+chromium-79.0.3945.117_macosx64 directory.
Traceback (most recent call last):
  File "make_distrib.py", line 648, in <module>
    create_readme()
  File "make_distrib.py", line 172, in create_readme
    write_file(os.path.join(output_dir, 'README.txt'), data)
  File "/Volumes/MyPassport/cef_build/code/chromium_git/chromium/src/cef/tools/file_util.py", line 36, in write_file
    f.write(data.decode('utf-8'))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 4531: ordinal not in range(128)
Traceback (most recent call last):
  File "../automate/automate-git.py", line 1691, in <module>
    run(path, cef_tools_dir, depot_tools_dir)
  File "../automate/automate-git.py", line 61, in run
    args, cwd=working_dir, env=env, shell=(sys.platform == 'win32'))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/Volumes/MyPassport/cef_build/code/chromium_git/chromium/src/cef/tools/make_distrib.sh', '--ninja-build', '--x64-build']' returned non-zero exit status 1



I changed make_distrib.sh to
Code: Select all
#!/bin/sh
python make_distrib.py --x64-build --output-dir ../binary_distrib/ $@


and the output is

Code: Select all
Traceback (most recent call last):
  File "make_distrib.py", line 648, in <module>
    create_readme()
  File "make_distrib.py", line 172, in create_readme
    write_file(os.path.join(output_dir, 'README.txt'), data)
  File "/Volumes/MyPassport/cef_build/code/chromium_git/chromium/src/cef/tools/file_util.py", line 36, in write_file
    f.write(data.decode('utf-8'))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 4531: ordinal not in range(128)
coder678
Techie
 
Posts: 35
Joined: Sun Jun 26, 2016 10:03 pm

Re: CEF 79, OSX. Fails to make binary distrib

Postby Czarek » Sun Jan 26, 2020 1:58 am

Have you tried to run it with Python 3?
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: CEF 79, OSX. Fails to make binary distrib

Postby coder678 » Sun Jan 26, 2020 6:26 pm

Updated to python 3 but the error is same.
coder678
Techie
 
Posts: 35
Joined: Sun Jun 26, 2016 10:03 pm

Re: CEF 79, OSX. Fails to make binary distrib

Postby Czarek » Mon Jan 27, 2020 4:17 am

Your stack trace doesn't match actual code in branch 3945. File make_distrib.py line 648: https://github.com/chromiumembedded/cef ... ib.py#L648

Looks like you custom patched CEF sources/tools, so you're on your own.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: CEF 79, OSX. Fails to make binary distrib

Postby coder678 » Mon Jan 27, 2020 5:45 pm

Yes I need mp4 support, so I customized build scripts.

update.sh
Code: Select all
#!/bin/bash
export CEF_USE_GN=1
export GN_DEFINES="is_official_build=true proprietary_codecs=true ffmpeg_branding=Chrome"
python ../automate/automate-git.py --branch=3945 --download-dir=/Volumes/MyPassport/cef_build/code/chromium_git --depot-tools-dir=/Volumes/MyPassport/cef_build/code/depot_tools --x64-build --no-distrib --no-build


create.sh
Code: Select all
#!/bin/bash
export CEF_USE_GN=1
export GN_DEFINES="is_official_build=true proprietary_codecs=true ffmpeg_branding=Chrome"
python ../automate/automate-git.py --branch=3945 --download-dir=/Volumes/MyPassport/cef_build/code/chromium_git --x64-build --no-update


Previously I haven't had problems. What can I do now to fix it?
coder678
Techie
 
Posts: 35
Joined: Sun Jun 26, 2016 10:03 pm

[Solved] Re: CEF 79, OSX. Fails to make binary distrib

Postby coder678 » Mon Jan 27, 2020 8:34 pm

I could make binary distribs. In make_distrib.py, I commented out line 172. And used the following make_distrib.sh
Code: Select all
python make_distrib.py --x64-build --output-dir ../binary_distrib/ $@
coder678
Techie
 
Posts: 35
Joined: Sun Jun 26, 2016 10:03 pm

Re: CEF 79, OSX. Fails to make binary distrib

Postby callum » Mon Mar 30, 2020 3:52 pm

I ran into the same problem exactly - building from source with media codecs enabled on macOS. I discovered the `\u2019` character that causes the Python script to fail is here: https://bitbucket.org/chromiumembedded/ ... t#lines-53 - namely, in the string "it doesn’t show dock" the apostrophe character isn't the regular "'" but something else that looks similar but not the same. If you replace that with a regular "'" character, the scripts runs to completion.

Having said that, I don't know why (a) it works with the same file for official CEF builds and (b) how to fix it in an automated fashion.

Maybe a search/replace on that file before the main automate-git.py script runs?
callum
Expert
 
Posts: 326
Joined: Mon Feb 23, 2015 6:19 pm

Re: CEF 79, OSX. Fails to make binary distrib

Postby magreenblatt » Mon Mar 30, 2020 4:09 pm

callum wrote:I ran into the same problem exactly - building from source with media codecs enabled on macOS. I discovered the `\u2019` character that causes the Python script to fail is here: https://bitbucket.org/chromiumembedded/ ... t#lines-53 - namely, in the string "it doesn’t show dock" the apostrophe character isn't the regular "'" but something else that looks similar but not the same. If you replace that with a regular "'" character, the scripts runs to completion.

Having said that, I don't know why (a) it works with the same file for official CEF builds and (b) how to fix it in an automated fashion.

Maybe a search/replace on that file before the main automate-git.py script runs?

What Python version are you using? What locale do you have configured on your Mac?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: CEF 79, OSX. Fails to make binary distrib

Postby callum » Mon Mar 30, 2020 4:12 pm

Code: Select all
Python 2.7.16


Code: Select all
>>> import locale
>>> locale.getdefaultlocale()
('en_US', 'UTF-8')
callum
Expert
 
Posts: 326
Joined: Mon Feb 23, 2015 6:19 pm

Re: CEF 79, OSX. Fails to make binary distrib

Postby magreenblatt » Mon Mar 30, 2020 4:18 pm

That all looks OK. Please add a bug to fix the unicode character.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Next

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 35 guests