Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/flutter_tools/lib/src/runner/local_engine.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,10 @@ class LocalEngineLocator {
// Determine the host engine directory associated with the local engine:
// Strip '_sim_' since there are no host simulator builds.
String _getHostEngineBasename(String localEngineBasename) {
if (localEngineBasename.startsWith('web_') || localEngineBasename.startsWith('wasm_')) {
// Don't modify the web local engine's basename.
if (localEngineBasename.startsWith('web_') ||
localEngineBasename.startsWith('wasm_') ||
localEngineBasename.startsWith('host_')) {
// Don't modify the web or host local engine's basename.
return localEngineBasename;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,30 @@ void main() {
expect(logger.traceText, contains('Local engine source at /arbitrary/engine/src'));
});

testWithoutContext('works if local engine is host engine with suffixes', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final Directory localEngine = fileSystem
.directory('$kArbitraryEngineRoot/src/out/host_debug_unopt_arm64/')
..createSync(recursive: true);

final BufferLogger logger = BufferLogger.test();
final LocalEngineLocator localEngineLocator = LocalEngineLocator(
fileSystem: fileSystem,
flutterRoot: 'flutter/flutter',
logger: logger,
userMessages: UserMessages(),
platform: FakePlatform(environment: <String, String>{}),
);

expect(
await localEngineLocator.findEnginePath(null, localEngine.path, null),
matchesEngineBuildPaths(
hostEngine: '/arbitrary/engine/src/out/host_debug_unopt_arm64',
targetEngine: '/arbitrary/engine/src/out/host_debug_unopt_arm64',
),
);
});

testWithoutContext('fails if host_debug does not exist', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final Directory localEngine = fileSystem
Expand Down