From 1a1ff9e6666ef0420ebc3badaf292cc94921eb84 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Thu, 21 Jun 2018 19:52:53 +0000 Subject: [PATCH] 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 Commit-Queue: Nate Bosch --- sdk/BUILD.gn | 18 +++++++++--------- sdk/bin/pub_sdk | 4 ++-- sdk/bin/pub_sdk.bat | 4 ++-- utils/pub/BUILD.gn | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn index c84f5263c0e..1f214f98229 100644 --- a/sdk/BUILD.gn +++ b/sdk/BUILD.gn @@ -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", diff --git a/sdk/bin/pub_sdk b/sdk/bin/pub_sdk index 85d3b97b487..db6d55348b7 100755 --- a/sdk/bin/pub_sdk +++ b/sdk/bin/pub_sdk @@ -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 diff --git a/sdk/bin/pub_sdk.bat b/sdk/bin/pub_sdk.bat index 564e5128759..86697aa6079 100644 --- a/sdk/bin/pub_sdk.bat +++ b/sdk/bin/pub_sdk.bat @@ -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 diff --git a/utils/pub/BUILD.gn b/utils/pub/BUILD.gn index 0adf27ad287..6d75f38dcbf 100644 --- a/utils/pub/BUILD.gn +++ b/utils/pub/BUILD.gn @@ -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" ]