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

Issue 627978 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit 26 days ago
Closed: Jul 2016
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Loosen GN's set_defaults rules

Project Member Reported by brettw@chromium.org, Jul 13 2016

Issue description

When I originally wrote set_defaults I was concerned about misuse so required exactly one definition and prohibited redefinitions.

I'm no longer concerned about such abuse, and it would be nice in some cases to be more flexible about defining these. It would be nice to have the "test" defaults in "test.gni" but the current rules are even too restrictive for this (collisions in imports for defaults are errors).

We should make it possible to override defaults for a scope.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 14 2016

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

commit af8a964ba300ff17d304c982a0e98605c41637c5
Author: brettw <brettw@chromium.org>
Date: Thu Jul 14 19:33:41 2016

Allow multiple set_default calls in GN.

Allow multipe set_defaults calls in GN to override one another, and allow
imported .gni files with set_defaults calls in them to not collide with
existing defaults settings as long as the settings are the same.

This will allow us to be more flexible with defaults, in particular, to
allow the defaults for templates to move to the template declaration location
rather than having to reside in BUILDCONFIG.

Add an android condition around an android-specific config in base I noticed
when testing this patch.

BUG= 627978 

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

[modify] https://crrev.com/af8a964ba300ff17d304c982a0e98605c41637c5/base/BUILD.gn
[modify] https://crrev.com/af8a964ba300ff17d304c982a0e98605c41637c5/tools/gn/function_set_defaults.cc
[modify] https://crrev.com/af8a964ba300ff17d304c982a0e98605c41637c5/tools/gn/scope.cc
[modify] https://crrev.com/af8a964ba300ff17d304c982a0e98605c41637c5/tools/gn/scope.h

Comment 2 by brettw@chromium.org, Jul 14 2016

Status: Fixed (was: Started)

Sign in to add a comment