New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 648583 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug

Blocking:
issue 645091



Sign in to add a comment

v8gen.py doesn't run gn on extra args

Project Member Reported by machenb...@chromium.org, Sep 20 2016

Issue description

Ninja automatically regenerates ninja files if build files change, but not if the args.gn file changes. E.g.

tools/dev/v8gen.py x64.release -- is_component_build=true
ninja -C out.gn/x64.release

does not incorporate is_component_build=true as this is appended after the gn run wrapped within v8gen.

This currently either requires passing -p to v8gen.py or running gn manually like
gn gen out.gn/x64.release
 

Comment 1 by jochen@chromium.org, Sep 21 2016

Cc: dpranke@chromium.org brettw@chromium.org thakis@chromium.org
that's not really an v8 issue, but affects gn in general, no?
In this case, we change the args.gn file manually, by just adding a few lines. If you'd do this through "gn args", it'd also always call "gn gen".

I don't know if there's a feature that makes ninja rebuild ninja files when the args.gn file has changed.

Comment 3 by thakis@chromium.org, Sep 21 2016

ninja is supposed to rerun gn when you touch args.gn. It does for me:

thakis@thakis:~/src/chrome/src$ ninja -C out/gnand boringssl
ninja: Entering directory `out/gnand'
[1/1] SOLINK ./libboringssl.cr.so
...
thakis@thakis:~/src/chrome/src$ touch out/gnand/args.gn 
thakis@thakis:~/src/chrome/src$ ninja -C out/gnand boringssl
ninja: Entering directory `out/gnand'
[1/1] Regenerating ninja files    <- ### See here ###
[1/1] SOLINK ./libboringssl.cr.so
Yup, if you're using GN, and look in the build.ninja file in the build directory (out/gnand/build.ninja), you'll see that there's a `build build.ninja: gn` line that lists `depfile = build.ninja.d`. If you look in build.ninja.d, you should see `build.ninja : ... .../args.gn`.
Found it. It's a race. Our wrapper is just too fast, it runs gn, then appends more lines to args.gn. This apparently causes an insufficient timestamp increment to be recognized as modified.

If I e.g. add a time.sleep(1) in between, everything is fine. Prepped a CL that sets artificially higher modified time: https://codereview.chromium.org/2365573002/
Project Member

Comment 6 by bugdroid1@chromium.org, Sep 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/6cd5d73c6c790a59f9e6a78a9c83b7db83ba4dec

commit 6cd5d73c6c790a59f9e6a78a9c83b7db83ba4dec
Author: machenbach <machenbach@chromium.org>
Date: Thu Sep 22 13:31:25 2016

[build] Fix race in v8gen

BUG= chromium:648583 
NOTRY=true

Review-Url: https://codereview.chromium.org/2365573002
Cr-Commit-Position: refs/heads/master@{#39626}

[modify] https://crrev.com/6cd5d73c6c790a59f9e6a78a9c83b7db83ba4dec/tools/dev/v8gen.py

Status: Verified (was: Assigned)

Sign in to add a comment