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

Issue 591953 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

gn format produces broken output

Project Member Reported by jochen@chromium.org, Mar 4 2016

Issue description

when you run git cl format on BUILD.gn in V8, it'll sort all sources = [] blocks.

However, the actions like js2c depend on the exact order of files in sources = [] i.e. prologue.js has to be the first file.

maybe don't sort sources blocks for actions? Or is there a way to annotate them so they're not sorted?
 
Cc: scottmg@chromium.org
interesting. I can see how there might not be an easy workaround for this, short of keeping the list of files outside of GN, which would be unfortunate.

I think adding some sort of annotation like `# order-sensitive` as the first line of the sources list (or something) may be the way to go.
I'm ambivalent about whether we should just not sort sources for actions. I can add support for an annotation.
I don't think you can really know. Most of our actions are run via a template and you don't know what they'll end up in. On the other side, some things like components are also templates and you couldn't know that it's not an action.
Cc: thakis@chromium.org
I started adding a "# NOSORT", but Nico had a reasonable idea -- we could break up sources blocks instead, i.e. 

sources = []
sources += [a.js]
sources += [b.js]

when order is required. Does that seem workable since it's a pretty unusual case?
https://codereview.chromium.org/1766163002 adds a "# NOSORT" annotation.
# NOSORT seems cleaner than breaking things up to me ...
Cc: -scottmg@chromium.org brettw@chromium.org
Owner: scottmg@chromium.org
Status: Fixed (was: Untriaged)
Needs a roll to be applied in v8/chrome.

Sign in to add a comment