[deps] Roll dart-lang/native
Change-Id: I38b68ed5b6d4497e36463b7be16258d2e7a7c0d0
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/402100
Reviewed-by: Martin Kustermann <kustermann@google.com>
diff --git a/DEPS b/DEPS
index 3d7a8e1..868974f 100644
--- a/DEPS
+++ b/DEPS
@@ -143,7 +143,7 @@
"markdown_rev": "4d5dbc659955973902f2585c54e94d453532db70",
"material_color_utilities_rev": "799b6ba2f3f1c28c67cc7e0b4f18e0c7d7f3c03e",
# dart-native-interop-team@ is rolling breaking changes manually while the assets features are in experimental.
- "native_rev": "4d81ce6c5e17164ef63d8a3f5144e5def0702207", # disable tools/rev_sdk_deps.dart
+ "native_rev": "7adf6bfa33e6042ffd9ae45f505bae30c6ee1fa6", # disable tools/rev_sdk_deps.dart
"package_config_rev": "76f2f6c245451da1fa24d7bbb00251b909e729a5",
"pool_rev": "f85209d83cb0aa3c5612ed80de32df51ba580abd",
"protobuf_rev": "da7279c56734cffed4deb1e3a6f93bdcefccf6b8",
diff --git a/pkg/dartdev/lib/src/commands/build.dart b/pkg/dartdev/lib/src/commands/build.dart
index 009f37a..2747b99 100644
--- a/pkg/dartdev/lib/src/commands/build.dart
+++ b/pkg/dartdev/lib/src/commands/build.dart
@@ -11,6 +11,7 @@
import 'package:dartdev/src/native_assets_bundling.dart';
import 'package:dartdev/src/sdk.dart';
import 'package:dartdev/src/utils.dart';
+import 'package:file/local.dart';
import 'package:front_end/src/api_prototype/compiler_options.dart'
show Verbosity;
import 'package:native_assets_builder/native_assets_builder.dart';
@@ -134,9 +135,11 @@
stdout.writeln('Building native assets.');
final workingDirectory = Directory.current.uri;
final target = Target.current;
- final targetMacOSVersion =
- target.os == OS.macOS ? minimumSupportedMacOSVersion : null;
+ final macOSConfig = target.os == OS.macOS
+ ? MacOSConfig(targetVersion: minimumSupportedMacOSVersion)
+ : null;
final nativeAssetsBuildRunner = NativeAssetsBuildRunner(
+ fileSystem: const LocalFileSystem(),
dartExecutable: Uri.file(sdk.dart),
logger: logger(verbose),
);
@@ -149,7 +152,7 @@
targetOS: target.os,
linkModePreference: LinkModePreference.dynamic,
targetArchitecture: target.architecture,
- targetMacOSVersion: targetMacOSVersion,
+ macOSConfig: macOSConfig,
cCompilerConfig: cCompilerConfig,
),
configValidator: (config) async => [
@@ -207,7 +210,7 @@
targetOS: target.os,
targetArchitecture: target.architecture,
linkModePreference: LinkModePreference.dynamic,
- targetMacOSVersion: targetMacOSVersion,
+ macOSConfig: macOSConfig,
cCompilerConfig: cCompilerConfig,
),
configValidator: (config) async => [
@@ -217,8 +220,6 @@
resourceIdentifiers:
recordUseEnabled ? Uri.file(recordedUsagesPath!) : null,
workingDirectory: workingDirectory,
-
-
buildResult: buildResult,
buildAssetTypes: [
CodeAsset.type,
diff --git a/pkg/dartdev/lib/src/native_assets.dart b/pkg/dartdev/lib/src/native_assets.dart
index 95f1961..b520030 100644
--- a/pkg/dartdev/lib/src/native_assets.dart
+++ b/pkg/dartdev/lib/src/native_assets.dart
@@ -8,6 +8,7 @@
import 'package:dartdev/src/native_assets_bundling.dart';
import 'package:dartdev/src/sdk.dart';
import 'package:dartdev/src/utils.dart';
+import 'package:file/local.dart';
import 'package:logging/logging.dart';
import 'package:native_assets_builder/native_assets_builder.dart';
import 'package:native_assets_cli/code_assets_builder.dart';
@@ -45,10 +46,12 @@
// This always runs in JIT mode.
dartExecutable: Uri.file(sdk.dart),
logger: logger(verbose),
+ fileSystem: const LocalFileSystem(),
);
final target = Target.current;
- final targetMacOSVersion =
- target.os == OS.macOS ? minimumSupportedMacOSVersion : null;
+ final macOSConfig = target.os == OS.macOS
+ ? MacOSConfig(targetVersion: minimumSupportedMacOSVersion)
+ : null;
final cCompilerConfig = getCCompilerConfig();
final buildResult = await nativeAssetsBuildRunner.build(
configCreator: () => BuildConfigBuilder()
@@ -57,7 +60,7 @@
targetArchitecture: target.architecture,
// When running in JIT mode, only dynamic libraries are supported.
linkModePreference: LinkModePreference.dynamic,
- targetMacOSVersion: targetMacOSVersion,
+ macOSConfig: macOSConfig,
cCompilerConfig: cCompilerConfig,
),
configValidator: (config) async => [
@@ -129,7 +132,10 @@
}
try {
final packageLayout =
- await PackageLayout.fromRootPackageRoot(workingDirectory);
+ await PackageLayout.fromRootPackageRoot(
+ const LocalFileSystem(),
+ workingDirectory,
+ );
final packagesWithNativeAssets = [
...await packageLayout.packagesWithAssets(Hook.build),
...await packageLayout.packagesWithAssets(Hook.link)
@@ -182,17 +188,13 @@
.toList();
final hasEnvScriptArgs = envScriptArgs != null && envScriptArgs.isNotEmpty;
- if (cc != null ||
- ar != null ||
- ld != null ||
- envScript != null ||
- hasEnvScriptArgs) {
+ if (cc != null && ar != null && ld != null) {
return CCompilerConfig(
- archiver: ar != null ? Uri.file(ar) : null,
- compiler: cc != null ? Uri.file(cc) : null,
+ archiver: Uri.file(ar),
+ compiler: Uri.file(cc),
envScript: envScript != null ? Uri.file(envScript) : null,
envScriptArgs: hasEnvScriptArgs ? envScriptArgs : null,
- linker: ld != null ? Uri.file(ld) : null,
+ linker: Uri.file(ld),
);
}
return null;
diff --git a/pkg/dartdev/pubspec.yaml b/pkg/dartdev/pubspec.yaml
index b396b56..d9ffef4 100644
--- a/pkg/dartdev/pubspec.yaml
+++ b/pkg/dartdev/pubspec.yaml
@@ -20,6 +20,7 @@
dds: any
dds_service_extensions: any
dtd_impl: any
+ file: any
front_end: any
frontend_server: any
http: any
@@ -39,7 +40,6 @@
# Use 'any' constraints here; we get our versions from the DEPS file.
dev_dependencies:
expect: any
- file: any
lints: any
pub_semver: any
test: any
diff --git a/pkg/dartdev/test/native_assets/helpers.dart b/pkg/dartdev/test/native_assets/helpers.dart
index c4e3414..c985ebb 100644
--- a/pkg/dartdev/test/native_assets/helpers.dart
+++ b/pkg/dartdev/test/native_assets/helpers.dart
@@ -5,6 +5,7 @@
import 'dart:async';
import 'dart:io';
+import 'package:file/local.dart';
import 'package:logging/logging.dart';
import 'package:native_assets_builder/src/utils/run_process.dart'
as run_process;
@@ -60,6 +61,7 @@
captureOutput: captureOutput,
expectedExitCode: expectedExitCode,
throwOnUnexpectedExitCode: throwOnUnexpectedExitCode,
+ filesystem: const LocalFileSystem(),
);
Future<void> copyTestProjects(