mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:19:48 +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/
|
||||
fi
|
||||
|
||||
if [ -z "$DART_CONFIGURATION" ];
|
||||
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
|
||||
|
||||
export DART_CONFIGURATION=${DART_CONFIGURATION:-ReleaseX64}
|
||||
BIN_DIR="$OUT_DIR$DART_CONFIGURATION"
|
||||
|
||||
exec "$BIN_DIR"/dart \
|
||||
--strong \
|
||||
--reify-generic-functions \
|
||||
--dfe=${BIN_DIR}/gen/kernel-service.dart.snapshot \
|
||||
--kernel-binaries=${BIN_DIR} \
|
||||
--dfe="${BIN_DIR}/gen/kernel-service.dart.snapshot" \
|
||||
--kernel-binaries="${BIN_DIR}" \
|
||||
"$@"
|
||||
|
|
|
@ -30,33 +30,7 @@ else
|
|||
OUT_DIR="$CUR_DIR"/../../../out/
|
||||
fi
|
||||
|
||||
if [ -z "$DART_CONFIGURATION" ];
|
||||
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
|
||||
|
||||
export DART_CONFIGURATION=${DART_CONFIGURATION:-ReleaseX64}
|
||||
BIN_DIR="$OUT_DIR$DART_CONFIGURATION"
|
||||
|
||||
exec "$BIN_DIR"/dart_precompiled_runtime \
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
# All options will be passed to dart_bootstrap, while --packages will be
|
||||
# passed to Fasta.
|
||||
|
||||
set -e
|
||||
|
||||
OPTIONS=()
|
||||
PACKAGES=
|
||||
|
||||
|
@ -32,14 +34,12 @@ done
|
|||
|
||||
if [ "${#ARGV[@]}" -ne 2 ]; then
|
||||
echo "Usage: $0 [options] <source> <snapshot>"
|
||||
exit -1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SOURCE_FILE="${ARGV[0]}"
|
||||
SNAPSHOT_FILE="${ARGV[1]}"
|
||||
|
||||
set -e
|
||||
|
||||
function follow_links() {
|
||||
file="$1"
|
||||
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.
|
||||
CUR_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
|
||||
|
||||
if [[ `uname` == 'Darwin' ]];
|
||||
then
|
||||
if [[ `uname` == 'Darwin' ]]; then
|
||||
OUT_DIR="$CUR_DIR"/../../../xcodebuild/
|
||||
else
|
||||
OUT_DIR="$CUR_DIR"/../../../out/
|
||||
fi
|
||||
|
||||
if [ -z "$DART_CONFIGURATION" ];
|
||||
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
|
||||
|
||||
export DART_CONFIGURATION=${DART_CONFIGURATION:-ReleaseX64}
|
||||
BIN_DIR="$OUT_DIR$DART_CONFIGURATION"
|
||||
|
||||
# Step 1: Generate Kernel binary from the input Dart source.
|
||||
"$BIN_DIR"/dart pkg/front_end/tool/_fasta/compile.dart \
|
||||
--strong-mode \
|
||||
--platform ${BIN_DIR}/vm_platform_strong.dill \
|
||||
--platform "${BIN_DIR}"/vm_platform_strong.dill \
|
||||
--target vm \
|
||||
--target-options=strong-aot \
|
||||
"$PACKAGES" \
|
||||
$PACKAGES \
|
||||
-o "$SNAPSHOT_FILE.dill" \
|
||||
"$SOURCE_FILE"
|
||||
|
||||
|
@ -105,7 +78,7 @@ BIN_DIR="$OUT_DIR$DART_CONFIGURATION"
|
|||
exec "$BIN_DIR"/dart_bootstrap \
|
||||
--strong \
|
||||
--reify-generic-functions \
|
||||
--kernel-binaries=${BIN_DIR} \
|
||||
--kernel-binaries="${BIN_DIR}" \
|
||||
--snapshot-kind=app-aot \
|
||||
--use-blobs \
|
||||
--snapshot="$SNAPSHOT_FILE" \
|
||||
|
|
Loading…
Reference in a new issue