Unverified Commit 2e51077d authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Do not strip architecture suffixes from host local-engine (#115320)

* Do not strip suffices from host local-engine

* suffixes
parent a0a7b3a7
......@@ -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;
}
......
......@@ -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
......
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