skia2/infra/bots/recipe_modules/isolate/resources/isolate.py
Eric Boren f94514b0ff [recipes] Copy file, isolate, swarming, swarming_client from build.git
Rename swarming -> skia_swarming.
Some required heavy modification to remove other dependencies on modules
in build.git.

Expected changes:

- RECIPE_MODULE[build::<module>] -> RECIPE_MODULE[skia::<module>]
- No more runit; directly run through Python.

Bug: skia:6628
Change-Id: I1b1370ed387966222ce10731771dbde9020cf542
Reviewed-on: https://skia-review.googlesource.com/17448
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
2017-05-22 13:08:25 +00:00

38 lines
935 B
Python
Executable File

#!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Calls the isolate Go executable in the checkout, failing if it cannot run.
"""
# TODO(djd): make the caller invoke the Go binary directly, kill this script.
import os
import subprocess
import sys
def try_go(path, args):
"""Tries to run the Go implementation of isolate.
"""
luci_go = os.path.join(os.path.dirname(path), 'luci-go')
if sys.platform == 'win32':
exe = os.path.join(luci_go, 'win64', 'isolate.exe')
elif sys.platform == 'darwin':
exe = os.path.join(luci_go, 'mac64', 'isolate')
else:
exe = os.path.join(luci_go, 'linux64', 'isolate')
return subprocess.call([exe] + args)
def main():
path = sys.argv[1]
args = sys.argv[2:]
return try_go(path, args)
if __name__ == '__main__':
sys.exit(main())