llebout / ungoogled-chromium

Google Chromium, sans integration with Google - PPC64LE FORK
BSD 3-Clause "New" or "Revised" License
17 stars 5 forks source link

bootstrap.py fails on Fedora 30 #5

Closed darkbasic closed 4 years ago

darkbasic commented 4 years ago

Python 3:

[niko@localhost src]$ python --version
Python 3.7.4
[niko@localhost src]$ ./tools/gn/bootstrap/bootstrap.py --skip-generate-buildfiles -j$(nproc) -o out/Default/gn 
Traceback (most recent call last):
  File "./tools/gn/bootstrap/bootstrap.py", line 142, in <module>
    sys.exit(main(sys.argv[1:]))
  File "./tools/gn/bootstrap/bootstrap.py", line 125, in main
    ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err', '-j'+str(options.jobs)])
  File "/usr/lib64/python3.7/subprocess.py", line 342, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib64/python3.7/subprocess.py", line 323, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib64/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/usr/lib64/python3.7/subprocess.py", line 1522, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ninja': 'ninja'

Python 2:

[niko@localhost src]$ python --version
Python 2.7.16
[niko@localhost src]$ ./tools/gn/bootstrap/bootstrap.py --skip-generate-buildfiles -j$(nproc) -o out/Default/gn 
Traceback (most recent call last):
  File "./tools/gn/bootstrap/bootstrap.py", line 142, in <module>
    sys.exit(main(sys.argv[1:]))
  File "./tools/gn/bootstrap/bootstrap.py", line 125, in main
    ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err', '-j'+str(options.jobs)])
  File "/usr/lib64/python2.7/subprocess.py", line 185, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib64/python2.7/subprocess.py", line 172, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib64/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
darkbasic commented 4 years ago

If I install a system version of ninja I get:

[niko@localhost src]$ ./tools/gn/bootstrap/bootstrap.py --skip-generate-buildfiles -j$(nproc) -o out/Default/gn 
ninja: Entering directory `/home/niko/devel/ungoogled-chromium-ppc64le/build/src/out/Release/gn_build'
[1/1] LINK gn
FAILED: gn 
clang++ -O3 -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,-strip-all -static-libstdc++ -Wl,--as-needed -pthread -o gn -Wl,--start-group tools/gn/gn_main.o base.a gn_lib.a -Wl,--end-group -ldl
/usr/bin/ld: cannot find -lstdc++
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "./tools/gn/bootstrap/bootstrap.py", line 142, in <module>
    sys.exit(main(sys.argv[1:]))
  File "./tools/gn/bootstrap/bootstrap.py", line 125, in main
    ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err', '-j'+str(options.jobs)])
  File "/usr/lib64/python3.7/subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ninja', '-C', '/home/niko/devel/ungoogled-chromium-ppc64le/build/src/out/Release/gn_build', 'gn', '-w', 'dupbuild=err', '-j32']' returned non-zero exit status 1.

(python 3)

darkbasic commented 4 years ago

I've managed to fix it adding a sed -i '/-static-libstdc++/d' tools/gn/build/gen.py to ppc64le_build.bash.

Unfortunately now I get:

Prepare Makefile.
Generate X86 source list.
Generate X86_64 source list.
Generate ARM source list.
Generate ARM NEON source list.
Generate ARM NEON CPU DETECT source list.
Generate ARM64 source list.
Generate ARM NEON HighBD source list.
Generate ARM64 HighBD source list.
ARM64 Windows uses the ARM64 Linux HighBD source list. No need to generate it.
Generate MIPS source list.
MIPS64 source list is identical to MIPS source list. No need to generate it.
Generate ppc64 source list.
Generate NaCl source list.
Generate GENERIC source list.
Remove temporary directory.
Wrote formatted to '/home/niko/devel/ungoogled-chromium-ppc64le/build/src/third_party/libvpx/libvpx_srcs.gni'.

README.chromium updated with:
Date: Sunday August 11 2019
Commit: cc339ad1c3f5cb316ed0b03fc49ba2e78d4d8eb2
+ cd ../../
+ cd third_party/ffmpeg
+ ./chromium/scripts/build_ffmpeg.py linux ppc64
Traceback (most recent call last):
  File "./chromium/scripts/build_ffmpeg.py", line 11, in <module>
    import optparse
  File "/usr/lib64/python3.7/optparse.py", line 77, in <module>
    import textwrap
  File "/usr/lib64/python3.7/textwrap.py", line 8, in <module>
    import re
  File "/usr/lib64/python3.7/re.py", line 143, in <module>
    class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
llebout commented 4 years ago

Hello, Please read the ppc64le_build.bash script, and this will not work on Fedora, only Ubuntu Bionic and later versions.

You can create a container or chroot to build this.

Also there is a buildroot docker image available at: https://gitlab.com/lle-bout/ungoogled-chromium-ci-docker-image

With prebuilt available at: registry.gitlab.com/lle-bout/ungoogled-chromium-ci-docker-image/ppc64le:latest

Google's build system is just not made for anything else than Ubuntu.

I had a lot of trouble with it already, please do report and formalize your configuration if you do get something working on Fedora, notably the list of dependencies required with names adapted to Fedora repos.

The errors you are sending are related to missing dependencies or wrong python version being used.

darkbasic commented 4 years ago

Unfortunately compiling it in an Ubuntu chroot ends up linking it against older libraries and it won't work on Fedora 30. Good news is that I've fixed all the issues and I've got it working, I'll detail everything later.

llebout commented 4 years ago

@darkbasic Yes it will work on Fedora 30. The builds built on Gitlab CI are made on Ubuntu and I run them on Fedora 30. They work fine.

Great! Thank you

darkbasic commented 4 years ago

I made a PR: https://github.com/leo-lb/ungoogled-chromium/pull/6