summaryrefslogtreecommitdiff
path: root/build_extra/rust/run.py
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-09-06 20:32:58 -0400
committerGitHub <noreply@github.com>2019-09-06 20:32:58 -0400
commitacaff6d05622ec54b37b7f378c2d2b2f723ba8d5 (patch)
treef92184a43b14c8ff6a15709b6e186f3ae1730697 /build_extra/rust/run.py
parent595b4daa77771458457e178b6b590a044cd41ad0 (diff)
Remove tools/build.py (#2865)
Testing regression: ASAN build removed.
Diffstat (limited to 'build_extra/rust/run.py')
-rw-r--r--build_extra/rust/run.py47
1 files changed, 0 insertions, 47 deletions
diff --git a/build_extra/rust/run.py b/build_extra/rust/run.py
deleted file mode 100644
index 7c6bea08a..000000000
--- a/build_extra/rust/run.py
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-
-# This file just executes its arguments, except that it allows overriding
-# environment variables using command-line arguments.
-
-import subprocess
-import sys
-import os
-import re
-
-args = []
-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
- # toolchain. We need to load those environment variables here too in order
- # for rustc to be able to successfully invoke the linker tool.
- # 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.
- 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.
-env["GN_OUT_DIR"] = os.path.abspath(".")
-assert os.path.isdir(env["GN_OUT_DIR"])
-
-# Environment variables can be specified on the command line using
-# '--env=variable=value' flags. These flags are not passed through to rustc.
-# This is useful to set env vars that are normally automatically set by Cargo,
-# e.g. CARGO_PKG_NAME, CARGO_PKG_VERSION, OUT_DIR, etc.
-for arg in sys.argv[1:]:
- match = re.search('--env=([^=]+)=(.*)', arg)
- if match:
- key, value = match.groups()
- if key == "OUT_DIR":
- # OUT_DIR needs to contain an absolute path.
- value = os.path.abspath(value)
- env[key] = value
- else:
- args.append(arg)
-
-sys.exit(subprocess.call(args, env=env))