The unique trouble with ninja during building chromium. (ninja: error: toolchain.ninja: lexing error)

I compile chromium from source code. I use a command gn args out/mybuild. The list of arguments:

proprietary_codecs=true
ffmpeg_branding="Chrome"

is_debug = false
dcheck_always_on = false
is_official_build = true
enable_nacl=false
blink_symbol_level=0
v8_symbol_level=0

chrome_pgo_phase = 0

The result is

Generating files...
Done. Made 18307 targets from 3100 files in 4850ms

Next step is autoninja -C out/mybuild chrome. Output is

ninja: Entering directory `out/mybuild'
ninja: error: toolchain.ninja:309: lexing error

I open the toolchain.ninja file with the error:

307 rule __base_build_date___build_toolchain_linux_clang_x64__rule
308   command = python3 ../../build/write_build_date_header.py gen/base/generated_build_date.h 1666540117\
309 \^[\[\?1034h
310   description = ACTION //base:build_date(//build/toolchain/linux:clang_x64)

308 and 309 lines are split. There are a lot of strings to be split like previous two. What type of formatting should I use? Or is there other reason?

Upvotes: 1

Views: 716

Answers (1)

ka899416
ka899416

Reputation: 66

The content of line 309 most likely shouldn't be there. It loks like some of the commands "gn gen" runs end up with trailing garbage. One reason for that could be if your python executable is a wrapper script that decorates output. I'd suggest trying

gn gen out/mybuild --script-executable=/usr/bin/python3.8

(or a different plain Python3 binary)

If it's not helping, I'd recommend adding something like

print(build_timestamp)

at the bottom of build/timestamp.gni, re-run gn, and see what it prints out, to try and figure out where the extra content comes from.

Upvotes: 1

Related Questions