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
This commit is contained in:
parent
3f76dadf15
commit
45715b2a88
35 changed files with 21 additions and 90 deletions
|
@ -1,3 +1,2 @@
|
|||
[Hook Scripts]
|
||||
versioner = tools/versioner/preupload.sh
|
||||
notice = tools/update_notice.sh
|
||||
|
|
|
@ -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",
|
||||
|
|
1
libc/versioner-dependencies/arm/arch-arm
Symbolic link
1
libc/versioner-dependencies/arm/arch-arm
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../arch-arm/include/
|
1
libc/versioner-dependencies/arm/kernel_uapi_asm-arm
Symbolic link
1
libc/versioner-dependencies/arm/kernel_uapi_asm-arm
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../kernel/uapi/asm-arm
|
1
libc/versioner-dependencies/arm64/arch-arm64
Symbolic link
1
libc/versioner-dependencies/arm64/arch-arm64
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../arch-arm64/include/
|
1
libc/versioner-dependencies/arm64/kernel_uapi_asm-arm64
Symbolic link
1
libc/versioner-dependencies/arm64/kernel_uapi_asm-arm64
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../kernel/uapi/asm-arm64
|
1
libc/versioner-dependencies/common/clang-builtins
Symbolic link
1
libc/versioner-dependencies/common/clang-builtins
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../../../external/clang/lib/Headers/
|
1
libc/versioner-dependencies/common/kernel_android_uapi
Symbolic link
1
libc/versioner-dependencies/common/kernel_android_uapi
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../kernel/android/uapi/
|
1
libc/versioner-dependencies/common/kernel_uapi
Symbolic link
1
libc/versioner-dependencies/common/kernel_uapi
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../kernel/uapi/
|
1
libc/versioner-dependencies/mips/arch-mips
Symbolic link
1
libc/versioner-dependencies/mips/arch-mips
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../arch-mips/include/
|
1
libc/versioner-dependencies/mips/kernel_uapi_asm-mips
Symbolic link
1
libc/versioner-dependencies/mips/kernel_uapi_asm-mips
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../kernel/uapi/asm-mips
|
1
libc/versioner-dependencies/mips64/arch-mips64
Symbolic link
1
libc/versioner-dependencies/mips64/arch-mips64
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../arch-mips64/include/
|
1
libc/versioner-dependencies/mips64/kernel_uapi_asm-mips
Symbolic link
1
libc/versioner-dependencies/mips64/kernel_uapi_asm-mips
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../kernel/uapi/asm-mips
|
1
libc/versioner-dependencies/x86/arch-x86
Symbolic link
1
libc/versioner-dependencies/x86/arch-x86
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../arch-x86/include/
|
1
libc/versioner-dependencies/x86/kernel_uapi_asm-x86
Symbolic link
1
libc/versioner-dependencies/x86/kernel_uapi_asm-x86
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../kernel/uapi/asm-x86/
|
1
libc/versioner-dependencies/x86_64/arch-x86_64
Symbolic link
1
libc/versioner-dependencies/x86_64/arch-x86_64
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../arch-x86_64/include/
|
1
libc/versioner-dependencies/x86_64/kernel_uapi_asm-x86
Symbolic link
1
libc/versioner-dependencies/x86_64/kernel_uapi_asm-x86
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../kernel/uapi/asm-x86/
|
|
@ -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."
|
|
@ -1 +0,0 @@
|
|||
../../../../libc/arch-arm/include
|
|
@ -1 +0,0 @@
|
|||
../../../../libc/kernel/uapi/asm-arm
|
|
@ -1 +0,0 @@
|
|||
../../../../libc/arch-arm64/include
|
|
@ -1 +0,0 @@
|
|||
../../../../libc/kernel/uapi/asm-arm64
|
|
@ -1 +0,0 @@
|
|||
../../../../../external/clang/lib/Headers
|
|
@ -1 +0,0 @@
|
|||
../../../../libc/kernel/android/uapi
|
|
@ -1 +0,0 @@
|
|||
../../../../libc/kernel/uapi
|
|
@ -1 +0,0 @@
|
|||
../../../../libc/arch-mips/include
|
|
@ -1 +0,0 @@
|
|||
../../../../libc/kernel/uapi/asm-mips
|
|
@ -1 +0,0 @@
|
|||
../../../../libc/arch-mips64/include
|
|
@ -1 +0,0 @@
|
|||
../../../../libc/kernel/uapi/asm-mips
|
|
@ -1 +0,0 @@
|
|||
../../../../libc/arch-x86/include
|
|
@ -1 +0,0 @@
|
|||
../../../../libc/kernel/uapi/asm-x86
|
|
@ -1 +0,0 @@
|
|||
../../../../libc/arch-x86_64/include
|
|
@ -1 +0,0 @@
|
|||
../../../../libc/kernel/uapi/asm-x86
|
|
@ -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 $?
|
|
@ -41,9 +41,6 @@ cc_binary_host {
|
|||
"-fno-rtti",
|
||||
],
|
||||
},
|
||||
darwin: {
|
||||
enabled: false,
|
||||
},
|
||||
windows: {
|
||||
enabled: false,
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue