2019-03-01 23:00:41 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
|
|
|
|
# for details. All rights reserved. Use of this source code is governed by a
|
|
|
|
# BSD-style license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
# Uploads the following dill files to CIPD, indexed by the current ABI version:
|
|
|
|
# $build_dir/vm_platform_strong.dill
|
|
|
|
# $build_dir/gen/kernel_service.dill
|
|
|
|
# $build_dir/gen_kernel_bytecode.dill
|
2019-03-07 21:43:46 +00:00
|
|
|
# This script is a no-op unless $BUILDBOT_BUILDERNAME is "dart-sdk-linux-be".
|
|
|
|
# It's also a no-op if dill files were already uploaded today.
|
2020-05-07 12:33:37 +00:00
|
|
|
#
|
|
|
|
# If the ABI was modified, the ABI_VERSION in tools/VERSIONS should be manually
|
|
|
|
# incremented accordingly.
|
2019-03-01 23:00:41 +00:00
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
|
|
|
if [ -z "$2" ]; then
|
|
|
|
echo "Usage: upload_abi_dills.sh version_file build_dir"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-03-07 21:43:46 +00:00
|
|
|
if [ "$BUILDBOT_BUILDERNAME" != "dart-sdk-linux-be" ]; then
|
|
|
|
echo "This script only works on the dart-sdk-linux-be buildbot"
|
2019-03-01 23:00:41 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
abi_version=$(sed -n "s/^ABI_VERSION \([0-9]*\)$/\1/p" "$1")
|
|
|
|
git_revision=$(git rev-parse HEAD)
|
|
|
|
current_date=$(date +%F)
|
|
|
|
search_results=$(cipd search \
|
|
|
|
"dart/abiversions/$abi_version" \
|
|
|
|
-tag "date:$current_date" | grep "Instances:" || echo "")
|
|
|
|
|
|
|
|
if [ ! -z "$search_results" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2019-03-07 21:43:46 +00:00
|
|
|
sdk_dir=$(pwd)
|
2019-03-01 23:00:41 +00:00
|
|
|
tmpdir=$(mktemp -d)
|
2019-03-07 21:43:46 +00:00
|
|
|
chmod 755 $tmpdir
|
2019-03-01 23:00:41 +00:00
|
|
|
cleanup() {
|
|
|
|
rm -rf "$tmpdir"
|
|
|
|
}
|
|
|
|
trap cleanup EXIT HUP INT QUIT TERM PIPE
|
|
|
|
pushd "$tmpdir"
|
|
|
|
|
|
|
|
mkdir abiversions
|
2019-03-07 21:43:46 +00:00
|
|
|
cp "$sdk_dir/$2/vm_platform_strong.dill" "abiversions/vm_platform_strong.dill"
|
|
|
|
cp "$sdk_dir/$2/gen/kernel_service.dill" "abiversions/kernel_service.dill"
|
2019-03-19 19:36:59 +00:00
|
|
|
cp "$sdk_dir/$2/gen_kernel_bytecode.dill" "abiversions/gen_kernel_bytecode.dill"
|
2019-03-01 23:00:41 +00:00
|
|
|
|
|
|
|
cipd create \
|
2019-03-07 21:43:46 +00:00
|
|
|
-name dart/abiversions/$abi_version \
|
|
|
|
-in abiversions \
|
2019-03-01 23:00:41 +00:00
|
|
|
-install-mode copy \
|
|
|
|
-tag version:$abi_version \
|
|
|
|
-tag date:$current_date \
|
|
|
|
-tag git_revision:$git_revision \
|
|
|
|
-ref latest \
|
2019-03-07 21:43:46 +00:00
|
|
|
-ref version_$abi_version
|
2019-03-01 23:00:41 +00:00
|
|
|
|
|
|
|
popd
|