New issue
Advanced search Search tips

Issue 619963 link

Starred by 3 users

Issue metadata

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



Sign in to add a comment

GN args should not be implicitly global

Project Member Reported by brettw@chromium.org, Jun 14 2016

Issue description

Currently all arguments passed in "gn args" are global and are available in every file regardless of whether you've included the file that does declare_args() for it.

This is confusing and should be changed to only apply at the ends of a declare_args() block. The tricky part will be to minimize locking when doing these lookups.
 
Components: Build
Labels: -Pri-3 OS-All Pri-2
I think we should try to fix this sooner rather than later, as it's definitely a source of weird bugs and user questions.
Status: Available (was: Untriaged)

Comment 3 by t...@rnc-ag.de, Jun 17 2016

Can I work on this or is it already handled by someone else?
@tim@rnc-ag.de - I don't think anyone else is actively working on this, so feel free to give it a shot.
Project Member

Comment 5 by bugdroid1@chromium.org, Jul 12 2016

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

commit 5662a8082448584fd3d77f0dba03759b2163e8e5
Author: tim <tim@rnc-ag.de>
Date: Tue Jul 12 00:07:46 2016

GN: Don't define argument overrides globally

Previously, argument overrides (set via "gn args" or toolchain_args()) were
global, even though their default values (set inside declare_args()) were set
locally and thus only available to the file that set them, plus any file that
imported it.

Now, argument overrides are always applied locally, at the end of the
declare_args() block. This ensures that argument defaults and overrides
behave in the same way.

BUG= 619963 

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

[modify] https://crrev.com/5662a8082448584fd3d77f0dba03759b2163e8e5/tools/gn/args.cc
[modify] https://crrev.com/5662a8082448584fd3d77f0dba03759b2163e8e5/tools/gn/args.h
[modify] https://crrev.com/5662a8082448584fd3d77f0dba03759b2163e8e5/tools/gn/args_unittest.cc

Comment 6 by brettw@chromium.org, Jul 12 2016

Status: Fixed (was: Available)

Sign in to add a comment