Unverified Commit 1c04f951 authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Warn about missing host build binaries when compiling with a local engine (#15626)

Fixes https://github.com/flutter/flutter/issues/15361
parent 6acf76f7
......@@ -8,6 +8,7 @@ import 'dart:convert';
import 'package:usage/uuid/uuid.dart';
import 'artifacts.dart';
import 'base/common.dart';
import 'base/io.dart';
import 'base/process_manager.dart';
import 'globals.dart';
......@@ -65,8 +66,12 @@ Future<String> compile(
// This is a URI, not a file path, so the forward slash is correct even on Windows.
if (!sdkRoot.endsWith('/'))
sdkRoot = '$sdkRoot/';
final String engineDartPath = artifacts.getArtifactPath(Artifact.engineDartBinary);
if (!processManager.canRun(engineDartPath)) {
throwToolExit('Unable to find Dart binary at $engineDartPath');
}
final List<String> command = <String>[
artifacts.getArtifactPath(Artifact.engineDartBinary),
engineDartPath,
frontendServer,
'--sdk-root',
sdkRoot,
......
......@@ -32,6 +32,7 @@ void main() {
final StreamController<String> stdErrStreamController = new StreamController<String>();
when(mockFrontendServerStdErr.transform<String>(any)).thenReturn(stdErrStreamController.stream);
when(mockFrontendServer.stdin).thenReturn(mockFrontendServerStdIn);
when(mockProcessManager.canRun(any)).thenReturn(true);
when(mockProcessManager.start(any)).thenAnswer(
(Invocation invocation) => new Future<Process>.value(mockFrontendServer));
when(mockFrontendServer.exitCode).thenReturn(0);
......@@ -120,6 +121,7 @@ void main() {
when(mockFrontendServerStdErr.transform<String>(any))
.thenAnswer((Invocation invocation) => stdErrStreamController.stream);
when(mockProcessManager.canRun(any)).thenReturn(true);
when(mockProcessManager.start(any)).thenAnswer(
(Invocation invocation) => new Future<Process>.value(mockFrontendServer)
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment