aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/build_commands.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/servo/build_commands.py')
-rw-r--r--python/servo/build_commands.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py
index cb54497377a..3b87e9aba7e 100644
--- a/python/servo/build_commands.py
+++ b/python/servo/build_commands.py
@@ -256,10 +256,11 @@ class MachCommands(CommandBase):
vs_dirs = self.vs_dirs()
if host != target_triple and 'windows' in target_triple:
- if os.environ.get('VisualStudioVersion'):
+ if os.environ.get('VisualStudioVersion') or os.environ.get('VCINSTALLDIR'):
print("Can't cross-compile for Windows inside of a Visual Studio shell.\n"
"Please run `python mach build [arguments]` to bypass automatic "
- "Visual Studio shell.")
+ "Visual Studio shell, and make sure the VisualStudioVersion and "
+ "VCINSTALLDIR environment variables are not set.")
sys.exit(1)
vcinstalldir = vs_dirs['vcdir']
if not os.path.exists(vcinstalldir):
@@ -315,11 +316,15 @@ class MachCommands(CommandBase):
process = subprocess.Popen('("%s" %s > nul) && "python" -c "import os; print(repr(os.environ))"' %
(os.path.join(vs_dirs['vcdir'], "Auxiliary", "Build", "vcvarsall.bat"), "x64"),
stdout=subprocess.PIPE, shell=True)
- stdout, _ = process.communicate()
+ stdout, stderr = process.communicate()
exitcode = process.wait()
encoding = locale.getpreferredencoding() # See https://stackoverflow.com/a/9228117
if exitcode == 0:
os.environ.update(eval(stdout.decode(encoding)))
+ else:
+ print("Failed to run vcvarsall. stderr:")
+ print(stderr.decode(encoding))
+ exit(1)
# Ensure that GStreamer libraries are accessible when linking.
if 'windows' in target_triple: