brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.53k stars 2.27k forks source link

Build fails checking linux package deps on other distros when --official-build=false #305

Open bkero opened 6 years ago

bkero commented 6 years ago

Description

The build fails while doing the create_dist step with the following logs:

Steps to Reproduce

  1. sudo ./src/build/install-build-deps.sh --no-prompt
  2. yarn build Release --debug_build=false --official_build=false --channel=beta
  3. yarn run create_dist Release --debug_build=false --official_build=false --channel=beta

    Actual result:

    01:00:26 [607/644] STAMP obj/chrome/installer/linux/calculate_rpm_dependencies.inputdeps.stamp
    01:00:26 [608/644] STAMP obj/chrome/installer/linux/calculate_deb_dependencies.inputdeps.stamp
    01:00:26 [609/644] ACTION //chrome/installer/linux:calculate_rpm_dependencies(//build/toolchain/linux:clang_x64)
    01:00:26 [610/644] ACTION //chrome/installer/linux:calculate_rpm_dependencies(//build/toolchain/linux:clang_x64)
    01:00:26 FAILED: rpm_brave.deps 
    01:00:26 python ../../chrome/installer/linux/rpm/calculate_package_deps.py brave rpm_brave.deps --distro-check
    01:00:26 Unexpected new dependency libresolv.so.2()(64bit) on distro openSUSE Leap 42.3 caused by binary brave
    01:00:26 Unexpected new dependency libcairo-gobject.so.2()(64bit) on distro openSUSE Leap 42.3 caused by binary brave
    01:00:26 Unexpected new dependency libplc4.so()(64bit) on distro openSUSE Leap 42.3 caused by binary brave
    01:00:26 Unexpected new dependency libz.so.1()(64bit) on distro openSUSE Leap 42.3 caused by binary brave
    01:00:26 Unexpected new dependency libplds4.so()(64bit) on distro openSUSE Leap 42.3 caused by binary brave
    01:00:26 Unexpected new dependency libresolv.so.2()(64bit) on distro Fedora 26 caused by binary brave
    01:00:26 Unexpected new dependency libcairo-gobject.so.2()(64bit) on distro Fedora 26 caused by binary brave
    01:00:26 Unexpected new dependency libplc4.so()(64bit) on distro Fedora 26 caused by binary brave
    01:00:26 Unexpected new dependency libz.so.1()(64bit) on distro Fedora 26 caused by binary brave
    01:00:26 Unexpected new dependency libplds4.so()(64bit) on distro Fedora 26 caused by binary brave
    01:00:26 Unexpected new dependency libresolv.so.2()(64bit) on distro Fedora 27 caused by binary brave
    01:00:26 Unexpected new dependency libcairo-gobject.so.2()(64bit) on distro Fedora 27 caused by binary brave
    01:00:26 Unexpected new dependency libplc4.so()(64bit) on distro Fedora 27 caused by binary brave
    01:00:26 Unexpected new dependency libz.so.1()(64bit) on distro Fedora 27 caused by binary brave
    01:00:26 Unexpected new dependency libplds4.so()(64bit) on distro Fedora 27 caused by binary brave
    01:00:26 Unexpected new dependency libresolv.so.2()(64bit) on distro openSUSE Leap 42.2 caused by binary brave
    01:00:26 Unexpected new dependency libcairo-gobject.so.2()(64bit) on distro openSUSE Leap 42.2 caused by binary brave
    01:00:26 Unexpected new dependency libplc4.so()(64bit) on distro openSUSE Leap 42.2 caused by binary brave
    01:00:26 Unexpected new dependency libz.so.1()(64bit) on distro openSUSE Leap 42.2 caused by binary brave
    01:00:26 Unexpected new dependency libplds4.so()(64bit) on distro openSUSE Leap 42.2 caused by binary brave
    01:00:26 Unexpected new dependency libresolv.so.2()(64bit) on distro Fedora 25 caused by binary brave
    01:00:26 Unexpected new dependency libcairo-gobject.so.2()(64bit) on distro Fedora 25 caused by binary brave
    01:00:26 Unexpected new dependency libplc4.so()(64bit) on distro Fedora 25 caused by binary brave
    01:00:26 Unexpected new dependency libz.so.1()(64bit) on distro Fedora 25 caused by binary brave
    01:00:26 Unexpected new dependency libplds4.so()(64bit) on distro Fedora 25 caused by binary brave
    01:00:26 [611/644] ACTION //chrome/installer/linux:calculate_deb_dependencies(//build/toolchain/linux:clang_x64)
    01:00:29 [612/644] ACTION //chrome/installer/linux:calculate_deb_dependencies(//build/toolchain/linux:clang_x64)
    01:00:29 FAILED: deb_brave.deps 
    01:00:29 python ../../chrome/installer/linux/debian/calculate_package_deps.py brave ../../build/linux/debian_sid_amd64-sysroot x64 deb_brave.deps --distro-check
    01:00:29 Dependency libcairo-gobject2 (>= 1.10.0) not satisfiable on distro Ubuntu 14.04 (Trusty) caused by binary brave
    01:00:29 Dependency zlib1g (>= 1:1.1.4) not satisfiable on distro Ubuntu 14.04 (Trusty) caused by binary brave
    01:00:29 Dependency libcairo-gobject2 (>= 1.10.0) not satisfiable on distro Debian 9 (Stretch) caused by binary brave
    01:00:29 Dependency zlib1g (>= 1:1.1.4) not satisfiable on distro Debian 9 (Stretch) caused by binary brave
    01:00:29 Dependency libcairo-gobject2 (>= 1.10.0) not satisfiable on distro Ubuntu 16.04 (Xenial) caused by binary brave
    01:00:29 Dependency zlib1g (>= 1:1.1.4) not satisfiable on distro Ubuntu 16.04 (Xenial) caused by binary brave
    01:00:29 Dependency libcairo-gobject2 (>= 1.10.0) not satisfiable on distro Debian 10 (Buster) caused by binary brave
    01:00:29 Dependency zlib1g (>= 1:1.1.4) not satisfiable on distro Debian 10 (Buster) caused by binary brave
    01:00:29 Dependency libcairo-gobject2 (>= 1.10.0) not satisfiable on distro Ubuntu 17.10 (Artful) caused by binary brave
    01:00:29 Dependency zlib1g (>= 1:1.1.4) not satisfiable on distro Ubuntu 17.10 (Artful) caused by binary brave
    01:00:29 Dependency libcairo-gobject2 (>= 1.10.0) not satisfiable on distro Debian 8 (Jessie) caused by binary brave
    01:00:29 Dependency zlib1g (>= 1:1.1.4) not satisfiable on distro Debian 8 (Jessie) caused by binary brave
    01:00:34 [613/644] ACTION //brave/app/linux:generate_breakpad_symbols(//build/toolchain/linux:clang_x64)
    01:00:34 ninja: build stopped: subcommand failed.
    01:00:34 null
    01:00:34 null
    01:00:34 error Command failed with exit code 1.

Expected result:

Reproduces how often:

Brave version (about:brave info)

Reproducible on current release:

Website problems only:

Additional Information

Jacalz commented 6 years ago

You might want to update https://github.com/brave/brave-browser/wiki/Linux-Development-Environment arter this gets fixed 😉

mbacchi commented 6 years ago

I wanted to reference this Chromium issue which is related to this problem, for posterity: https://bugs.chromium.org/p/chromium/issues/detail?id=766710

fmarier commented 5 years ago

I ran into the same problems in https://github.com/brave/brave-core/pull/1078#issuecomment-454969015.

The solution, which I documented in https://github.com/brave/brave-browser/wiki/Linux-packages#build-command, is to use --official_build=true or to omit that option entirely.

maximbaz commented 5 years ago

Maybe something has changed, but this trick doesn't work for me anymore 😞 I used the --official_build=true (the full command below) and still got all these compilation errors.

npm install
npm run init
npm run create_dist Release --debug_build=false --official_build=true

And the errors are like:

[38185/38211] ACTION //chrome/installer/linux:calculate_rpm_dependencies(//build/toolchain/linux:clang_x64)           
FAILED: rpm_libwidevinecdm.deps                                                                                       
python ../../chrome/installer/linux/rpm/calculate_package_deps.py libwidevinecdm.so rpm_libwidevinecdm.deps libwidevin
ecdm.so --distro-check                                                                                                
Traceback (most recent call last):                                                                                    
  File "../../chrome/installer/linux/rpm/calculate_package_deps.py", line 34, in <module>                             
    stdout=subprocess.PIPE, stderr=subprocess.PIPE)                                                                   
  File "/usr/lib/python2.7/subprocess.py", line 394, in __init__                                                      
    errread, errwrite)                                                                                                
  File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child                                               
    raise child_exception                                                                                             
OSError: [Errno 2] No such file or directory                                                                          
[38186/38211] ACTION //chrome/installer/linux:calculate_deb_dependencies(//build/toolchain/linux:clang_x64)           
FAILED: deb_brave_sandbox.deps                                                                                        
python ../../chrome/installer/linux/debian/calculate_package_deps.py brave_sandbox ../../build/linux/debian_sid_amd64-
sysroot x64 deb_brave_sandbox.deps --distro-check                                                                     
Traceback (most recent call last):                                                                                    
  File "../../chrome/installer/linux/debian/calculate_package_deps.py", line 59, in <module>                          
    cwd=sysroot)                                                                                                      
  File "/usr/lib/python2.7/subprocess.py", line 394, in __init__                                                      
    errread, errwrite)                                                                                                
  File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child                                                   raise child_exception                                                                                             
OSError: [Errno 2] No such file or directory                                                                          
[38187/38211] ACTION //chrome/installer/linux:calculate_deb_dependencies(//build/toolchain/linux:clang_x64)           
FAILED: deb_brave.deps                                                                                                
python ../../chrome/installer/linux/debian/calculate_package_deps.py brave ../../build/linux/debian_sid_amd64-sysroot 
x64 deb_brave.deps --distro-check                                                                                     
Traceback (most recent call last):                                                                                    
  File "../../chrome/installer/linux/debian/calculate_package_deps.py", line 59, in <module>                          
    cwd=sysroot)                                                                                                      
  File "/usr/lib/python2.7/subprocess.py", line 394, in __init__                                                      
    errread, errwrite)                                                                                                
  File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child                                                   raise child_exception                                                                                             
OSError: [Errno 2] No such file or directory  
bsclifton commented 5 years ago

@maximbaz can you try also passing in --skip_signing? This is going to fail for most people (as-is) because it will try to do signing for the binaries

maximbaz commented 5 years ago

I think it fails before signing, due to me not having the necessary tools to create .deb and .rpm files.

But this actually isn't an issue for me anymore - to create an Arch Linux package I ended up using a simple npm run build Release and then cherry-picking the necessary files from /src/out/Release folder.

Here are the full build instructions, by the way, in case anyone is interested: PKGBUILD

fmarier commented 5 years ago

@bsclifton Is the original issue (builds not working with --official-build=false) actually fixed or did you close this based on https://github.com/brave/brave-browser/issues/305#issuecomment-512595192?

bsclifton commented 5 years ago

@fmarier good question... I know I have built with --official-build=false, but I haven't tried to do create_dist. I'll keep open until we can confirm that