From 6f7acfe655ed82355582cbd4f4130de9c25b22cb Mon Sep 17 00:00:00 2001 From: Zhizhou Yang Date: Tue, 11 Sep 2018 16:56:12 -0700 Subject: 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 Tested-by: Zhizhou Yang Reviewed-by: Caroline Tice --- binary_search_tool/android/cleanup.sh | 4 ++++ 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 -- cgit v1.2.3