Reverse the pub snapshot names

Fixes https://github.com/dart-lang/pub/issues/1931

Pub color output depends on the name of the entrypoint it is running
from, when the entrypoint went from "pub" to "pub2" it confused this
check and we stopped getting colors.

Since the Dart 1 version of the snapshot has a short remaining lifespan
we can switch it to the other name and let "pub" mean Dart 2 and
continue to behave like it used to.

Change-Id: I1851a4c908ffe2222ab5fe6802f4b81a63d7f9f1
Reviewed-on: https://dart-review.googlesource.com/61641
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
This commit is contained in:
Nate Bosch 2018-06-21 19:52:53 +00:00 committed by commit-bot@chromium.org
parent d5d5daf411
commit 1a1ff9e666
4 changed files with 15 additions and 15 deletions

View file

@ -45,8 +45,8 @@ declare_args() {
# ........dartdevc.dart.snapshot
# ........dartdevk.dart.snapshot
# ........kernel_worker.dart.snapshot
# ........pub1.dart.snapshot
# ........pub.dart.snapshot
# ........pub2.dart.snapshot
#.........resources/
#...........dartdoc/
#..............packages
@ -131,12 +131,12 @@ _platform_sdk_snapshots = [
"../utils/dartfmt",
],
[
"pub",
"../utils/pub",
"pub1",
"../utils/pub:pub1",
],
[
"pub2",
"../utils/pub:pub2",
"pub",
"../utils/pub",
],
]
@ -174,12 +174,12 @@ _full_sdk_snapshots = [
"../utils/bazel:kernel_worker",
],
[
"pub",
"../utils/pub",
"pub1",
"../utils/pub:pub1",
],
[
"pub2",
"../utils/pub:pub2",
"pub",
"../utils/pub",
],
[
"kernel-service",

View file

@ -42,9 +42,9 @@ fi
# Run the pub snapshot.
DART="$BIN_DIR/dart"
if array_contains "--no-preview-dart-2" "${VM_OPTIONS[@]}"; then
SNAPSHOT="$BIN_DIR/snapshots/pub.dart.snapshot"
SNAPSHOT="$BIN_DIR/snapshots/pub1.dart.snapshot"
exec "$DART" "${VM_OPTIONS[@]}" "$SNAPSHOT" "$@"
else
SNAPSHOT="$BIN_DIR/snapshots/pub2.dart.snapshot"
SNAPSHOT="$BIN_DIR/snapshots/pub.dart.snapshot"
exec "$DART" "${VM_OPTIONS[@]}" "$SNAPSHOT" "$@"
fi

View file

@ -29,9 +29,9 @@ if not "_%DART_VM_OPTIONS%_" == "__" (
)
if defined USING_DART_1 (
"%BIN_DIR%\dart" %VM_OPTIONS% "%BIN_DIR%\snapshots\pub.dart.snapshot" %*
"%BIN_DIR%\dart" %VM_OPTIONS% "%BIN_DIR%\snapshots\pub1.dart.snapshot" %*
) else (
"%BIN_DIR%\dart" %VM_OPTIONS% "%BIN_DIR%\snapshots\pub2.dart.snapshot" %*
"%BIN_DIR%\dart" %VM_OPTIONS% "%BIN_DIR%\snapshots\pub.dart.snapshot" %*
)
endlocal

View file

@ -4,12 +4,12 @@
import("../application_snapshot.gni")
application_snapshot("pub") {
application_snapshot("pub1") {
main_dart = "../../third_party/pkg/pub/bin/pub.dart"
training_args = [ "--help" ]
}
application_snapshot("pub2") {
application_snapshot("pub") {
dart_version = 2
main_dart = "../../third_party/pkg/pub/bin/pub.dart"
training_args = [ "--help" ]