[native assets] Rewrite install names for relocated native libraries (#153054)

Native libraries that are contributed by native asset builders can depend on each other. For macOS and iOS, native libraries are repackaged into Frameworks, which renders install names that have been written into dependent libraries invalid. 

With this change, a mapping between old and new install names is maintained, and install names in dependent libraries are rewritten as a final step.

Related to https://github.com/dart-lang/native/issues/190
This commit is contained in:
Gabriel Terwesten
2024-08-29 16:51:23 +02:00
committed by GitHub
parent 033e9b7912
commit f0860d83f5
21 changed files with 834 additions and 115 deletions

View File

@@ -52,6 +52,7 @@ import 'src/isolated/mustache_template.dart';
import 'src/isolated/native_assets/native_assets.dart';
import 'src/isolated/native_assets/test/native_assets.dart';
import 'src/isolated/resident_web_runner.dart';
import 'src/native_assets.dart';
import 'src/pre_run_validator.dart';
import 'src/project_validator.dart';
import 'src/resident_runner.dart';
@@ -141,6 +142,7 @@ Future<void> main(List<String> args) async {
// runner.run calls "terminal.applyFeatureFlags()"
},
PreRunValidator: () => PreRunValidator(fileSystem: globals.fs),
TestCompilerNativeAssetsBuilder: () => const TestCompilerNativeAssetsBuilderImpl(),
},
shutdownHooks: globals.shutdownHooks,
);
@@ -249,7 +251,7 @@ List<FlutterCommand> generateCommands({
TestCommand(
verboseHelp: verboseHelp,
verbose: verbose,
nativeAssetsBuilder: const TestCompilerNativeAssetsBuilderImpl(),
nativeAssetsBuilder: globals.nativeAssetsBuilder,
),
UpgradeCommand(verboseHelp: verboseHelp),
SymbolizeCommand(