summaryrefslogtreecommitdiff
path: root/build_extra/rust/run.py
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2019-07-07 22:39:56 +0200
committerRyan Dahl <ry@tinyclouds.org>2019-07-08 18:18:28 -0400
commit79c3439f269f1e0e24003518e363988fa4f1da33 (patch)
treef2729871f5e3c6743ddceaf60ae86b92b93ac200 /build_extra/rust/run.py
parent958a80e6db9b87985898acf2f4f33e46d4740c3b (diff)
Pass env vars through in build_extra/rust/run.py
This fixes an appveyor issue that arrises when implementing snapshot_creator in Rust.
Diffstat (limited to 'build_extra/rust/run.py')
-rw-r--r--build_extra/rust/run.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/build_extra/rust/run.py b/build_extra/rust/run.py
index cbc22e8ea..3f1adcc55 100644
--- a/build_extra/rust/run.py
+++ b/build_extra/rust/run.py
@@ -7,6 +7,8 @@ import sys
import os
import re
+env = os.environ.copy()
+
if sys.platform == 'win32':
# On Windows, when gn is setting up the build toolchain, it produces a set
# of environment variables that are required to invoke the right build
@@ -15,10 +17,9 @@ if sys.platform == 'win32':
# The file is in 'windows environment block' format, which contains
# multiple 'key=value' pairs, separated by '\0' bytes, and terminated by
# two '\0' bytes at the end.
- env_pairs = open("environment.x64").read()[:-2].split('\0')
- env = dict([pair.split('=', 1) for pair in env_pairs])
-else:
- env = os.environ.copy()
+ gn_env_pairs = open("environment.x64").read()[:-2].split('\0')
+ gn_env = dict([pair.split('=', 1) for pair in gn_env_pairs])
+ env.update(gn_env)
# This is for src/msg.rs to know where to find msg_generated.rs.
# When building with Cargo this variable is set by build.rs.