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'; ...@@ -8,6 +8,7 @@ import 'dart:convert';
import 'package:usage/uuid/uuid.dart'; import 'package:usage/uuid/uuid.dart';
import 'artifacts.dart'; import 'artifacts.dart';
import 'base/common.dart';
import 'base/io.dart'; import 'base/io.dart';
import 'base/process_manager.dart'; import 'base/process_manager.dart';
import 'globals.dart'; import 'globals.dart';
...@@ -65,8 +66,12 @@ Future<String> compile( ...@@ -65,8 +66,12 @@ Future<String> compile(
// This is a URI, not a file path, so the forward slash is correct even on Windows. // This is a URI, not a file path, so the forward slash is correct even on Windows.
if (!sdkRoot.endsWith('/')) if (!sdkRoot.endsWith('/'))
sdkRoot = '$sdkRoot/'; 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>[ final List<String> command = <String>[
artifacts.getArtifactPath(Artifact.engineDartBinary), engineDartPath,
frontendServer, frontendServer,
'--sdk-root', '--sdk-root',
sdkRoot, sdkRoot,
......
...@@ -32,6 +32,7 @@ void main() { ...@@ -32,6 +32,7 @@ void main() {
final StreamController<String> stdErrStreamController = new StreamController<String>(); final StreamController<String> stdErrStreamController = new StreamController<String>();
when(mockFrontendServerStdErr.transform<String>(any)).thenReturn(stdErrStreamController.stream); when(mockFrontendServerStdErr.transform<String>(any)).thenReturn(stdErrStreamController.stream);
when(mockFrontendServer.stdin).thenReturn(mockFrontendServerStdIn); when(mockFrontendServer.stdin).thenReturn(mockFrontendServerStdIn);
when(mockProcessManager.canRun(any)).thenReturn(true);
when(mockProcessManager.start(any)).thenAnswer( when(mockProcessManager.start(any)).thenAnswer(
(Invocation invocation) => new Future<Process>.value(mockFrontendServer)); (Invocation invocation) => new Future<Process>.value(mockFrontendServer));
when(mockFrontendServer.exitCode).thenReturn(0); when(mockFrontendServer.exitCode).thenReturn(0);
...@@ -120,6 +121,7 @@ void main() { ...@@ -120,6 +121,7 @@ void main() {
when(mockFrontendServerStdErr.transform<String>(any)) when(mockFrontendServerStdErr.transform<String>(any))
.thenAnswer((Invocation invocation) => stdErrStreamController.stream); .thenAnswer((Invocation invocation) => stdErrStreamController.stream);
when(mockProcessManager.canRun(any)).thenReturn(true);
when(mockProcessManager.start(any)).thenAnswer( when(mockProcessManager.start(any)).thenAnswer(
(Invocation invocation) => new Future<Process>.value(mockFrontendServer) (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