Do not strip architecture suffixes from host local-engine (#115320)
* Do not strip suffices from host local-engine * suffixes
This commit is contained in:
parent
a0a7b3a70d
commit
2e51077d19
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user