diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2020-04-28 20:24:56 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-04-28 20:24:56 +0000 |
commit | 656c7c0fa0d9b776c019f5423e01a9a28979d2bd (patch) | |
tree | 220a95d346d58fa5090d8033991bcfef2ad03d99 /compiler_wrapper/bisect_flag.go | |
parent | 091406baac88deeb2ef9c71d5047bd9daf3915ef (diff) | |
parent | ccead650bb8e050400f55dc44b60f989b1f8e117 (diff) | |
download | toolchain-utils-android10-android13-mainline-tzdata-release.tar.gz |
Snap for 6439596 from ccead650bb8e050400f55dc44b60f989b1f8e117 to qt-aml-tzdata-releaseq_tzdata_aml_297100400q_tzdata_aml_297100300q_tzdata_aml_297100000q_tzdata_aml_296200000q_tzdata_aml_295600118q_tzdata_aml_295600110q_tzdata_aml_295500002q_tzdata_aml_295500001q_tzdata_aml_294400310android-mainline-12.0.0_r54android-mainline-12.0.0_r111android-mainline-10.0.0_r13android-mainline-10.0.0_r12android-mainline-10.0.0_r11q_tzdata_aml_297100000android12-mainline-tzdata-releaseandroid10-mainline-tzdata-releaseandroid10-android13-mainline-tzdata-release
Change-Id: I3464301d9b41d48e11dfd361a411d60a1bd5a429
Diffstat (limited to 'compiler_wrapper/bisect_flag.go')
-rw-r--r-- | compiler_wrapper/bisect_flag.go | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/compiler_wrapper/bisect_flag.go b/compiler_wrapper/bisect_flag.go deleted file mode 100644 index 6271e23f..00000000 --- a/compiler_wrapper/bisect_flag.go +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2019 The Chromium OS Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package main - -import ( - "errors" - "path/filepath" -) - -// Note: We keep this code in python as golang has no builtin -// shlex function. -const bisectPythonCommand = ` -import bisect_driver -import shlex -import sys - -def ExpandArgs(args, target): - for arg in args: - if arg[0] == '@': - with open(arg[1:], 'rb') as f: - ExpandArgs(shlex.split(f.read()), target) - else: - target.append(arg) - return target - -stage = sys.argv[1] -dir = sys.argv[2] -execargs = ExpandArgs(sys.argv[3:], []) - -sys.exit(bisect_driver.bisect_driver(stage, dir, execargs)) -` - -func getBisectStage(env env) string { - value, _ := env.getenv("BISECT_STAGE") - return value -} - -func calcBisectCommand(env env, cfg *config, bisectStage string, compilerCmd *command) (*command, error) { - bisectDir, _ := env.getenv("BISECT_DIR") - if bisectDir == "" { - if cfg.isAndroidWrapper { - homeDir, ok := env.getenv("HOME") - if !ok { - return nil, errors.New("$HOME is not set") - } - bisectDir = filepath.Join(homeDir, "ANDROID_BISECT") - } else { - bisectDir = "/tmp/sysroot_bisect" - } - } - absCompilerPath := getAbsCmdPath(env, compilerCmd) - return &command{ - Path: "/usr/bin/env", - Args: append([]string{ - "python", - "-c", - bisectPythonCommand, - bisectStage, - bisectDir, - absCompilerPath, - }, compilerCmd.Args...), - EnvUpdates: compilerCmd.EnvUpdates, - }, nil -} |