1#!/usr/bin/env python 2# Copyright 2015 The Chromium Authors. All rights reserved. 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5 6"""Calls the isolate Go executable in the checkout, failing if it cannot run. 7""" 8 9# TODO(djd): make the caller invoke the Go binary directly, kill this script. 10 11import os 12import subprocess 13import sys 14 15 16def try_go(path, args): 17 """Tries to run the Go implementation of isolate. 18 """ 19 luci_go = os.path.join(os.path.dirname(path), 'luci-go') 20 if sys.platform == 'win32': 21 exe = os.path.join(luci_go, 'win64', 'isolate.exe') 22 elif sys.platform == 'darwin': 23 exe = os.path.join(luci_go, 'mac64', 'isolate') 24 else: 25 exe = os.path.join(luci_go, 'linux64', 'isolate') 26 27 return subprocess.call([exe] + args) 28 29 30def main(): 31 path = sys.argv[1] 32 args = sys.argv[2:] 33 return try_go(path, args) 34 35 36if __name__ == '__main__': 37 sys.exit(main()) 38