[fuchsia] Handle host_{cpu,os} vars in DEPS
Inject default values for environment vars now present in DEPS after https://dart-review.googlesource.com/c/sdk/+/85416 Change-Id: Icd43f7b0f379725434d591c6495551529f041979 Reviewed-on: https://dart-review.googlesource.com/c/88140 Reviewed-by: Zach Anderson <zra@google.com> Commit-Queue: Zach Anderson <zra@google.com>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
66fa918fd3
commit
caf321aaa6
@@ -21,6 +21,11 @@ DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..'))
|
||||
|
||||
# Used in parsing the DEPS file.
|
||||
class VarImpl(object):
|
||||
_env_vars = {
|
||||
"host_cpu": "x64",
|
||||
"host_os": "linux",
|
||||
}
|
||||
|
||||
def __init__(self, local_scope):
|
||||
self._local_scope = local_scope
|
||||
|
||||
@@ -28,6 +33,9 @@ class VarImpl(object):
|
||||
"""Implements the Var syntax."""
|
||||
if var_name in self._local_scope.get("vars", {}):
|
||||
return self._local_scope["vars"][var_name]
|
||||
# Inject default values for env variables
|
||||
if var_name in self._env_vars:
|
||||
return self._env_vars[var_name]
|
||||
raise Exception("Var is not defined: %s" % var_name)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user