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

Issue 603787 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 1
Type: Bug-Regression



Sign in to add a comment

generate_build_files no longer prints GN opts

Project Member Reported by krasin@chromium.org, Apr 15 2016

Issue description

Quite often, I used to lookup generate_build_files logs on the bots to steal the GN args they used, like:
https://build.chromium.org/p/chromium.fyi/builders/CFI%20Linux/builds/5027/steps/generate_build_files/logs/stdio

/b/build/slave/CFI_Linux/build/src/buildtools/linux64/gn gen //out/Release '--args=is_cfi=true is_debug=false is_component_build=false use_goma=true goma_dir="/b/build/slave/CFI_Linux/build/src/build/goma/client"' --check
Done. Wrote 4754 targets from 905 files in 4138ms

Since 13 April, it's no longer true:
https://build.chromium.org/p/chromium.fyi/builders/CFI%20Linux/builds/5028/steps/generate_build_files/logs/stdio

I assume it's an unwanted side effect of some GN / MB -related change. Not sure.
 
Labels: Proj-GN-Migration OS-All
Owner: dpranke@chromium.org
Status: Assigned (was: Untriaged)
Whoops. It's supposed to print them out.

I probably broke something, let me look.
Status: Started (was: Assigned)
Fix posted: https://codereview.chromium.org/1886973004/
Labels: -Type-Bug -Pri-3 Pri-1 Type-Bug-Regression

Comment 4 Deleted

Comment 5 by krasin@chromium.org, Apr 15 2016

Thanks, that was quick!
Project Member

Comment 6 by bugdroid1@chromium.org, Apr 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4ff8b9f33499e3ea73a95e02271ba75a4613b2e8

commit 4ff8b9f33499e3ea73a95e02271ba75a4613b2e8
Author: dpranke <dpranke@chromium.org>
Date: Fri Apr 15 03:07:54 2016

Log the GN args again in `mb gen`.

When I switched MB to write the GN args directly to args.gn
in the build directory, I dropped the logic that made sure
that got logged. Putting that back in.

TBR=krasin@chromium.org
BUG= 603787 

Review URL: https://codereview.chromium.org/1886973004

Cr-Commit-Position: refs/heads/master@{#387529}

[modify] https://crrev.com/4ff8b9f33499e3ea73a95e02271ba75a4613b2e8/tools/mb/mb.py
[modify] https://crrev.com/4ff8b9f33499e3ea73a95e02271ba75a4613b2e8/tools/mb/mb_unittest.py

Comment 7 by krasin@chromium.org, Apr 15 2016

Verified that the fix works:
https://build.chromium.org/p/chromium.fyi/builders/CFI%20Linux/builds/5045/steps/generate_build_files/logs/stdio

Writing """\
goma_dir = "/b/build/slave/CFI_Linux/build/src/build/goma/client"
is_cfi = true
is_component_build = false
is_debug = false
use_goma = true
""" to /b/build/slave/CFI_Linux/build/src/out/Release/args.gn.

/b/build/slave/CFI_Linux/build/src/buildtools/linux64/gn gen //out/Release --check

This is better than nothing, but honestly it's less convenient as I can't just copy-paste the command line to my terminal. But that's minor, I guess.
Status: Fixed (was: Started)
Yup, it's less convenient. 

However, we're gradually switching to a model where the args.gn files contain import(...) statements to share common definitions, and you can't specify an import() with --args. You can see this on a couple bots now, I think.

I need to add another flag to GN to be able to pick up the bot config as a template, at which point you'll be able to say 
`gn gen --template=build/args/bots/chromium.fyi/cfi_linux.gn out/foo`

and hopefully you won't even have to copy/paste at that point.

You can also select the code inside the """ ... """ lines and do:

% mkdir -p out/foo && cat <<EOF > out/foo/args.gn && gn gen out/foo<RETURN>
<PASTE>
EOF
% 

Not quite as convenient, though. I could make it work with --args if I didn't need to use an import() statement, but I doubt it's worth the complexity.

Sign in to add a comment