diff --git a/dwds/test/fixtures/utilities.dart b/dwds/test/fixtures/utilities.dart index 0e5a381dc..839ce6509 100644 --- a/dwds/test/fixtures/utilities.dart +++ b/dwds/test/fixtures/utilities.dart @@ -16,11 +16,7 @@ Future connectClient(String workingDirectory, List options, Function(ServerLog) logHandler) => BuildDaemonClient.connect( workingDirectory, - // On Windows we need to call the snapshot directly otherwise - // the process will start in a disjoint cmd without access to - // STDIO. We also want to ensure the version of pub is consistent with - // the SDK that was used to launch webdev. - [dartPath, pubSnapshot] + [dartPath] ..addAll(['run', 'build_runner', 'daemon']) ..addAll(options), logHandler: logHandler); @@ -36,10 +32,6 @@ final String _sdkDir = (() { final String dartSdkPath = _sdkDir; final String dartPath = p.join(_sdkDir, 'bin', 'dart'); -final String pubSnapshot = - p.join(_sdkDir, 'bin', 'snapshots', 'pub.dart.snapshot'); -final String pubPath = - p.join(_sdkDir, 'bin', Platform.isWindows ? 'pub.bat' : 'pub'); /// Returns the port of the daemon asset server. int daemonPort(String workingDirectory) { diff --git a/frontend_server_common/lib/src/utilities.dart b/frontend_server_common/lib/src/utilities.dart index 9e89da85c..9ca429eff 100644 --- a/frontend_server_common/lib/src/utilities.dart +++ b/frontend_server_common/lib/src/utilities.dart @@ -21,9 +21,5 @@ final String _sdkDir = (() { final String dartSdkPath = _sdkDir; final String dartPath = p.join(_sdkDir, 'bin', 'dart'); -final String pubSnapshot = - p.join(_sdkDir, 'bin', 'snapshots', 'pub.dart.snapshot'); -final String pubPath = - p.join(_sdkDir, 'bin', Platform.isWindows ? 'pub.bat' : 'pub'); const fs.FileSystem fileSystem = LocalFileSystem(); diff --git a/webdev/lib/src/daemon_client.dart b/webdev/lib/src/daemon_client.dart index c72bba61c..d8ae674b1 100644 --- a/webdev/lib/src/daemon_client.dart +++ b/webdev/lib/src/daemon_client.dart @@ -18,11 +18,7 @@ Future connectClient(String workingDirectory, List options, Function(ServerLog) logHandler) => BuildDaemonClient.connect( workingDirectory, - // On Windows we need to call the snapshot directly otherwise - // the process will start in a disjoint cmd without access to - // STDIO. We also want to ensure the version of pub is consistent with - // the SDK that was used to launch webdev. - [dartPath, pubSnapshot] + [dartPath] ..addAll(['run', 'build_runner', 'daemon']) ..addAll(options), logHandler: logHandler); diff --git a/webdev/lib/src/pubspec.dart b/webdev/lib/src/pubspec.dart index a921635cd..d9bc29d6f 100644 --- a/webdev/lib/src/pubspec.dart +++ b/webdev/lib/src/pubspec.dart @@ -55,7 +55,7 @@ dev_dependencies: } Future _runPubDeps() async { - var result = Process.runSync(pubPath, ['deps']); + var result = Process.runSync(dartPath, ['pub', 'deps']); if (result.exitCode == 65 || result.exitCode == 66) { throw PackageException( @@ -64,8 +64,8 @@ Future _runPubDeps() async { if (result.exitCode != 0) { throw ProcessException( - pubPath, - ['deps'], + dartPath, + ['pub', 'deps'], '***OUT***\n${result.stdout}\n***ERR***\n${result.stderr}\n***', exitCode); } diff --git a/webdev/lib/src/util.dart b/webdev/lib/src/util.dart index f80b7b25e..14aadb1a7 100644 --- a/webdev/lib/src/util.dart +++ b/webdev/lib/src/util.dart @@ -20,7 +20,3 @@ final String _sdkDir = (() { })(); final String dartPath = p.join(_sdkDir, 'bin', 'dart'); -final String pubSnapshot = - p.join(_sdkDir, 'bin', 'snapshots', 'pub.dart.snapshot'); -final String pubPath = - p.join(_sdkDir, 'bin', Platform.isWindows ? 'pub.bat' : 'pub'); diff --git a/webdev/test/daemon/utils.dart b/webdev/test/daemon/utils.dart index 49373d8f2..1adb1e723 100644 --- a/webdev/test/daemon/utils.dart +++ b/webdev/test/daemon/utils.dart @@ -43,7 +43,7 @@ Future prepareWorkspace() async { var exampleDirectory = p.absolute(p.join(p.current, '..', 'fixtures', '_webdevSmoke')); - var process = await TestProcess.start(pubPath, ['upgrade'], + var process = await TestProcess.start(dartPath, ['pub', 'upgrade'], workingDirectory: exampleDirectory, environment: getPubEnvironment()); await process.shouldExit(0); diff --git a/webdev/test/e2e_test.dart b/webdev/test/e2e_test.dart index a0065e7f0..e5779b2b9 100644 --- a/webdev/test/e2e_test.dart +++ b/webdev/test/e2e_test.dart @@ -42,12 +42,12 @@ void main() { soundExampleDirectory = p.absolute(p.join(p.current, '..', 'fixtures', '_webdevSoundSmoke')); - var process = await TestProcess.start(pubPath, ['upgrade'], + var process = await TestProcess.start(dartPath, ['pub', 'upgrade'], workingDirectory: exampleDirectory, environment: getPubEnvironment()); await process.shouldExit(0); - process = await TestProcess.start(pubPath, ['upgrade'], + process = await TestProcess.start(dartPath, ['pub', 'upgrade'], workingDirectory: soundExampleDirectory, environment: getPubEnvironment());