diff options
author | Zhizhou Yang <zhizhouy@google.com> | 2018-09-11 16:56:12 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-09-17 21:34:53 -0700 |
commit | 6f7acfe655ed82355582cbd4f4130de9c25b22cb (patch) | |
tree | f00f4233a730930fce7ea921d0a8cb44ea775699 | |
parent | a41db03e5e0e4a77bceb9432927b37f19dc57569 (diff) | |
download | toolchain-utils-6f7acfe655ed82355582cbd4f4130de9c25b22cb.tar.gz |
bisect tool: Symbolic link re-generated bad item to original one
This patch modifies the way to genearte bad item while pass level
bisection. Rather than directly overwrite the old object, we generate it
to a tmp file and symblic link it to original one to satisfy building
tool.
BUG=chromium:878954
TEST=Ran test successfully with Android compiler wrapper.
Change-Id: If152742e0a2088e9d8c2456bf046cede938d88d3
Reviewed-on: https://chromium-review.googlesource.com/1220016
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Zhizhou Yang <zhizhouy@google.com>
Reviewed-by: Caroline Tice <cmtice@chromium.org>
-rwxr-xr-x | binary_search_tool/android/cleanup.sh | 4 | ||||
-rwxr-xr-x | binary_search_tool/android/generate_cmd.sh | 14 |
2 files changed, 15 insertions, 3 deletions
diff --git a/binary_search_tool/android/cleanup.sh b/binary_search_tool/android/cleanup.sh index c89c337d..759b3ed4 100755 --- a/binary_search_tool/android/cleanup.sh +++ b/binary_search_tool/android/cleanup.sh @@ -9,3 +9,7 @@ # rm android/common.sh +# Remove build command script if pass_bisect enabled +rm -f android/cmd_script.sh +# Remove tmp IR file used for ir_diff in pass beisction +rm -f /tmp/bisection_bad_item.o diff --git a/binary_search_tool/android/generate_cmd.sh b/binary_search_tool/android/generate_cmd.sh index 7db3e7e0..78a39b12 100755 --- a/binary_search_tool/android/generate_cmd.sh +++ b/binary_search_tool/android/generate_cmd.sh @@ -1,4 +1,4 @@ -#!/bin/bash -u +#!/bin/bash -eu # Copyright 2018 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be @@ -28,14 +28,22 @@ output+='source android/common.sh\n' result=$(egrep -m 1 -- "${item}" ${populate_log}) +# Re-generate bad item to tmp directory location +tmp_ir='/tmp/bisection_bad_item.o' +result=$(sed "s|$item|-o $tmp_ir |g" <<< ${result}) + # Remove `:` after cd command -result=$(sed 's/cd\:/cd/g' <<< ${result}) +result=$(sed 's|cd:|cd|g' <<< ${result}) # Add environment variable which helps pass level bisection -result=$(sed 's/ \-o / $LIMIT_FLAGS \-o /g' <<< ${result}) +result=$(sed 's| -o | $LIMIT_FLAGS -o |g' <<< ${result}) output+=${result} +# Symbolic link generated bad item to original object +output+="\nln -f $tmp_ir $abs_path" +output+="\ntouch $abs_path" + echo -e "${output}" > android/cmd_script.sh chmod u+x android/cmd_script.sh |