diff options
author | UK992 <urbankrajnc92@gmail.com> | 2016-08-05 22:47:27 +0200 |
---|---|---|
committer | UK992 <urbankrajnc92@gmail.com> | 2016-08-05 22:47:27 +0200 |
commit | 6548325bd294b55141b1663c5ee91a6a28702962 (patch) | |
tree | ae2e97cc36619f502ab4bead9c3396e39b2a62c1 /python | |
parent | fc4fc773b4c62fb1b63f7f9aabea9fa44283e6ad (diff) | |
download | servo-6548325bd294b55141b1663c5ee91a6a28702962.tar.gz servo-6548325bd294b55141b1663c5ee91a6a28702962.zip |
Run git command only with mach build commands
Diffstat (limited to 'python')
-rw-r--r-- | python/servo/build_commands.py | 6 | ||||
-rw-r--r-- | python/servo/command_base.py | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index df727e2776f..275b2309f2e 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -209,7 +209,7 @@ class MachCommands(CommandBase): opts += ["--features", "%s" % ' '.join(features)] build_start = time() - env = self.build_env(target=target) + env = self.build_env(target=target, is_build=True) if android: # Build OpenSSL for android @@ -299,7 +299,7 @@ class MachCommands(CommandBase): build_start = time() with cd(path.join("ports", "cef")): ret = call(["cargo", "build"] + opts, - env=self.build_env(), verbose=verbose) + env=self.build_env(is_build=True), verbose=verbose) elapsed = time() - build_start # Generate Desktop Notification if elapsed-time > some threshold value @@ -334,7 +334,7 @@ class MachCommands(CommandBase): if release: opts += ["--release"] - env = self.build_env() + env = self.build_env(is_build=True) env["CARGO_TARGET_DIR"] = path.join(self.context.topdir, "target", "geckolib").encode("UTF-8") build_start = time() diff --git a/python/servo/command_base.py b/python/servo/command_base.py index a6b6e1abcd2..99dc78235ed 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -348,7 +348,7 @@ class CommandBase(object): " --release" if release else "")) sys.exit() - def build_env(self, hosts_file_path=None, target=None): + def build_env(self, hosts_file_path=None, target=None, is_build=False): """Return an extended environment dictionary.""" env = os.environ.copy() if sys.platform == "win32" and type(env['PATH']) == unicode: @@ -445,7 +445,7 @@ class CommandBase(object): env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " -W unused-extern-crates" git_info = [] - if os.path.isdir('.git'): + if os.path.isdir('.git') and is_build: git_sha = subprocess.check_output([ 'git', 'rev-parse', '--short', 'HEAD' ]).strip() |