mirror of
https://github.com/dart-lang/sdk
synced 2024-09-18 21:01:20 +00:00
[vm] Fix small issues in pkg/vm/tool scripts.
* consistently quote $BIN_DIR; * remove convoluted logic that tries to guess DART_CONFIGURATION; * fix issue with how $PACKAGES were passed to fasta in precompiler2. Bug: Change-Id: I3073330fe3397100406d9ad6dcab2a86f9e1825f Reviewed-on: https://dart-review.googlesource.com/21082 Reviewed-by: Vyacheslav Egorov <vegorov@google.com> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
This commit is contained in:
parent
c847cbd5e4
commit
1aa81ee849
|
@ -28,38 +28,12 @@ else
|
||||||
OUT_DIR="$CUR_DIR"/../../../out/
|
OUT_DIR="$CUR_DIR"/../../../out/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$DART_CONFIGURATION" ];
|
export DART_CONFIGURATION=${DART_CONFIGURATION:-ReleaseX64}
|
||||||
then
|
|
||||||
DIRS=$( ls "$OUT_DIR" )
|
|
||||||
# list of possible configurations in decreasing desirability
|
|
||||||
CONFIGS=("ReleaseX64" "ReleaseIA32" "DebugX64" "DebugIA32"
|
|
||||||
"ReleaseARM" "ReleaseARM64" "ReleaseARMV5TE"
|
|
||||||
"DebugARM" "DebugARM64" "DebugARMV5TE")
|
|
||||||
DART_CONFIGURATION="None"
|
|
||||||
for CONFIG in ${CONFIGS[*]}
|
|
||||||
do
|
|
||||||
for DIR in $DIRS;
|
|
||||||
do
|
|
||||||
if [ "$CONFIG" = "$DIR" ];
|
|
||||||
then
|
|
||||||
# choose most desirable configuration that is available and break
|
|
||||||
DART_CONFIGURATION="$DIR"
|
|
||||||
break 2
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
if [ "$DART_CONFIGURATION" = "None" ]
|
|
||||||
then
|
|
||||||
echo "No valid dart configuration found in $OUT_DIR"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
BIN_DIR="$OUT_DIR$DART_CONFIGURATION"
|
BIN_DIR="$OUT_DIR$DART_CONFIGURATION"
|
||||||
|
|
||||||
exec "$BIN_DIR"/dart \
|
exec "$BIN_DIR"/dart \
|
||||||
--strong \
|
--strong \
|
||||||
--reify-generic-functions \
|
--reify-generic-functions \
|
||||||
--dfe=${BIN_DIR}/gen/kernel-service.dart.snapshot \
|
--dfe="${BIN_DIR}/gen/kernel-service.dart.snapshot" \
|
||||||
--kernel-binaries=${BIN_DIR} \
|
--kernel-binaries="${BIN_DIR}" \
|
||||||
"$@"
|
"$@"
|
||||||
|
|
|
@ -30,33 +30,7 @@ else
|
||||||
OUT_DIR="$CUR_DIR"/../../../out/
|
OUT_DIR="$CUR_DIR"/../../../out/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$DART_CONFIGURATION" ];
|
export DART_CONFIGURATION=${DART_CONFIGURATION:-ReleaseX64}
|
||||||
then
|
|
||||||
DIRS=$( ls "$OUT_DIR" )
|
|
||||||
# list of possible configurations in decreasing desirability
|
|
||||||
CONFIGS=("ReleaseX64" "ReleaseIA32" "DebugX64" "DebugIA32"
|
|
||||||
"ReleaseARM" "ReleaseARM64" "ReleaseARMV5TE"
|
|
||||||
"DebugARM" "DebugARM64" "DebugARMV5TE")
|
|
||||||
DART_CONFIGURATION="None"
|
|
||||||
for CONFIG in ${CONFIGS[*]}
|
|
||||||
do
|
|
||||||
for DIR in $DIRS;
|
|
||||||
do
|
|
||||||
if [ "$CONFIG" = "$DIR" ];
|
|
||||||
then
|
|
||||||
# choose most desirable configuration that is available and break
|
|
||||||
DART_CONFIGURATION="$DIR"
|
|
||||||
break 2
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
if [ "$DART_CONFIGURATION" = "None" ]
|
|
||||||
then
|
|
||||||
echo "No valid dart configuration found in $OUT_DIR"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
BIN_DIR="$OUT_DIR$DART_CONFIGURATION"
|
BIN_DIR="$OUT_DIR$DART_CONFIGURATION"
|
||||||
|
|
||||||
exec "$BIN_DIR"/dart_precompiled_runtime \
|
exec "$BIN_DIR"/dart_precompiled_runtime \
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
# All options will be passed to dart_bootstrap, while --packages will be
|
# All options will be passed to dart_bootstrap, while --packages will be
|
||||||
# passed to Fasta.
|
# passed to Fasta.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
OPTIONS=()
|
OPTIONS=()
|
||||||
PACKAGES=
|
PACKAGES=
|
||||||
|
|
||||||
|
@ -32,14 +34,12 @@ done
|
||||||
|
|
||||||
if [ "${#ARGV[@]}" -ne 2 ]; then
|
if [ "${#ARGV[@]}" -ne 2 ]; then
|
||||||
echo "Usage: $0 [options] <source> <snapshot>"
|
echo "Usage: $0 [options] <source> <snapshot>"
|
||||||
exit -1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SOURCE_FILE="${ARGV[0]}"
|
SOURCE_FILE="${ARGV[0]}"
|
||||||
SNAPSHOT_FILE="${ARGV[1]}"
|
SNAPSHOT_FILE="${ARGV[1]}"
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
function follow_links() {
|
function follow_links() {
|
||||||
file="$1"
|
file="$1"
|
||||||
while [ -h "$file" ]; do
|
while [ -h "$file" ]; do
|
||||||
|
@ -55,49 +55,22 @@ PROG_NAME="$(follow_links "$BASH_SOURCE")"
|
||||||
# Handle the case where dart-sdk/bin has been symlinked to.
|
# Handle the case where dart-sdk/bin has been symlinked to.
|
||||||
CUR_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
|
CUR_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
|
||||||
|
|
||||||
if [[ `uname` == 'Darwin' ]];
|
if [[ `uname` == 'Darwin' ]]; then
|
||||||
then
|
|
||||||
OUT_DIR="$CUR_DIR"/../../../xcodebuild/
|
OUT_DIR="$CUR_DIR"/../../../xcodebuild/
|
||||||
else
|
else
|
||||||
OUT_DIR="$CUR_DIR"/../../../out/
|
OUT_DIR="$CUR_DIR"/../../../out/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$DART_CONFIGURATION" ];
|
export DART_CONFIGURATION=${DART_CONFIGURATION:-ReleaseX64}
|
||||||
then
|
|
||||||
DIRS=$( ls "$OUT_DIR" )
|
|
||||||
# list of possible configurations in decreasing desirability
|
|
||||||
CONFIGS=("ReleaseX64" "ReleaseIA32" "DebugX64" "DebugIA32"
|
|
||||||
"ReleaseARM" "ReleaseARM64" "ReleaseARMV5TE"
|
|
||||||
"DebugARM" "DebugARM64" "DebugARMV5TE")
|
|
||||||
DART_CONFIGURATION="None"
|
|
||||||
for CONFIG in ${CONFIGS[*]}
|
|
||||||
do
|
|
||||||
for DIR in $DIRS;
|
|
||||||
do
|
|
||||||
if [ "$CONFIG" = "$DIR" ];
|
|
||||||
then
|
|
||||||
# choose most desirable configuration that is available and break
|
|
||||||
DART_CONFIGURATION="$DIR"
|
|
||||||
break 2
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
if [ "$DART_CONFIGURATION" = "None" ]
|
|
||||||
then
|
|
||||||
echo "No valid dart configuration found in $OUT_DIR"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
BIN_DIR="$OUT_DIR$DART_CONFIGURATION"
|
BIN_DIR="$OUT_DIR$DART_CONFIGURATION"
|
||||||
|
|
||||||
# Step 1: Generate Kernel binary from the input Dart source.
|
# Step 1: Generate Kernel binary from the input Dart source.
|
||||||
"$BIN_DIR"/dart pkg/front_end/tool/_fasta/compile.dart \
|
"$BIN_DIR"/dart pkg/front_end/tool/_fasta/compile.dart \
|
||||||
--strong-mode \
|
--strong-mode \
|
||||||
--platform ${BIN_DIR}/vm_platform_strong.dill \
|
--platform "${BIN_DIR}"/vm_platform_strong.dill \
|
||||||
--target vm \
|
--target vm \
|
||||||
--target-options=strong-aot \
|
--target-options=strong-aot \
|
||||||
"$PACKAGES" \
|
$PACKAGES \
|
||||||
-o "$SNAPSHOT_FILE.dill" \
|
-o "$SNAPSHOT_FILE.dill" \
|
||||||
"$SOURCE_FILE"
|
"$SOURCE_FILE"
|
||||||
|
|
||||||
|
@ -105,7 +78,7 @@ BIN_DIR="$OUT_DIR$DART_CONFIGURATION"
|
||||||
exec "$BIN_DIR"/dart_bootstrap \
|
exec "$BIN_DIR"/dart_bootstrap \
|
||||||
--strong \
|
--strong \
|
||||||
--reify-generic-functions \
|
--reify-generic-functions \
|
||||||
--kernel-binaries=${BIN_DIR} \
|
--kernel-binaries="${BIN_DIR}" \
|
||||||
--snapshot-kind=app-aot \
|
--snapshot-kind=app-aot \
|
||||||
--use-blobs \
|
--use-blobs \
|
||||||
--snapshot="$SNAPSHOT_FILE" \
|
--snapshot="$SNAPSHOT_FILE" \
|
||||||
|
|
Loading…
Reference in a new issue