ttalvitie / browservice

Browservice: Browse the modern web on historical browsers
MIT License
1.08k stars 32 forks source link

Compiling Browservice failed #95

Closed guazi111 closed 1 year ago

guazi111 commented 1 year ago

My network is unstable to run docker or tools/build_patched_cef.py to build the cef.

At last I built a cef distribution by following the instructions step by step.

But there was a error when I compiling Browservice:

/usr/bin/ld: release/obj/src/clipboard.o: in function browservice::copyToClipboard(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)': clipboard.cpp:(.text._ZN11browservice15copyToClipboardENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x8): undefined reference tocef_chromiumBrowserviceClipboardCopy' /usr/bin/ld: release/obj/src/clipboard.o: in function browservice::pasteFromClipboard[abi:cxx11]()': clipboard.cpp:(.text._ZN11browservice18pasteFromClipboardB5cxx11Ev+0x22): undefined reference tocef_chromiumBrowserviceClipboardPaste' /usr/bin/ld: clipboard.cpp:(.text._ZN11browservice18pasteFromClipboardB5cxx11Ev+0x70): undefined reference to `cef_chromiumBrowserviceClipboardFreePasteResult' collect2: error: ld returned 1 exit status make: *** [Makefile:39: release/bin/browservice] Error 1


It seems my cef file without the clipboard patches.

How to build a patched cef distribution manually ?

Thank you.

guazi111 commented 1 year ago

When I try to build cef via docker ,there is the message:

using /tmp/goma_appuser as tmpdir INFO: creating cache dir (/tmp/goma_appuser/goma_cache). Traceback (most recent call last): File "/home/appuser/build/depot_tools/.cipd_bin/goma_ctl.py", line 2371, in sys.exit(main()) File "/home/appuser/build/depot_tools/.cipd_bin/goma_ctl.py", line 2366, in main goma.Dispatch(sys.argv[1:]) File "/home/appuser/build/depot_tools/.cipd_bin/goma_ctl.py", line 1142, in Dispatch self._action_mappings.get(args[0], self._DefaultAction)() File "/home/appuser/build/depot_tools/.cipd_bin/goma_ctl.py", line 711, in _UpdateHook versionz = self._env.ControlCompilerProxy('/versionz', check_running=True) File "/home/appuser/build/depot_tools/.cipd_bin/goma_ctl.py", line 1397, in ControlCompilerProxy if check_running and not self.CompilerProxyRunning(): File "/home/appuser/build/depot_tools/.cipd_bin/goma_ctl.py", line 2286, in CompilerProxyRunning pids = _CheckOutput(['pgrep', '-d', ',', self._COMPILER_PROXY]).strip() File "/home/appuser/build/depot_tools/.cipd_bin/goma_ctl.py", line 416, in _CheckOutput return PopenWithCheck(args, File "/usr/lib/python3.9/subprocess.py", line 951, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'pgrep'

ttalvitie commented 1 year ago

Yes, Browservice needs a patched CEF (to support clipboard properly); the standard CEF is missing the cef_chromiumBrowserviceClipboard* functions and thus trying to compile Browservice with it fails with the errors you are seeing.

Currently, the only supported way to build a patched version of CEF is using tools/build_patched_cef.py. It has not been written with unstable network in mind, and building with unstable network connection probably isn't a common use case. How does it fail if you try to build with it (show the complete console output)? Depending on where it fails, it may be possible to make it more robust. (Another way would be to read the script and manually emulate it, retrying steps as required.)

In your second message, you seem to be missing some dependencies (such as pgrep). How exactly are you building CEF in that case (what commands do you use)? Are you following the instructions in master/BUILD.md, using the image built from the correct Dockerfile?

guazi111 commented 1 year ago

I upgraded memory to 28g and change the proxy, it worked now.

thank you.

It seems need more memory than 16g to build the patched cef via docker or build_patched_cef.py