GN: expunge all environment variables that have no effect on GN

This should have no practical effect.  I just want to make sure no
environment variables beyond $PATH have any effect on GN builds.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2300173002

Review-Url: https://codereview.chromium.org/2300173002
This commit is contained in:
mtklein 2016-09-01 13:19:20 -07:00 committed by Commit bot
parent de3184fd84
commit ae509db481
10 changed files with 40 additions and 159 deletions

View File

@ -9,6 +9,11 @@ class GNAndroidFlavorUtils(default_flavor.DefaultFlavorUtils):
def supported(self):
return 'GN_Android' == self.m.vars.builder_cfg.get('extra_config', '')
def _run(self, title, cmd):
path = self.m.vars.default_env['PATH']
self.m.vars.default_env = {'PATH': path}
self.m.run(self.m.step, title, cmd=cmd, cwd=self.m.vars.skia_dir, env={})
def compile(self, unused_target, **kwargs):
compiler = self.m.vars.builder_cfg.get('compiler')
configuration = self.m.vars.builder_cfg.get('configuration')
@ -35,9 +40,6 @@ class GNAndroidFlavorUtils(default_flavor.DefaultFlavorUtils):
'target_cpu': quote(target_arch),
}.iteritems()))
run = lambda title, cmd: self.m.run(self.m.step, title, cmd=cmd,
cwd=self.m.vars.skia_dir, **kwargs)
run('fetch-gn', [self.m.vars.skia_dir.join('bin', 'fetch-gn')])
run('gn gen', ['gn', 'gen', self.out_dir, '--args=' + gn_args])
run('ninja', ['ninja', '-C', self.out_dir])
self._run('fetch-gn', [self.m.vars.skia_dir.join('bin', 'fetch-gn')])
self._run('gn gen', ['gn', 'gen', self.out_dir, '--args=' + gn_args])
self._run('ninja', ['ninja', '-C', self.out_dir])

View File

@ -15,6 +15,11 @@ class GNFlavorUtils(default_flavor.DefaultFlavorUtils):
extra_config.startswith('SK')
])
def _run(self, title, cmd):
path = self.m.vars.default_env['PATH']
self.m.vars.default_env = {'PATH': path}
self.m.run(self.m.step, title, cmd=cmd, cwd=self.m.vars.skia_dir)
def compile(self, unused_target, **kwargs):
"""Build Skia with GN."""
compiler = self.m.vars.builder_cfg.get('compiler', '')
@ -55,9 +60,6 @@ class GNFlavorUtils(default_flavor.DefaultFlavorUtils):
'is_debug': 'true' if configuration == 'Debug' else 'false',
}.iteritems()))
run = lambda title, cmd: self.m.run(self.m.step, title, cmd=cmd,
cwd=self.m.vars.skia_dir, **kwargs)
run('fetch-gn', [self.m.vars.skia_dir.join('bin', 'fetch-gn')])
run('gn gen', ['gn', 'gen', self.out_dir, '--args=' + gn_args])
run('ninja', ['ninja', '-C', self.out_dir])
self._run('fetch-gn', [self.m.vars.skia_dir.join('bin', 'fetch-gn')])
self._run('gn gen', ['gn', 'gen', self.out_dir, '--args=' + gn_args])
self._run('ninja', ['ninja', '-C', self.out_dir])

View File

@ -112,13 +112,7 @@
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Debug",
"CC": "/usr/bin/clang",
"CHROME_HEADLESS": "1",
"CXX": "/usr/bin/clang++",
"GYP_DEFINES": "skia_clang_build=1 skia_warnings_as_errors=0",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Mac-Clang-mipsel-Debug-GN_Android"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "fetch-gn"
},
@ -131,13 +125,7 @@
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Debug",
"CC": "/usr/bin/clang",
"CHROME_HEADLESS": "1",
"CXX": "/usr/bin/clang++",
"GYP_DEFINES": "skia_clang_build=1 skia_warnings_as_errors=0",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Mac-Clang-mipsel-Debug-GN_Android"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "gn gen"
},
@ -149,13 +137,7 @@
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Debug",
"CC": "/usr/bin/clang",
"CHROME_HEADLESS": "1",
"CXX": "/usr/bin/clang++",
"GYP_DEFINES": "skia_clang_build=1 skia_warnings_as_errors=0",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Mac-Clang-mipsel-Debug-GN_Android"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "ninja"
},

View File

@ -112,13 +112,7 @@
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Release",
"CC": "/usr/bin/clang",
"CHROME_HEADLESS": "1",
"CXX": "/usr/bin/clang++",
"GYP_DEFINES": "skia_arch_type=x86_64 skia_clang_build=1 skia_warnings_as_errors=1",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Mac-Clang-x86_64-Release-GN"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "fetch-gn"
},
@ -131,13 +125,7 @@
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Release",
"CC": "/usr/bin/clang",
"CHROME_HEADLESS": "1",
"CXX": "/usr/bin/clang++",
"GYP_DEFINES": "skia_arch_type=x86_64 skia_clang_build=1 skia_warnings_as_errors=1",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Mac-Clang-x86_64-Release-GN"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "gn gen"
},
@ -149,13 +137,7 @@
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Release",
"CC": "/usr/bin/clang",
"CHROME_HEADLESS": "1",
"CXX": "/usr/bin/clang++",
"GYP_DEFINES": "skia_arch_type=x86_64 skia_clang_build=1 skia_warnings_as_errors=1",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Mac-Clang-x86_64-Release-GN"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "ninja"
},

View File

@ -112,13 +112,7 @@
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Release",
"CC": "/usr/bin/clang",
"CHROME_HEADLESS": "1",
"CXX": "/usr/bin/clang++",
"GYP_DEFINES": "skia_clang_build=1 skia_warnings_as_errors=1",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-Clang-arm64-Release-GN_Android"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "fetch-gn"
},
@ -131,13 +125,7 @@
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Release",
"CC": "/usr/bin/clang",
"CHROME_HEADLESS": "1",
"CXX": "/usr/bin/clang++",
"GYP_DEFINES": "skia_clang_build=1 skia_warnings_as_errors=1",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-Clang-arm64-Release-GN_Android"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "gn gen"
},
@ -149,13 +137,7 @@
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Release",
"CC": "/usr/bin/clang",
"CHROME_HEADLESS": "1",
"CXX": "/usr/bin/clang++",
"GYP_DEFINES": "skia_clang_build=1 skia_warnings_as_errors=1",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-Clang-arm64-Release-GN_Android"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "ninja"
},

View File

@ -112,13 +112,7 @@
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Debug",
"CC": "/usr/bin/clang",
"CHROME_HEADLESS": "1",
"CXX": "/usr/bin/clang++",
"GYP_DEFINES": "skia_arch_type=x86_64 skia_clang_build=1 skia_warnings_as_errors=1",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-Clang-x86_64-Debug-GN"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "fetch-gn"
},
@ -131,13 +125,7 @@
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Debug",
"CC": "/usr/bin/clang",
"CHROME_HEADLESS": "1",
"CXX": "/usr/bin/clang++",
"GYP_DEFINES": "skia_arch_type=x86_64 skia_clang_build=1 skia_warnings_as_errors=1",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-Clang-x86_64-Debug-GN"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "gn gen"
},
@ -149,13 +137,7 @@
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Debug",
"CC": "/usr/bin/clang",
"CHROME_HEADLESS": "1",
"CXX": "/usr/bin/clang++",
"GYP_DEFINES": "skia_arch_type=x86_64 skia_clang_build=1 skia_warnings_as_errors=1",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-Clang-x86_64-Debug-GN"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "ninja"
},

View File

@ -112,11 +112,7 @@
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Debug",
"CHROME_HEADLESS": "1",
"GYP_DEFINES": "skia_arch_type=x86_64 skia_warnings_as_errors=1",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86_64-Debug-GN"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "fetch-gn"
},
@ -129,11 +125,7 @@
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Debug",
"CHROME_HEADLESS": "1",
"GYP_DEFINES": "skia_arch_type=x86_64 skia_warnings_as_errors=1",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86_64-Debug-GN"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "gn gen"
},
@ -145,11 +137,7 @@
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Debug",
"CHROME_HEADLESS": "1",
"GYP_DEFINES": "skia_arch_type=x86_64 skia_warnings_as_errors=1",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86_64-Debug-GN"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "ninja"
},

View File

@ -110,12 +110,7 @@
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Debug",
"CHROME_HEADLESS": "1",
"CPPFLAGS": "-DSK_USE_DISCARDABLE_SCALEDIMAGECACHE",
"GYP_DEFINES": "skia_arch_type=x86_64 skia_warnings_as_errors=1",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "fetch-gn"
},
@ -128,12 +123,7 @@
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Debug",
"CHROME_HEADLESS": "1",
"CPPFLAGS": "-DSK_USE_DISCARDABLE_SCALEDIMAGECACHE",
"GYP_DEFINES": "skia_arch_type=x86_64 skia_warnings_as_errors=1",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "gn gen"
},
@ -145,12 +135,7 @@
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Debug",
"CHROME_HEADLESS": "1",
"CPPFLAGS": "-DSK_USE_DISCARDABLE_SCALEDIMAGECACHE",
"GYP_DEFINES": "skia_arch_type=x86_64 skia_warnings_as_errors=1",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "ninja"
},

View File

@ -110,11 +110,7 @@
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Release",
"CHROME_HEADLESS": "1",
"GYP_DEFINES": "skia_arch_type=x86_64 skia_fast=1 skia_warnings_as_errors=0",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86_64-Release-Fast"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "fetch-gn"
},
@ -127,11 +123,7 @@
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Release",
"CHROME_HEADLESS": "1",
"GYP_DEFINES": "skia_arch_type=x86_64 skia_fast=1 skia_warnings_as_errors=0",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86_64-Release-Fast"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "gn gen"
},
@ -143,11 +135,7 @@
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Release",
"CHROME_HEADLESS": "1",
"GYP_DEFINES": "skia_arch_type=x86_64 skia_fast=1 skia_warnings_as_errors=0",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86_64-Release-Fast"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "ninja"
},

View File

@ -80,11 +80,7 @@
],
"cwd": "[CUSTOM_C:\\_B_WORK]\\skia",
"env": {
"BUILDTYPE": "Release",
"CHROME_HEADLESS": "1",
"GYP_DEFINES": "qt_sdk=C:/Qt/4.8.5/ skia_arch_type=x86 skia_warnings_as_errors=1 skia_win_debuggers_path=c:/DbgHelp skia_win_ltcg=0",
"PATH": "%(PATH)s;RECIPE_PACKAGE_REPO[depot_tools];RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_C:\\_B_WORK]\\skia\\out\\Build-Win-MSVC-x86-Release-GN"
"PATH": "%(PATH)s;RECIPE_PACKAGE_REPO[depot_tools];RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "fetch-gn"
},
@ -97,11 +93,7 @@
],
"cwd": "[CUSTOM_C:\\_B_WORK]\\skia",
"env": {
"BUILDTYPE": "Release",
"CHROME_HEADLESS": "1",
"GYP_DEFINES": "qt_sdk=C:/Qt/4.8.5/ skia_arch_type=x86 skia_warnings_as_errors=1 skia_win_debuggers_path=c:/DbgHelp skia_win_ltcg=0",
"PATH": "%(PATH)s;RECIPE_PACKAGE_REPO[depot_tools];RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_C:\\_B_WORK]\\skia\\out\\Build-Win-MSVC-x86-Release-GN"
"PATH": "%(PATH)s;RECIPE_PACKAGE_REPO[depot_tools];RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "gn gen"
},
@ -113,11 +105,7 @@
],
"cwd": "[CUSTOM_C:\\_B_WORK]\\skia",
"env": {
"BUILDTYPE": "Release",
"CHROME_HEADLESS": "1",
"GYP_DEFINES": "qt_sdk=C:/Qt/4.8.5/ skia_arch_type=x86 skia_warnings_as_errors=1 skia_win_debuggers_path=c:/DbgHelp skia_win_ltcg=0",
"PATH": "%(PATH)s;RECIPE_PACKAGE_REPO[depot_tools];RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_C:\\_B_WORK]\\skia\\out\\Build-Win-MSVC-x86-Release-GN"
"PATH": "%(PATH)s;RECIPE_PACKAGE_REPO[depot_tools];RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "ninja"
},