"gn gen" Isn't Working

854 views
Skip to first unread message

jord...@google.com

unread,
Mar 20, 2019, 8:38:22 PM3/20/19
to Chromium-dev
I started working in the Chromium codebase for the first time in months starting a couple weeks ago in order to bisect some settings regressions. I've been experiencing a ton of problems with building/syncing etc., especially when I'm looking at old checkouts. I deleted and reinstalled Chromium a couple times when I got in very strange states

My issue now is that when I run my standard "gn gen" for building linux-cros, i.e.
$ gn gen out/Default --args="target_os = \"chromeos\" use_goma=true"
I get on the following error:
ERROR at //build/config/jumbo.gni:104:3: Unknown function.
  not_needed([ "gen_target_dir" ])  # Prevent "unused variable".

I tried commenting it out, but every time I commented something out and ran my command, I would get a new (but similar) failure.

jamescook@ pointed out that by gn binary doesn't seem to be updating properly and the output of
$ gn --version
on my workstation is "465654", while other everyone else I've talked to has something following the pattern 14[0-9]{2} \([a-z0-9]{8}\)

Christian Biesinger

unread,
Mar 20, 2019, 8:40:04 PM3/20/19
to jord...@google.com, Chromium-dev
Is your depot_tools up to date? (E.g. try "git log" in depot_tools, or
"git pull --rebase")

Christian
> --
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev
> ---
> You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
> To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/94da2075-3349-4413-abc9-c31722cbcfd1%40chromium.org.

Jordy Greenblatt

unread,
Mar 20, 2019, 8:48:15 PM3/20/19
to Christian Biesinger, Chromium-dev
Yes, I cloned them today.

Christian Biesinger

unread,
Mar 20, 2019, 8:52:09 PM3/20/19
to Jordy Greenblatt, Chromium-dev
And gclient runhooks succeeds?

Christian

Jordy Greenblatt

unread,
Mar 20, 2019, 8:56:46 PM3/20/19
to Christian Biesinger, Chromium-dev
Yes:

jordynass@jordynass:~/chromium/src$ gclient runhooks
Running hooks: 100% (77/77), done.                                
+===================================================+
|   METRICS COLLECTION WILL START IN 7 EXECUTIONS   |
|                                                   |
| To suppress this message opt in or out using:     |
| $ gclient metrics [--opt-in] [--opt-out]          |
| For more information please see metrics.README.md |
| in your depot_tools checkout or visit             |
| https://goo.gl/yNpRDV.                            |
+===================================================+
jordynass@jordynass:~/chromium/src$ 

Christian Biesinger

unread,
Mar 20, 2019, 9:04:15 PM3/20/19
to Jordy Greenblatt, Chromium-dev
Do you have ./buildtools/linux64/gn (adjust for platform as necessary)
in the src/ directory, and if yes is it the current version?

(Maybe try deleting it and re-running hooks?)

Christian

Dirk Pranke

unread,
Mar 20, 2019, 9:06:45 PM3/20/19
to Jordy Greenblatt, Chromium-dev, Christian Biesinger
Please see my response to the other thread, too. Sorry, I didn't realize there were two threads on this topic :(.

-- Dirk

Nico Weber

unread,
Mar 20, 2019, 9:44:01 PM3/20/19
to Dirk Pranke, Jordy Greenblatt, Chromium-dev, Christian Biesinger

Dirk Pranke

unread,
Mar 20, 2019, 10:24:44 PM3/20/19
to Nico Weber, Jordy Greenblatt, Chromium-dev, Christian Biesinger
The syncing-across-buildtools issue is similar, but not directly the same problem.

Recently (r641353 from Mar 15) I switched GN from being installed via a gclient hook that downloaded a binary from a Google Cloud Storage Bucket to installing via CIPD (the current mechanism we encourage people to use to install versions of binary packages).

Unfortunately, as it turns out, we chose to install the CIPD version into the same location the old binary was, and that means that if you happen to sync back to an old enough version of the code to get an older GN (older than 4 months ago, because that's how long it's been since we actually rolled GN, even though we changed how we pull it in as thakis says), then the  hook would copy the old binary on top of the CIPD binary, but the CIPD package manager didn't realize that, and so it thinks the version is up to date when it isn't.

And, it looks like that's what Jordy was doing. 

In the meantime, if you think you're hitting something like this, the workaround is to run `rm -fr buildtools/linux64/{.versions,gn} && gclient sync` to force cipd to reinstall things.

I've filed crbug.com/944367 to work on a fix.

-- Dirk

Jordy Greenblatt

unread,
Mar 21, 2019, 2:23:55 PM3/21/19
to Dirk Pranke, Nico Weber, Chromium-dev, Christian Biesinger
Thank you very much, Dirk. I can confirm that I just successfully build a Chromium commit from yesterday (6dc4886cc880fb21e4046f4af5c95a82091c358c) and open virtual CrOS on my workspace, which I was unable to do before running 'rm -fr buildtools/linux64/{.versions,gn} && gclient sync'.
Reply all
Reply to author
Forward
0 new messages