From 45715b2a88c8daf5a721ce9b28391120f5507764 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Wed, 15 Feb 2017 17:18:01 -0800 Subject: [PATCH] Run the versioner as part of the build. Running this periodically and checking in the results is not working out, since the result is just that I'm having to spend a lot of time cleaning up the headers every time I need to update them in the NDK. Run the versioner as part of the build instead. This way bionic header changes behave like the rest of the NDK headers and will affect NDK builds in the platform *immediately*. Remove the preupload hook for the versioner since it's part of the normal build now. The versioner's dependencies directory needs to be moved because soong won't let us try to do things outside our module's directory (in this case libc). Unfortunately this means we need to build the versioner for Darwin, because we now need it to perform a platform build. Test: make checkbuild Bug: None Change-Id: Icdab8a962354d9e945072dc3f806baea376c8db4 --- PREUPLOAD.cfg | 1 - libc/Android.bp | 15 +++--- libc/versioner-dependencies/arm/arch-arm | 1 + .../arm/kernel_uapi_asm-arm | 1 + libc/versioner-dependencies/arm64/arch-arm64 | 1 + .../arm64/kernel_uapi_asm-arm64 | 1 + .../common/clang-builtins | 1 + .../common/kernel_android_uapi | 1 + .../versioner-dependencies/common/kernel_uapi | 1 + libc/versioner-dependencies/mips/arch-mips | 1 + .../mips/kernel_uapi_asm-mips | 1 + .../versioner-dependencies/mips64/arch-mips64 | 1 + .../mips64/kernel_uapi_asm-mips | 1 + libc/versioner-dependencies/x86/arch-x86 | 1 + .../x86/kernel_uapi_asm-x86 | 1 + .../versioner-dependencies/x86_64/arch-x86_64 | 1 + .../x86_64/kernel_uapi_asm-x86 | 1 + tools/update_headers.sh | 53 ------------------- tools/versioner/dependencies/arm/arch-arm | 1 - .../dependencies/arm/kernel_uapi_asm-arm | 1 - tools/versioner/dependencies/arm64/arch-arm64 | 1 - .../dependencies/arm64/kernel_uapi_asm-arm64 | 1 - .../dependencies/common/clang-builtins | 1 - .../dependencies/common/kernel_android_uapi | 1 - .../versioner/dependencies/common/kernel_uapi | 1 - tools/versioner/dependencies/mips/arch-mips | 1 - .../dependencies/mips/kernel_uapi_asm-mips | 1 - .../versioner/dependencies/mips64/arch-mips64 | 1 - .../dependencies/mips64/kernel_uapi_asm-mips | 1 - tools/versioner/dependencies/x86/arch-x86 | 1 - .../dependencies/x86/kernel_uapi_asm-x86 | 1 - .../versioner/dependencies/x86_64/arch-x86_64 | 1 - .../dependencies/x86_64/kernel_uapi_asm-x86 | 1 - tools/versioner/preupload.sh | 9 ---- tools/versioner/src/Android.bp | 3 -- 35 files changed, 21 insertions(+), 90 deletions(-) create mode 120000 libc/versioner-dependencies/arm/arch-arm create mode 120000 libc/versioner-dependencies/arm/kernel_uapi_asm-arm create mode 120000 libc/versioner-dependencies/arm64/arch-arm64 create mode 120000 libc/versioner-dependencies/arm64/kernel_uapi_asm-arm64 create mode 120000 libc/versioner-dependencies/common/clang-builtins create mode 120000 libc/versioner-dependencies/common/kernel_android_uapi create mode 120000 libc/versioner-dependencies/common/kernel_uapi create mode 120000 libc/versioner-dependencies/mips/arch-mips create mode 120000 libc/versioner-dependencies/mips/kernel_uapi_asm-mips create mode 120000 libc/versioner-dependencies/mips64/arch-mips64 create mode 120000 libc/versioner-dependencies/mips64/kernel_uapi_asm-mips create mode 120000 libc/versioner-dependencies/x86/arch-x86 create mode 120000 libc/versioner-dependencies/x86/kernel_uapi_asm-x86 create mode 120000 libc/versioner-dependencies/x86_64/arch-x86_64 create mode 120000 libc/versioner-dependencies/x86_64/kernel_uapi_asm-x86 delete mode 100755 tools/update_headers.sh delete mode 120000 tools/versioner/dependencies/arm/arch-arm delete mode 120000 tools/versioner/dependencies/arm/kernel_uapi_asm-arm delete mode 120000 tools/versioner/dependencies/arm64/arch-arm64 delete mode 120000 tools/versioner/dependencies/arm64/kernel_uapi_asm-arm64 delete mode 120000 tools/versioner/dependencies/common/clang-builtins delete mode 120000 tools/versioner/dependencies/common/kernel_android_uapi delete mode 120000 tools/versioner/dependencies/common/kernel_uapi delete mode 120000 tools/versioner/dependencies/mips/arch-mips delete mode 120000 tools/versioner/dependencies/mips/kernel_uapi_asm-mips delete mode 120000 tools/versioner/dependencies/mips64/arch-mips64 delete mode 120000 tools/versioner/dependencies/mips64/kernel_uapi_asm-mips delete mode 120000 tools/versioner/dependencies/x86/arch-x86 delete mode 120000 tools/versioner/dependencies/x86/kernel_uapi_asm-x86 delete mode 120000 tools/versioner/dependencies/x86_64/arch-x86_64 delete mode 120000 tools/versioner/dependencies/x86_64/kernel_uapi_asm-x86 delete mode 100755 tools/versioner/preupload.sh diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg index 125b469f4..7b533a472 100644 --- a/PREUPLOAD.cfg +++ b/PREUPLOAD.cfg @@ -1,3 +1,2 @@ [Hook Scripts] -versioner = tools/versioner/preupload.sh notice = tools/update_notice.sh diff --git a/libc/Android.bp b/libc/Android.bp index f663a978a..0d6f3cd40 100644 --- a/libc/Android.bp +++ b/libc/Android.bp @@ -2012,15 +2012,12 @@ cc_object { defaults: ["crt_defaults"], } -// The following module lives in prebuilts/ndk because we need to preprocess the -// headers to include ifdef guards for __ANDROID_API__. Update with -// bionic/tools/update_headers.sh. -// ndk_headers { -// name: "common_libc", -// from: "include", -// to: "", -// srcs: ["include/**/*.h"], -// } +preprocessed_ndk_headers { + name: "common_libc", + from: "include", + to: "", + license: "NOTICE", +} ndk_headers { name: "libc_uapi", diff --git a/libc/versioner-dependencies/arm/arch-arm b/libc/versioner-dependencies/arm/arch-arm new file mode 120000 index 000000000..cc94225a7 --- /dev/null +++ b/libc/versioner-dependencies/arm/arch-arm @@ -0,0 +1 @@ +../../arch-arm/include/ \ No newline at end of file diff --git a/libc/versioner-dependencies/arm/kernel_uapi_asm-arm b/libc/versioner-dependencies/arm/kernel_uapi_asm-arm new file mode 120000 index 000000000..3c7584dec --- /dev/null +++ b/libc/versioner-dependencies/arm/kernel_uapi_asm-arm @@ -0,0 +1 @@ +../../kernel/uapi/asm-arm \ No newline at end of file diff --git a/libc/versioner-dependencies/arm64/arch-arm64 b/libc/versioner-dependencies/arm64/arch-arm64 new file mode 120000 index 000000000..2d9128afd --- /dev/null +++ b/libc/versioner-dependencies/arm64/arch-arm64 @@ -0,0 +1 @@ +../../arch-arm64/include/ \ No newline at end of file diff --git a/libc/versioner-dependencies/arm64/kernel_uapi_asm-arm64 b/libc/versioner-dependencies/arm64/kernel_uapi_asm-arm64 new file mode 120000 index 000000000..7ee6fd21f --- /dev/null +++ b/libc/versioner-dependencies/arm64/kernel_uapi_asm-arm64 @@ -0,0 +1 @@ +../../kernel/uapi/asm-arm64 \ No newline at end of file diff --git a/libc/versioner-dependencies/common/clang-builtins b/libc/versioner-dependencies/common/clang-builtins new file mode 120000 index 000000000..7bd481c94 --- /dev/null +++ b/libc/versioner-dependencies/common/clang-builtins @@ -0,0 +1 @@ +../../../../external/clang/lib/Headers/ \ No newline at end of file diff --git a/libc/versioner-dependencies/common/kernel_android_uapi b/libc/versioner-dependencies/common/kernel_android_uapi new file mode 120000 index 000000000..fd7831572 --- /dev/null +++ b/libc/versioner-dependencies/common/kernel_android_uapi @@ -0,0 +1 @@ +../../kernel/android/uapi/ \ No newline at end of file diff --git a/libc/versioner-dependencies/common/kernel_uapi b/libc/versioner-dependencies/common/kernel_uapi new file mode 120000 index 000000000..d5cb8eec1 --- /dev/null +++ b/libc/versioner-dependencies/common/kernel_uapi @@ -0,0 +1 @@ +../../kernel/uapi/ \ No newline at end of file diff --git a/libc/versioner-dependencies/mips/arch-mips b/libc/versioner-dependencies/mips/arch-mips new file mode 120000 index 000000000..56ed02144 --- /dev/null +++ b/libc/versioner-dependencies/mips/arch-mips @@ -0,0 +1 @@ +../../arch-mips/include/ \ No newline at end of file diff --git a/libc/versioner-dependencies/mips/kernel_uapi_asm-mips b/libc/versioner-dependencies/mips/kernel_uapi_asm-mips new file mode 120000 index 000000000..94bb3db75 --- /dev/null +++ b/libc/versioner-dependencies/mips/kernel_uapi_asm-mips @@ -0,0 +1 @@ +../../kernel/uapi/asm-mips \ No newline at end of file diff --git a/libc/versioner-dependencies/mips64/arch-mips64 b/libc/versioner-dependencies/mips64/arch-mips64 new file mode 120000 index 000000000..4893b5748 --- /dev/null +++ b/libc/versioner-dependencies/mips64/arch-mips64 @@ -0,0 +1 @@ +../../arch-mips64/include/ \ No newline at end of file diff --git a/libc/versioner-dependencies/mips64/kernel_uapi_asm-mips b/libc/versioner-dependencies/mips64/kernel_uapi_asm-mips new file mode 120000 index 000000000..94bb3db75 --- /dev/null +++ b/libc/versioner-dependencies/mips64/kernel_uapi_asm-mips @@ -0,0 +1 @@ +../../kernel/uapi/asm-mips \ No newline at end of file diff --git a/libc/versioner-dependencies/x86/arch-x86 b/libc/versioner-dependencies/x86/arch-x86 new file mode 120000 index 000000000..64263842a --- /dev/null +++ b/libc/versioner-dependencies/x86/arch-x86 @@ -0,0 +1 @@ +../../arch-x86/include/ \ No newline at end of file diff --git a/libc/versioner-dependencies/x86/kernel_uapi_asm-x86 b/libc/versioner-dependencies/x86/kernel_uapi_asm-x86 new file mode 120000 index 000000000..1b7a73dda --- /dev/null +++ b/libc/versioner-dependencies/x86/kernel_uapi_asm-x86 @@ -0,0 +1 @@ +../../kernel/uapi/asm-x86/ \ No newline at end of file diff --git a/libc/versioner-dependencies/x86_64/arch-x86_64 b/libc/versioner-dependencies/x86_64/arch-x86_64 new file mode 120000 index 000000000..684d74eba --- /dev/null +++ b/libc/versioner-dependencies/x86_64/arch-x86_64 @@ -0,0 +1 @@ +../../arch-x86_64/include/ \ No newline at end of file diff --git a/libc/versioner-dependencies/x86_64/kernel_uapi_asm-x86 b/libc/versioner-dependencies/x86_64/kernel_uapi_asm-x86 new file mode 120000 index 000000000..1b7a73dda --- /dev/null +++ b/libc/versioner-dependencies/x86_64/kernel_uapi_asm-x86 @@ -0,0 +1 @@ +../../kernel/uapi/asm-x86/ \ No newline at end of file diff --git a/tools/update_headers.sh b/tools/update_headers.sh deleted file mode 100755 index 0095d5065..000000000 --- a/tools/update_headers.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd $DIR - -which versioner >/dev/null 2>&1 -if [ $? -ne 0 ]; then - >&2 echo "versioner not in path; run mma in $DIR/versioner" - exit 1 -fi - -VERSION=$(git rev-parse --short HEAD) -git diff-index --quiet HEAD -DIRTY=$? -git branch -r --contains HEAD | grep -q aosp/master -SUBMITTED=$? - -if [ $DIRTY -ne 0 ]; then - >&2 echo "Warning: bionic has uncommitted changes" - VERSION="${VERSION}-dirty" -elif [ $SUBMITTED -ne 0 ]; then - >&2 echo "Warning: current HEAD does not exist in aosp/master" - VERSION="${VERSION}-unsubmitted" -fi - -PREBUILTS_DIR=$ANDROID_BUILD_TOP/prebuilts/ndk -BRANCH_NAME=$(git -C $PREBUILTS_DIR symbolic-ref --short -q HEAD) -if [ $? -ne 0 ]; then - BRANCH_NAME=update-bionic-headers-$VERSION - echo "prebuilts/ndk has detached head; creating branch $BRANCH_NAME" - repo start $BRANCH_NAME $PREBUILTS_DIR -else - echo "prebuilts/ndk already on branch $BRANCH_NAME" -fi - -HEADERS_INSTALL=$PREBUILTS_DIR/headers -if [ -d "$HEADERS_INSTALL" ]; then - git -C $PREBUILTS_DIR rm -r --ignore-unmatch $HEADERS_INSTALL - if [ -d $HEADERS_INSTALL ]; then - rm -r $HEADERS_INSTALL - fi -fi - -versioner -p versioner/platforms versioner/current versioner/dependencies \ - -o $HEADERS_INSTALL -if [ $? -ne 0 ]; then - >&2 echo "Header preprocessing failed" - exit 1 -fi - -cp ../libc/NOTICE $PREBUILTS_DIR - -git -C $PREBUILTS_DIR add $HEADERS_INSTALL $PREBUILTS_DIR/NOTICE -git -C $PREBUILTS_DIR commit -m "Update bionic headers to $VERSION." diff --git a/tools/versioner/dependencies/arm/arch-arm b/tools/versioner/dependencies/arm/arch-arm deleted file mode 120000 index ed69f41b1..000000000 --- a/tools/versioner/dependencies/arm/arch-arm +++ /dev/null @@ -1 +0,0 @@ -../../../../libc/arch-arm/include \ No newline at end of file diff --git a/tools/versioner/dependencies/arm/kernel_uapi_asm-arm b/tools/versioner/dependencies/arm/kernel_uapi_asm-arm deleted file mode 120000 index fabed85af..000000000 --- a/tools/versioner/dependencies/arm/kernel_uapi_asm-arm +++ /dev/null @@ -1 +0,0 @@ -../../../../libc/kernel/uapi/asm-arm \ No newline at end of file diff --git a/tools/versioner/dependencies/arm64/arch-arm64 b/tools/versioner/dependencies/arm64/arch-arm64 deleted file mode 120000 index 21a21d4a0..000000000 --- a/tools/versioner/dependencies/arm64/arch-arm64 +++ /dev/null @@ -1 +0,0 @@ -../../../../libc/arch-arm64/include \ No newline at end of file diff --git a/tools/versioner/dependencies/arm64/kernel_uapi_asm-arm64 b/tools/versioner/dependencies/arm64/kernel_uapi_asm-arm64 deleted file mode 120000 index 16e74a3e5..000000000 --- a/tools/versioner/dependencies/arm64/kernel_uapi_asm-arm64 +++ /dev/null @@ -1 +0,0 @@ -../../../../libc/kernel/uapi/asm-arm64 \ No newline at end of file diff --git a/tools/versioner/dependencies/common/clang-builtins b/tools/versioner/dependencies/common/clang-builtins deleted file mode 120000 index fc27e65b2..000000000 --- a/tools/versioner/dependencies/common/clang-builtins +++ /dev/null @@ -1 +0,0 @@ -../../../../../external/clang/lib/Headers \ No newline at end of file diff --git a/tools/versioner/dependencies/common/kernel_android_uapi b/tools/versioner/dependencies/common/kernel_android_uapi deleted file mode 120000 index bcf6daa69..000000000 --- a/tools/versioner/dependencies/common/kernel_android_uapi +++ /dev/null @@ -1 +0,0 @@ -../../../../libc/kernel/android/uapi \ No newline at end of file diff --git a/tools/versioner/dependencies/common/kernel_uapi b/tools/versioner/dependencies/common/kernel_uapi deleted file mode 120000 index 2a915efb9..000000000 --- a/tools/versioner/dependencies/common/kernel_uapi +++ /dev/null @@ -1 +0,0 @@ -../../../../libc/kernel/uapi \ No newline at end of file diff --git a/tools/versioner/dependencies/mips/arch-mips b/tools/versioner/dependencies/mips/arch-mips deleted file mode 120000 index 7f2f10410..000000000 --- a/tools/versioner/dependencies/mips/arch-mips +++ /dev/null @@ -1 +0,0 @@ -../../../../libc/arch-mips/include \ No newline at end of file diff --git a/tools/versioner/dependencies/mips/kernel_uapi_asm-mips b/tools/versioner/dependencies/mips/kernel_uapi_asm-mips deleted file mode 120000 index dcd1955af..000000000 --- a/tools/versioner/dependencies/mips/kernel_uapi_asm-mips +++ /dev/null @@ -1 +0,0 @@ -../../../../libc/kernel/uapi/asm-mips \ No newline at end of file diff --git a/tools/versioner/dependencies/mips64/arch-mips64 b/tools/versioner/dependencies/mips64/arch-mips64 deleted file mode 120000 index 48cea7234..000000000 --- a/tools/versioner/dependencies/mips64/arch-mips64 +++ /dev/null @@ -1 +0,0 @@ -../../../../libc/arch-mips64/include \ No newline at end of file diff --git a/tools/versioner/dependencies/mips64/kernel_uapi_asm-mips b/tools/versioner/dependencies/mips64/kernel_uapi_asm-mips deleted file mode 120000 index dcd1955af..000000000 --- a/tools/versioner/dependencies/mips64/kernel_uapi_asm-mips +++ /dev/null @@ -1 +0,0 @@ -../../../../libc/kernel/uapi/asm-mips \ No newline at end of file diff --git a/tools/versioner/dependencies/x86/arch-x86 b/tools/versioner/dependencies/x86/arch-x86 deleted file mode 120000 index d0f016a09..000000000 --- a/tools/versioner/dependencies/x86/arch-x86 +++ /dev/null @@ -1 +0,0 @@ -../../../../libc/arch-x86/include \ No newline at end of file diff --git a/tools/versioner/dependencies/x86/kernel_uapi_asm-x86 b/tools/versioner/dependencies/x86/kernel_uapi_asm-x86 deleted file mode 120000 index 0efae62b7..000000000 --- a/tools/versioner/dependencies/x86/kernel_uapi_asm-x86 +++ /dev/null @@ -1 +0,0 @@ -../../../../libc/kernel/uapi/asm-x86 \ No newline at end of file diff --git a/tools/versioner/dependencies/x86_64/arch-x86_64 b/tools/versioner/dependencies/x86_64/arch-x86_64 deleted file mode 120000 index deb647d21..000000000 --- a/tools/versioner/dependencies/x86_64/arch-x86_64 +++ /dev/null @@ -1 +0,0 @@ -../../../../libc/arch-x86_64/include \ No newline at end of file diff --git a/tools/versioner/dependencies/x86_64/kernel_uapi_asm-x86 b/tools/versioner/dependencies/x86_64/kernel_uapi_asm-x86 deleted file mode 120000 index 0efae62b7..000000000 --- a/tools/versioner/dependencies/x86_64/kernel_uapi_asm-x86 +++ /dev/null @@ -1 +0,0 @@ -../../../../libc/kernel/uapi/asm-x86 \ No newline at end of file diff --git a/tools/versioner/preupload.sh b/tools/versioner/preupload.sh deleted file mode 100755 index 45d6cca46..000000000 --- a/tools/versioner/preupload.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -if ! which versioner > /dev/null; then - echo "versioner not found (lunch and mma in bionic)" - exit 1 -fi - -versioner -r arm -r arm64 -exit $? diff --git a/tools/versioner/src/Android.bp b/tools/versioner/src/Android.bp index d1362d094..409bc10cc 100644 --- a/tools/versioner/src/Android.bp +++ b/tools/versioner/src/Android.bp @@ -41,9 +41,6 @@ cc_binary_host { "-fno-rtti", ], }, - darwin: { - enabled: false, - }, windows: { enabled: false, },