diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/build-aml-prebuilts.sh | 4 | ||||
| -rwxr-xr-x | scripts/build-mainline-modules.sh | 3 | ||||
| -rwxr-xr-x | scripts/build-ndk-prebuilts.sh | 2 | ||||
| -rw-r--r-- | scripts/check_boot_jars/package_allowed_list.txt | 1 | ||||
| -rwxr-xr-x | scripts/gen_ndk_backedby_apex.sh | 41 | ||||
| -rwxr-xr-x | scripts/manifest_check.py | 32 | ||||
| -rwxr-xr-x | scripts/rbc-run | 28 |
7 files changed, 55 insertions, 56 deletions
diff --git a/scripts/build-aml-prebuilts.sh b/scripts/build-aml-prebuilts.sh index 8a5513ee3..1a16f7c7d 100755 --- a/scripts/build-aml-prebuilts.sh +++ b/scripts/build-aml-prebuilts.sh @@ -23,10 +23,10 @@ fi export OUT_DIR=${OUT_DIR:-out} if [ -e ${OUT_DIR}/soong/.soong.kati_enabled ]; then - # If ${OUT_DIR} has been created without --skip-make, Soong will create an + # If ${OUT_DIR} has been created without --soong-only, Soong will create an # ${OUT_DIR}/soong/build.ninja that leaves out many targets which are # expected to be supplied by the .mk files, and that might cause errors in - # "m --skip-make" below. We therefore default to a different out dir + # "m --soong-only" below. We therefore default to a different out dir # location in that case. AML_OUT_DIR=out/aml echo "Avoiding in-make OUT_DIR '${OUT_DIR}' - building in '${AML_OUT_DIR}' instead" diff --git a/scripts/build-mainline-modules.sh b/scripts/build-mainline-modules.sh index b05861ba1..f183c0520 100755 --- a/scripts/build-mainline-modules.sh +++ b/scripts/build-mainline-modules.sh @@ -17,6 +17,7 @@ MAINLINE_MODULES=( MODULES_SDK_AND_EXPORTS=( art-module-sdk art-module-test-exports + compos-module-sdk conscrypt-module-host-exports conscrypt-module-sdk conscrypt-module-test-exports @@ -98,7 +99,7 @@ done export FORCE_BUILD_LLVM_COMPONENTS=true # Create multi-archs SDKs in a different out directory. The multi-arch script -# uses Soong in --skip-make mode which cannot use the same directory as normal +# uses Soong in --soong-only mode which cannot use the same directory as normal # mode with make. export OUT_DIR=${OUT_DIR}/aml echo_and_run build/soong/scripts/build-aml-prebuilts.sh \ diff --git a/scripts/build-ndk-prebuilts.sh b/scripts/build-ndk-prebuilts.sh index a1fa48dc1..4783037b2 100755 --- a/scripts/build-ndk-prebuilts.sh +++ b/scripts/build-ndk-prebuilts.sh @@ -64,7 +64,7 @@ cat > ${SOONG_OUT}/soong.variables << EOF "MissingUsesLibraries": ${MISSING_USES_LIBRARIES} } EOF -m --skip-make ${SOONG_OUT}/ndk.timestamp +m --soong-only --skip-config ${SOONG_OUT}/ndk.timestamp if [ -n "${DIST_DIR}" ]; then mkdir -p ${DIST_DIR} || true diff --git a/scripts/check_boot_jars/package_allowed_list.txt b/scripts/check_boot_jars/package_allowed_list.txt index b1b1e7e60..ed63651ef 100644 --- a/scripts/check_boot_jars/package_allowed_list.txt +++ b/scripts/check_boot_jars/package_allowed_list.txt @@ -69,6 +69,7 @@ javax\.xml\.transform\.sax javax\.xml\.transform\.stream javax\.xml\.validation javax\.xml\.xpath +jdk\.internal jdk\.internal\.math jdk\.internal\.misc jdk\.internal\.reflect diff --git a/scripts/gen_ndk_backedby_apex.sh b/scripts/gen_ndk_backedby_apex.sh index 4abaaba41..212362e03 100755 --- a/scripts/gen_ndk_backedby_apex.sh +++ b/scripts/gen_ndk_backedby_apex.sh @@ -21,52 +21,29 @@ # After the parse function below "dlopen" would be write to the output file. printHelp() { echo "**************************** Usage Instructions ****************************" - echo "This script is used to generate the Mainline modules backed-by NDK symbols." + echo "This script is used to generate the native libraries backed by Mainline modules." echo "" - echo "To run this script use: ./gen_ndk_backed_by_apex.sh \$OUTPUT_FILE_PATH \$NDK_LIB_NAME_LIST \$MODULE_LIB1 \$MODULE_LIB2..." + echo "To run this script use: ./gen_ndk_backed_by_apex.sh \$OUTPUT_FILE_PATH \$MODULE_LIB1 \$MODULE_LIB2..." echo "For example: If output write to /backedby.txt then the command would be:" - echo "./gen_ndk_backed_by_apex.sh /backedby.txt /ndkLibList.txt lib1.so lib2.so" + echo "./gen_ndk_backed_by_apex.sh /backedby.txt lib1.so lib2.so" echo "If the module1 is backing lib1 then the backedby.txt would contains: " - echo "lib1" + echo "lib1.so lib2.so" } -contains() { - val="$1" - shift - for x in "$@"; do - if [ "$x" = "$val" ]; then - return 0 - fi - done - return 1 -} - - -genBackedByList() { +genAllBackedByList() { out="$1" shift - ndk_list="$1" - shift rm -f "$out" touch "$out" - while IFS= read -r line - do - soFileName=$(echo "$line" | sed 's/\(.*so\).*/\1/') - if [[ ! -z "$soFileName" && "$soFileName" != *"#"* ]] - then - if contains "$soFileName" "$@"; then - echo "$soFileName" >> "$out" - fi - fi - done < "$ndk_list" + echo "$@" >> "$out" } if [[ "$1" == "help" ]] then printHelp -elif [[ "$#" -lt 2 ]] +elif [[ "$#" -lt 1 ]] then - echo "Wrong argument length. Expecting at least 2 argument representing output path, path to ndk library list, followed by a list of libraries in the Mainline module." + echo "Wrong argument length. Expecting at least 1 argument representing output path, followed by a list of libraries in the Mainline module." else - genBackedByList "$@" + genAllBackedByList "$@" fi diff --git a/scripts/manifest_check.py b/scripts/manifest_check.py index b4936b865..8bed52a9f 100755 --- a/scripts/manifest_check.py +++ b/scripts/manifest_check.py @@ -84,6 +84,13 @@ def parse_args(): return parser.parse_args() +C_RED = "\033[1;31m" +C_GREEN = "\033[1;32m" +C_BLUE = "\033[1;34m" +C_OFF = "\033[0m" +C_BOLD = "\033[1m" + + def enforce_uses_libraries(manifest, required, optional, relax, is_apk, path): """Verify that the <uses-library> tags in the manifest match those provided @@ -119,22 +126,21 @@ def enforce_uses_libraries(manifest, required, optional, relax, is_apk, path): errmsg = ''.join([ 'mismatch in the <uses-library> tags between the build system and the ' 'manifest:\n', - '\t- required libraries in build system: [%s]\n' % ', '.join(required), - '\t vs. in the manifest: [%s]\n' % - ', '.join(manifest_required), - '\t- optional libraries in build system: [%s]\n' % ', '.join(optional), - '\t vs. in the manifest: [%s]\n' % - ', '.join(manifest_optional), + '\t- required libraries in build system: %s[%s]%s\n' % (C_RED, ', '.join(required), C_OFF), + '\t vs. in the manifest: %s[%s]%s\n' % (C_RED, ', '.join(manifest_required), C_OFF), + '\t- optional libraries in build system: %s[%s]%s\n' % (C_RED, ', '.join(optional), C_OFF), + '\t vs. in the manifest: %s[%s]%s\n' % (C_RED, ', '.join(manifest_optional), C_OFF), '\t- tags in the manifest (%s):\n' % path, '\t\t%s\n' % '\t\t'.join(tags), - 'note: the following options are available:\n', + '%snote:%s the following options are available:\n' % (C_BLUE, C_OFF), '\t- to temporarily disable the check on command line, rebuild with ', - 'RELAX_USES_LIBRARY_CHECK=true (this will set compiler filter "verify" ', - 'and disable AOT-compilation in dexpreopt)\n', + '%sRELAX_USES_LIBRARY_CHECK=true%s' % (C_BOLD, C_OFF), + ' (this will set compiler filter "verify" and disable AOT-compilation in dexpreopt)\n', '\t- to temporarily disable the check for the whole product, set ', - 'PRODUCT_BROKEN_VERIFY_USES_LIBRARIES := true in the product makefiles\n', - '\t- to fix the check, make build system properties coherent with the ' - 'manifest\n', '\t- see build/make/Changes.md for details\n' + '%sPRODUCT_BROKEN_VERIFY_USES_LIBRARIES := true%s in the product makefiles\n' % (C_BOLD, C_OFF), + '\t- to fix the check, make build system properties coherent with the manifest\n', + '\t- for details, see %sbuild/make/Changes.md%s' % (C_GREEN, C_OFF), + ' and %shttps://source.android.com/devices/tech/dalvik/art-class-loader-context%s\n' % (C_GREEN, C_OFF) ]) #pylint: enable=line-too-long @@ -380,7 +386,7 @@ def main(): # pylint: disable=broad-except except Exception as err: - print('error: ' + str(err), file=sys.stderr) + print('%serror:%s ' % (C_RED, C_OFF) + str(err), file=sys.stderr) sys.exit(-1) diff --git a/scripts/rbc-run b/scripts/rbc-run index a0907cfb4..9d3019956 100755 --- a/scripts/rbc-run +++ b/scripts/rbc-run @@ -4,12 +4,26 @@ # that will be passed to rbcrun. [[ $# -gt 0 && -f "$1" ]] || { echo "Usage: ${0##*/} product.mk [Additional rbcrun arguments]" >&2; exit 1; } set -eu -declare -r output_root=${OUT_DIR:-out} -declare -r runner="$output_root/soong/.bootstrap/bin/rbcrun" -declare -r converter="$output_root/soong/.bootstrap/bin/mk2rbc" -declare -r launcher=$output_root/launchers/run.rbc -declare -r makefile=$1 + +case $(uname -s) in + Linux) + declare -r os="linux-x86"; + ;; + Darwin) + declare -r os="darwin-x86"; + ;; + *) + echo "Unknown OS: $(uname -s)" >&2; + exit 1; + ;; +esac + +declare -r output_root="${OUT_DIR:-out}" +declare -r runner="${output_root}/soong/host/${os}/bin/rbcrun" +declare -r converter="${output_root}/soong/host/${os}/bin/mk2rbc" +declare -r launcher="$output_root/launchers/run.rbc" +declare -r makefile="$1" shift -$converter -mode=write -r --outdir $output_root --launcher=$launcher $makefile -$runner RBC_OUT="make,global" RBC_DEBUG="${RBC_DEBUG:-}" $@ $launcher +"$converter" -mode=write -r --outdir "$output_root" --launcher="$launcher" "$makefile" +"$runner" RBC_OUT="make,global" RBC_DEBUG="${RBC_DEBUG:-}" $@ "$launcher" |