Brave-browser: Got file not found error when building challenge_bypass_ristretto

Created on 24 Feb 2019  路  11Comments  路  Source: brave/brave-browser

Latest attempt to build Brave from source (latest master branch) results in an error. I am following this guide https://github.com/brave/brave-browser/wiki to do a Release build. This is the error I get:

building brave...
gn gen /disk-2/dev/brave-browser/src/out/Release --args="safe_browsing_mode=1 root_extra_deps=[\"//brave\"] is_component_build=false proprietary_codecs=true ffmpeg_branding=\"Chrome\" enable_nacl=false enable_widevine=true target_cpu=\"x64\" is_official_build=true is_debug=false dcheck_always_on=false brave_channel=\"\" google_api_key=\"AIzaSyAH90V94EcZBP5oH7oc-mXQrSKgASVxER8\" brave_google_api_key=\"AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q\" brave_google_api_endpoint=\"https://www.googleapis.com/geolocation/v1/geolocate?key=\" brave_product_name=\"Brave\" brave_project_name=\"brave\" brave_version_major=\"0\" brave_version_minor=\"63\" brave_version_build=\"0\" chrome_version_string=\"73.0.3683.39\" chrome_version_major=\"73\" safebrowsing_api_endpoint=\"safebrowsing.brave.com\" brave_referrals_api_key=\"\" enable_hangout_services_extension=true cc_wrapper=\"/disk-2/dev/brave-browser/src/brave/script/redirect-cc.py\" "
Done. Made 11823 targets from 1949 files in 2636ms
ninja -C /disk-2/dev/brave-browser/src/out/Release brave -k 1
ninja: Entering directory `/disk-2/dev/brave-browser/src/out/Release'
[680/19788] ACTION //brave/vendor/challenge_bypass_ristretto_ffi:challenge_bypass_ristretto(//build/toolchain/linux:clang_x64)
FAILED: gen/challenge_bypass_ristretto/out/x86_64-unknown-linux-gnu/release/libchallenge_bypass_ristretto.a 
python ../../brave/script/cargo.py --rustup_home=../../brave/build/rustup/ --cargo_home=../../brave/build/rustup/ --manifest_path=../../brave/vendor/challenge_bypass_ristretto_ffi/Cargo.toml --build_path=gen/challenge_bypass_ristretto/out --target=x86_64-unknown-linux-gnu --is_debug=false --rust_flags=
Traceback (most recent call last):
  File "../../brave/script/cargo.py", line 104, in <module>
    sys.exit(main())
  File "../../brave/script/cargo.py", line 16, in main
    build(parse_args())
  File "../../brave/script/cargo.py", line 81, in build
    subprocess.check_call(cargo_args, env=env)
  File "/usr/lib/python2.7/subprocess.py", line 181, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 168, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
[689/19788] ACTION //brave/components/brave_webtorrent/extension:generate_brave_webtorrent(//build/toolchain/linux:clang_x64)
ninja: build stopped: subcommand failed.
null
null
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `node ./scripts/commands.js build "Release"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/valera/.npm/_logs/2019-02-24T17_39_27_360Z-debug.log

My system:

PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
Linux debian 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/Linux
$ python --version
Python 2.7.13

$ python3 --version
Python 3.5.3
$ gcc --version
gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ node --version
v10.15.1
documentation source-master

Most helpful comment

All 11 comments

Here is the LOG file:

$ cat /home/valera/.npm/_logs/2019-02-24T17_39_27_360Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/home/valera/.nvm/versions/node/v10.15.1/bin/node',
1 verbose cli   '/home/valera/.nvm/versions/node/v10.15.1/bin/npm',
1 verbose cli   'run',
1 verbose cli   'build',
1 verbose cli   'Release' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]~prebuild: [email protected]
6 info lifecycle [email protected]~build: [email protected]
7 verbose lifecycle [email protected]~build: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~build: PATH: /home/valera/.nvm/versions/node/v10.15.1/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/disk-2/dev/brave-browser/node_modules/.bin:/home/valera/.kubectx:/home/valera/.yarn/bin:/home/valera/.config/yarn/global/node_modules/.bin:/home/valera/.nvm/versions/node/v10.15.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:~/.local/bin
9 verbose lifecycle [email protected]~build: CWD: /disk-2/dev/brave-browser
10 silly lifecycle [email protected]~build: Args: [ '-c', 'node ./scripts/commands.js build "Release"' ]
11 silly lifecycle [email protected]~build: Returned: code: 1  signal: null
12 info lifecycle [email protected]~build: Failed to exec build script
13 verbose stack Error: [email protected] build: `node ./scripts/commands.js build "Release"`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/home/valera/.nvm/versions/node/v10.15.1/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:189:13)
13 verbose stack     at ChildProcess.<anonymous> (/home/valera/.nvm/versions/node/v10.15.1/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:189:13)
13 verbose stack     at maybeClose (internal/child_process.js:970:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid [email protected]
15 verbose cwd /disk-2/dev/brave-browser
16 verbose Linux 4.9.0-8-amd64
17 verbose argv "/home/valera/.nvm/versions/node/v10.15.1/bin/node" "/home/valera/.nvm/versions/node/v10.15.1/bin/npm" "run" "build" "Release"
18 verbose node v10.15.1
19 verbose npm  v6.8.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build: `node ./scripts/commands.js build "Release"`
22 error Exit status 1
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

cc: @yrliou @simonhong

From the log in the issue description, I think it was failed at challenge_bypass_ristretto stuff instead of webtorrent, cc @tmancey

@rebron Any tip on how to bypass this problem? What step am I missing in building release version of Brave browser locally?

@valera-rozuvan

Can you try these steps:

  1. Delete the src/out, src/brave/vendor
  2. Pull the latest changes and run npm run init

and try running the build. Let me know if you still run into this problem.

These are the commands I ran:

git reset --hard
git pull origin master
rm -rf src/out
rm -rf src/brave/vendor
npm run sync -- --all
npm run init
npm run build Release

I still get the error:

building brave...
gn gen /disk-2/dev/brave-browser/src/out/Release --args="safe_browsing_mode=1 root_extra_deps=[\"//brave\"] is_component_build=false proprietary_codecs=true ffmpeg_branding=\"Chrome\" enable_nacl=false enable_widevine=true target_cpu=\"x64\" is_official_build=true is_debug=false dcheck_always_on=false brave_channel=\"\" google_api_key=\"AIzaSyAH90V94EcZBP5oH7oc-mXQrSKgASVxER8\" brave_google_api_key=\"AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q\" brave_google_api_endpoint=\"https://www.googleapis.com/geolocation/v1/geolocate?key=\" brave_product_name=\"Brave\" brave_project_name=\"brave\" brave_version_major=\"0\" brave_version_minor=\"63\" brave_version_build=\"0\" chrome_version_string=\"73.0.3683.39\" chrome_version_major=\"73\" safebrowsing_api_endpoint=\"safebrowsing.brave.com\" brave_referrals_api_key=\"\" enable_hangout_services_extension=true cc_wrapper=\"/disk-2/dev/brave-browser/src/brave/script/redirect-cc.py\" "
Done. Made 11826 targets from 1949 files in 34319ms
ninja -C /disk-2/dev/brave-browser/src/out/Release brave -k 1
ninja: Entering directory `/disk-2/dev/brave-browser/src/out/Release'
[992/37107] ACTION //brave/vendor/challenge_bypass_ristretto_ffi:challenge_bypass_ristretto(//build/toolchain/linux:clang_x64)
FAILED: gen/challenge_bypass_ristretto/out/x86_64-unknown-linux-gnu/release/libchallenge_bypass_ristretto.a 
python ../../brave/script/cargo.py --rustup_home=../../brave/build/rustup/ --cargo_home=../../brave/build/rustup/ --manifest_path=../../brave/vendor/challenge_bypass_ristretto_ffi/Cargo.toml --build_path=gen/challenge_bypass_ristretto/out --target=x86_64-unknown-linux-gnu --is_debug=false --rust_flags=
Traceback (most recent call last):
  File "../../brave/script/cargo.py", line 104, in <module>
    sys.exit(main())
  File "../../brave/script/cargo.py", line 16, in main
    build(parse_args())
  File "../../brave/script/cargo.py", line 81, in build
    subprocess.check_call(cargo_args, env=env)
  File "/usr/lib/python2.7/subprocess.py", line 181, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 168, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
[1001/37107] ACTION //brave/components/brave_webtorrent/extension:generate_brave_webtorrent(//build/toolchain/linux:clang_x64)
ninja: build stopped: subcommand failed.
null
null
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `node ./scripts/commands.js build "Release"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/valera/.npm/_logs/2019-03-01T20_42_25_883Z-debug.log

Here is the log file:

$ cat /home/valera/.npm/_logs/2019-03-01T20_42_25_883Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/home/valera/.nvm/versions/node/v10.15.1/bin/node',
1 verbose cli   '/home/valera/.nvm/versions/node/v10.15.1/bin/npm',
1 verbose cli   'run',
1 verbose cli   'build',
1 verbose cli   'Release' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]~prebuild: [email protected]
6 info lifecycle [email protected]~build: [email protected]
7 verbose lifecycle [email protected]~build: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~build: PATH: /home/valera/.nvm/versions/node/v10.15.1/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/disk-2/dev/brave-browser/node_modules/.bin:/home/valera/.kubectx:/home/valera/.yarn/bin:/home/valera/.config/yarn/global/node_modules/.bin:/home/valera/.nvm/versions/node/v10.15.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:~/.local/bin
9 verbose lifecycle [email protected]~build: CWD: /disk-2/dev/brave-browser
10 silly lifecycle [email protected]~build: Args: [ '-c', 'node ./scripts/commands.js build "Release"' ]
11 silly lifecycle [email protected]~build: Returned: code: 1  signal: null
12 info lifecycle [email protected]~build: Failed to exec build script
13 verbose stack Error: [email protected] build: `node ./scripts/commands.js build "Release"`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/home/valera/.nvm/versions/node/v10.15.1/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:189:13)
13 verbose stack     at ChildProcess.<anonymous> (/home/valera/.nvm/versions/node/v10.15.1/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:189:13)
13 verbose stack     at maybeClose (internal/child_process.js:970:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid [email protected]
15 verbose cwd /disk-2/dev/brave-browser
16 verbose Linux 4.9.0-8-amd64
17 verbose argv "/home/valera/.nvm/versions/node/v10.15.1/bin/node" "/home/valera/.nvm/versions/node/v10.15.1/bin/npm" "run" "build" "Release"
18 verbose node v10.15.1
19 verbose npm  v6.8.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build: `node ./scripts/commands.js build "Release"`
22 error Exit status 1
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

@valera-rozuvan - I missed one directory in my last comment src/brave/build/ . Can you remove it as well, before running npm run init?

Success! This is the final version of the bash script which helped me:

#!/bin/sh

cd /disk-2/dev/brave-browser

git reset --hard
git pull origin master
rm -rf src/out
rm -rf src/brave/vendor
rm -rf src/brave/build/
npm run sync -- --all
npm run init
npm run build Release

exit 0

@valera-rozuvan awesome 馃槃 You may be able to edit the wiki, if there are specific steps you found that would help others (if not, let us know and we can update for you)

I'll close as this seems to be resolved!

edit: thanks @jumde for the assist! 馃槃

@bsclifton I am unable to edit the Wiki. Maybe it is open for editing only by inside team members?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fmarier picture fmarier  路  3Comments

qingxiang-jia picture qingxiang-jia  路  3Comments

AlexCombas picture AlexCombas  路  3Comments

bsclifton picture bsclifton  路  3Comments

kjozwiak picture kjozwiak  路  3Comments