diff options
author | Cole Faust <colefaust@google.com> | 2023-01-27 13:49:04 -0800 |
---|---|---|
committer | Cole Faust <colefaust@google.com> | 2023-01-27 13:49:04 -0800 |
commit | cd2a24cfc82510a5171b5ce19bdef9903b3038bf (patch) | |
tree | 1b02716e69f77635a424cf93587eacdfcc264c94 /ci | |
parent | 32f7b8ef667e7fa508a634c06e09482d4a959306 (diff) | |
download | bazel-cd2a24cfc82510a5171b5ce19bdef9903b3038bf.tar.gz |
Remove diffs.sh
Noone had a clear idea for what this should be doing,
so remove it.
Fixes: 266245044
Test: Presubmits
Change-Id: I476ff4bb6d33bab3b1fd5b1e771b4ffa6aea5576
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/diffs.sh | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/ci/diffs.sh b/ci/diffs.sh deleted file mode 100755 index 2752f71d..00000000 --- a/ci/diffs.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash -eux -# checks the diff between legacy Soong built artifacts and their counterparts -# built with bazel/mixed build -export TARGET_PRODUCT=aosp_arm64 -export TARGET_BUILD_VARIANT=userdebug - -build/soong/soong_ui.bash \ - --build-mode \ - --all-modules \ - --dir="$(pwd)" \ - bp2build -build/bazel/bin/bazel build --config=bp2build //build/bazel/scripts/difftool:collect_zip //build/bazel/scripts/difftool:difftool_zip - -readonly COLLECT_ZIP="$(realpath bazel-bin/build/bazel/scripts/difftool/collect.zip)" -readonly DIFFTOOL_ZIP="$(realpath bazel-bin/build/bazel/scripts/difftool/difftool.zip)" - -# the following 2 arrays must be of the same size -MODULES=( - # libnativehelper # TODO(b/266245044) re-enable the test -) -OUTPUTS=( - JNIHelp.o -) -PATH_FILTERS=( - "linux_glibc_x86_shared/\|linux_x86-opt" - "linux_glibc_x86_64_shared/\|linux_x86_64-opt" - "android_arm64[-_]" -# "android_arm[-_]" TODO(usta) investigate why there is a diff for this -) -readonly AOSP_ROOT="$(readlink -f "$(dirname "$0")"/../../..)" -#TODO(usta): absolute path isn't compatible with collect.py and ninja -readonly LEGACY_OUTPUT_SEARCH_TREE="out/soong/.intermediates/libnativehelper" -readonly MIXED_OUTPUT_SEARCH_TREE="out/bazel/output/execroot/__main__/bazel-out" -readonly NINJA_FILE="$AOSP_ROOT/out/combined-$TARGET_PRODUCT.ninja" -# python is expected in PATH but used only to start a zipped python archive, -# which bundles its own interpreter. We could also simply use `build/bazel/bin/bazel run` -# instead however that sets the working directly differently and collect.py -# won't work because it expects paths relative to $OUT_DIR -# TODO(usta) make collect.py work with absolute paths and maybe consider -# using `build/bazel/bin/bazel run` on the `py_binary` target directly instead of using -# the python_zip_file filegroup's output -readonly stub_python=python3 -readonly LEGACY_COLLECTION="$AOSP_ROOT/out/diff_metadata/legacy" -readonly MIXED_COLLECTION="$AOSP_ROOT/out/diff_metadata/mixed" -mkdir -p "$LEGACY_COLLECTION" -mkdir -p "$MIXED_COLLECTION" - -function findIn() { - result=$(find "$1" -name "$3" | grep "$2") - count=$(echo "$result" | wc -l) - if [[ "$count" -ne "1" || -z "$result" ]]; then - printf "Expected 1 file, found:\n%s\nCommand run: find $1 -name $3 | grep $2\n" "$result" >&2 - exit 1 - fi - echo "$result" -} - -for ((i = 0; i < ${#MODULES[@]}; i++)); do - MODULE=${MODULES[$i]} - echo "Building $MODULE for comparison" - build/soong/soong_ui.bash --make-mode "$MODULE" - $stub_python $COLLECT_ZIP \ - "$NINJA_FILE" "$LEGACY_COLLECTION" - # TODO(b/254572169): Remove DISABLE_ARTIFACT_PATH_REQUIREMENT before launching --bazel-mode. - build/soong/soong_ui.bash \ - --make-mode \ - --bazel-mode-dev \ - DISABLE_ARTIFACT_PATH_REQUIREMENTS=true \ - BAZEL_STARTUP_ARGS="--max_idle_secs=5" \ - BAZEL_BUILD_ARGS="--color=no --curses=no --noshow_progress" \ - "$MODULE" - $stub_python $COLLECT_ZIP \ - "$NINJA_FILE" "$MIXED_COLLECTION" - OUTPUT=${OUTPUTS[$i]} - for ((j = 0; j < ${#PATH_FILTERS[@]}; j++)); do - PATH_FILTER=${PATH_FILTERS[$j]} - LEGACY_OUTPUT=$(findIn "$LEGACY_OUTPUT_SEARCH_TREE" "$PATH_FILTER" "$OUTPUT") - MIXED_OUTPUT=$(findIn "$MIXED_OUTPUT_SEARCH_TREE" "$PATH_FILTER" "$OUTPUT") - - LEGACY_COLLECTION_DIR=$(dirname "$LEGACY_COLLECTION/$LEGACY_OUTPUT") - mkdir -p "$LEGACY_COLLECTION_DIR" - cp "$LEGACY_OUTPUT" "$LEGACY_COLLECTION_DIR" - MIXED_COLLECTION_DIR=$(dirname "$MIXED_COLLECTION/$MIXED_OUTPUT") - mkdir -p "$MIXED_COLLECTION_DIR" - cp "$MIXED_OUTPUT" "$MIXED_COLLECTION_DIR" - - $stub_python $DIFFTOOL_ZIP \ - --level=SEVERE -v "$LEGACY_COLLECTION" "$MIXED_COLLECTION" \ - -l="$LEGACY_OUTPUT" -r="$MIXED_OUTPUT" - done -done - |