From 41c97b10163f5779810a048b18af582d41bf57ae Mon Sep 17 00:00:00 2001 From: Jessy Yameogo Date: Mon, 7 Oct 2024 15:51:17 -0400 Subject: [PATCH 01/13] Remove unsound null safety options from classes ModuleMetadata and MetadataProvider --- .../src/debugging/metadata/module_metadata.dart | 13 +++++++------ dwds/lib/src/debugging/metadata/provider.dart | 16 +++------------- dwds/test/metadata_test.dart | 4 ++-- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/dwds/lib/src/debugging/metadata/module_metadata.dart b/dwds/lib/src/debugging/metadata/module_metadata.dart index ce186df28..06c4bdf5a 100644 --- a/dwds/lib/src/debugging/metadata/module_metadata.dart +++ b/dwds/lib/src/debugging/metadata/module_metadata.dart @@ -114,8 +114,8 @@ class ModuleMetadata { /// Module uri final String moduleUri; - /// True if the module corresponding to this metadata was compiled with sound - /// null safety enabled. + // Keep the soundNullSafety flag for backward compatibility + @Deprecated('This field is deprecated as sound null safety is enforced.') final bool soundNullSafety; final Map libraries = {}; @@ -124,8 +124,8 @@ class ModuleMetadata { this.name, this.closureName, this.sourceMapUri, - this.moduleUri, - this.soundNullSafety, { + this.moduleUri, { + this.soundNullSafety = true, // Default to true String? ver, }) { version = ver ?? ModuleMetadataVersion.current.version; @@ -152,7 +152,9 @@ class ModuleMetadata { closureName = _readRequiredField(json, 'closureName'), sourceMapUri = _readRequiredField(json, 'sourceMapUri'), moduleUri = _readRequiredField(json, 'moduleUri'), - soundNullSafety = _readOptionalField(json, 'soundNullSafety') ?? false { + // Deprecated field still present for backward compatibility + // Defaults to true if missing + soundNullSafety = _readOptionalField(json, 'soundNullSafety') ?? true { if (!ModuleMetadataVersion.current.isCompatibleWith(version) && !ModuleMetadataVersion.previous.isCompatibleWith(version)) { throw Exception('Unsupported metadata version $version. ' @@ -174,7 +176,6 @@ class ModuleMetadata { 'sourceMapUri': sourceMapUri, 'moduleUri': moduleUri, 'libraries': [for (final lib in libraries.values) lib.toJson()], - 'soundNullSafety': soundNullSafety, }; } } diff --git a/dwds/lib/src/debugging/metadata/provider.dart b/dwds/lib/src/debugging/metadata/provider.dart index 41541659f..dfe46ec0f 100644 --- a/dwds/lib/src/debugging/metadata/provider.dart +++ b/dwds/lib/src/debugging/metadata/provider.dart @@ -15,7 +15,8 @@ class MetadataProvider { final AssetReader _assetReader; final _logger = Logger('MetadataProvider'); final String entrypoint; - bool _soundNullSafety; + @Deprecated('This field is deprecated as sound null safety is enforced.') + final bool _soundNullSafety = true; final List _libraries = []; final Map _scriptToModule = {}; final Map _moduleToSourceMap = {}; @@ -65,8 +66,7 @@ class MetadataProvider { 'dart:ui', ]; - MetadataProvider(this.entrypoint, this._assetReader) - : _soundNullSafety = false; + MetadataProvider(this.entrypoint, this._assetReader); /// A sound null safety mode for the whole app. /// @@ -178,8 +178,6 @@ class MetadataProvider { Future _initialize() async { await _metadataMemoizer.runOnce(() async { - var hasSoundNullSafety = true; - var hasUnsoundNullSafety = true; // The merged metadata resides next to the entrypoint. // Assume that .bootstrap.js has .ddc_merged_metadata if (entrypoint.endsWith('.bootstrap.js')) { @@ -199,8 +197,6 @@ class MetadataProvider { final metadata = ModuleMetadata.fromJson(moduleJson as Map); _addMetadata(metadata); - hasUnsoundNullSafety &= !metadata.soundNullSafety; - hasSoundNullSafety &= metadata.soundNullSafety; _logger .fine('Loaded debug metadata for module: ${metadata.name}'); } catch (e) { @@ -208,13 +204,7 @@ class MetadataProvider { rethrow; } } - if (!hasSoundNullSafety && !hasUnsoundNullSafety) { - throw Exception('Metadata contains modules with mixed null safety'); - } - _soundNullSafety = hasSoundNullSafety; } - _logger.info('Loaded debug metadata ' - '(${_soundNullSafety ? "sound" : "weak"} null safety)'); } }); } diff --git a/dwds/test/metadata_test.dart b/dwds/test/metadata_test.dart index 046e635e7..fc8ae177e 100644 --- a/dwds/test/metadata_test.dart +++ b/dwds/test/metadata_test.dart @@ -69,7 +69,7 @@ void main() { await provider.libraries, contains('org-dartlang-app:///web/main.dart'), ); - expect(await provider.soundNullSafety, false); + expect(await provider.soundNullSafety, true); }); test('throws on metadata with absolute import uris', () async { @@ -114,6 +114,6 @@ void main() { expect(parts.length, 1); expect(parts[0], 'org-dartlang-app:///web/main.dart'); } - expect(metadata.soundNullSafety, false); + expect(metadata.soundNullSafety, true); }); } From 23ff7d10f068c717376b2c902420fa1a3f59f56d Mon Sep 17 00:00:00 2001 From: Jessy Yameogo Date: Mon, 7 Oct 2024 15:56:19 -0400 Subject: [PATCH 02/13] updated changelog --- dwds/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/dwds/CHANGELOG.md b/dwds/CHANGELOG.md index 95cd526b0..597627616 100644 --- a/dwds/CHANGELOG.md +++ b/dwds/CHANGELOG.md @@ -1,5 +1,6 @@ ## 24.2.0-wip - Replace deprecated JS code `this.__proto__` with `Object.getPrototypeOf(this)` - [#2500](https://github.com/dart-lang/webdev/pull/2500) +- Removed unsound null safety options from classes ModuleMetadata and MetadataProvider - [#2427](https://github.com/dart-lang/webdev/issues/2427) ## 24.1.0 From ee10f9b9f612547a56dcb39644ee7d2455155d7d Mon Sep 17 00:00:00 2001 From: Jessy Yameogo Date: Tue, 8 Oct 2024 10:50:51 -0400 Subject: [PATCH 03/13] Removed unsound null safety options from classes ModuleMetadata, MetadataProvider & Metadata_test. --- dwds/CHANGELOG.md | 2 +- dwds/lib/src/debugging/metadata/module_metadata.dart | 10 +--------- dwds/lib/src/debugging/metadata/provider.dart | 4 +--- dwds/test/metadata_test.dart | 1 - 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/dwds/CHANGELOG.md b/dwds/CHANGELOG.md index 009f1f162..07f7c7543 100644 --- a/dwds/CHANGELOG.md +++ b/dwds/CHANGELOG.md @@ -2,7 +2,7 @@ - Replace deprecated JS code `this.__proto__` with `Object.getPrototypeOf(this)`. - [#2500](https://github.com/dart-lang/webdev/pull/2500) - Migrate injected client code to `package:web`. - [#2491](https://github.com/dart-lang/webdev/pull/2491) -- Removed unsound null safety options from classes ModuleMetadata and MetadataProvider - [#2427](https://github.com/dart-lang/webdev/issues/2427) +- Removed unsound null safety options from classes ModuleMetadata, MetadataProvider & Metadata_test. - [#2427](https://github.com/dart-lang/webdev/issues/2427) ## 24.1.0 diff --git a/dwds/lib/src/debugging/metadata/module_metadata.dart b/dwds/lib/src/debugging/metadata/module_metadata.dart index 06c4bdf5a..2a83d1a27 100644 --- a/dwds/lib/src/debugging/metadata/module_metadata.dart +++ b/dwds/lib/src/debugging/metadata/module_metadata.dart @@ -114,10 +114,6 @@ class ModuleMetadata { /// Module uri final String moduleUri; - // Keep the soundNullSafety flag for backward compatibility - @Deprecated('This field is deprecated as sound null safety is enforced.') - final bool soundNullSafety; - final Map libraries = {}; ModuleMetadata( @@ -125,7 +121,6 @@ class ModuleMetadata { this.closureName, this.sourceMapUri, this.moduleUri, { - this.soundNullSafety = true, // Default to true String? ver, }) { version = ver ?? ModuleMetadataVersion.current.version; @@ -151,10 +146,7 @@ class ModuleMetadata { name = _readRequiredField(json, 'name'), closureName = _readRequiredField(json, 'closureName'), sourceMapUri = _readRequiredField(json, 'sourceMapUri'), - moduleUri = _readRequiredField(json, 'moduleUri'), - // Deprecated field still present for backward compatibility - // Defaults to true if missing - soundNullSafety = _readOptionalField(json, 'soundNullSafety') ?? true { + moduleUri = _readRequiredField(json, 'moduleUri') { if (!ModuleMetadataVersion.current.isCompatibleWith(version) && !ModuleMetadataVersion.previous.isCompatibleWith(version)) { throw Exception('Unsupported metadata version $version. ' diff --git a/dwds/lib/src/debugging/metadata/provider.dart b/dwds/lib/src/debugging/metadata/provider.dart index dfe46ec0f..570defb9e 100644 --- a/dwds/lib/src/debugging/metadata/provider.dart +++ b/dwds/lib/src/debugging/metadata/provider.dart @@ -15,8 +15,6 @@ class MetadataProvider { final AssetReader _assetReader; final _logger = Logger('MetadataProvider'); final String entrypoint; - @Deprecated('This field is deprecated as sound null safety is enforced.') - final bool _soundNullSafety = true; final List _libraries = []; final Map _scriptToModule = {}; final Map _moduleToSourceMap = {}; @@ -73,7 +71,7 @@ class MetadataProvider { /// All libraries have to agree on null safety mode. Future get soundNullSafety async { await _initialize(); - return _soundNullSafety; + return true; } /// A list of all libraries in the Dart application. diff --git a/dwds/test/metadata_test.dart b/dwds/test/metadata_test.dart index fc8ae177e..aa320d116 100644 --- a/dwds/test/metadata_test.dart +++ b/dwds/test/metadata_test.dart @@ -114,6 +114,5 @@ void main() { expect(parts.length, 1); expect(parts[0], 'org-dartlang-app:///web/main.dart'); } - expect(metadata.soundNullSafety, true); }); } From 42360274fd89d60413eb9972f26a969ea12d61cd Mon Sep 17 00:00:00 2001 From: Jessy Yameogo Date: Wed, 9 Oct 2024 13:20:26 -0400 Subject: [PATCH 04/13] deprecated metadataProvider's soundNullSafety and associated tests --- dwds/CHANGELOG.md | 2 +- dwds/lib/src/debugging/metadata/provider.dart | 3 +++ .../src/services/chrome_proxy_service.dart | 8 ++----- dwds/test/metadata_test.dart | 22 ------------------- 4 files changed, 6 insertions(+), 29 deletions(-) diff --git a/dwds/CHANGELOG.md b/dwds/CHANGELOG.md index 07f7c7543..ab17743f7 100644 --- a/dwds/CHANGELOG.md +++ b/dwds/CHANGELOG.md @@ -2,7 +2,7 @@ - Replace deprecated JS code `this.__proto__` with `Object.getPrototypeOf(this)`. - [#2500](https://github.com/dart-lang/webdev/pull/2500) - Migrate injected client code to `package:web`. - [#2491](https://github.com/dart-lang/webdev/pull/2491) -- Removed unsound null safety options from classes ModuleMetadata, MetadataProvider & Metadata_test. - [#2427](https://github.com/dart-lang/webdev/issues/2427) +- Deprecated MetadataProvider's soundNullSafety'. - [#2427](https://github.com/dart-lang/webdev/issues/2427) ## 24.1.0 diff --git a/dwds/lib/src/debugging/metadata/provider.dart b/dwds/lib/src/debugging/metadata/provider.dart index 570defb9e..1068d2320 100644 --- a/dwds/lib/src/debugging/metadata/provider.dart +++ b/dwds/lib/src/debugging/metadata/provider.dart @@ -69,6 +69,9 @@ class MetadataProvider { /// A sound null safety mode for the whole app. /// /// All libraries have to agree on null safety mode. + @Deprecated( + 'This field is deprecated. Use sound null safety enforcement instead.', + ) Future get soundNullSafety async { await _initialize(); return true; diff --git a/dwds/lib/src/services/chrome_proxy_service.dart b/dwds/lib/src/services/chrome_proxy_service.dart index bea4a9a1a..8fda1c459 100644 --- a/dwds/lib/src/services/chrome_proxy_service.dart +++ b/dwds/lib/src/services/chrome_proxy_service.dart @@ -204,13 +204,9 @@ class ChromeProxyService implements VmServiceInterface { final moduleFormat = loadStrategy.moduleFormat; final canaryFeatures = loadStrategy.buildSettings.canaryFeatures; final experiments = loadStrategy.buildSettings.experiments; + final soundNullSafety = true; - // TODO(annagrin): Read null safety setting from the build settings. - final metadataProvider = loadStrategy.metadataProviderFor(entrypoint); - final soundNullSafety = await metadataProvider.soundNullSafety; - - _logger.info('Initializing expression compiler for $entrypoint ' - 'with sound null safety: $soundNullSafety'); + _logger.info('Initializing expression compiler for $entrypoint'); final compilerOptions = CompilerOptions( moduleFormat: ModuleFormat.values.byName(moduleFormat), diff --git a/dwds/test/metadata_test.dart b/dwds/test/metadata_test.dart index aa320d116..3b75af522 100644 --- a/dwds/test/metadata_test.dart +++ b/dwds/test/metadata_test.dart @@ -22,15 +22,6 @@ const _emptySourceMetadata = '"fileUri":"org-dartlang-app:///web/main.dart","partUris":[]}]}\n' '// intentionally empty: package blah has no dart sources'; -const _noNullSafetyMetadata = - '{"version":"1.0.0","name":"web/main","closureName":"load__web__main",' - '"sourceMapUri":"foo/web/main.ddc.js.map",' - '"moduleUri":"foo/web/main.ddc.js",' - '"libraries":[{"name":"main",' - '"importUri":"org-dartlang-app:///web/main.dart",' - '"fileUri":"org-dartlang-app:///web/main.dart","partUris":[]}]}\n' - '// intentionally empty: package blah has no dart sources'; - const _fileUriMetadata = '{"version":"1.0.0","name":"web/main","closureName":"load__web__main",' '"sourceMapUri":"foo/web/main.ddc.js.map",' @@ -57,19 +48,6 @@ void main() { await provider.libraries, contains('org-dartlang-app:///web/main.dart'), ); - expect(await provider.soundNullSafety, isNotNull); - }); - - test('can parse metadata with no null safety information', () async { - final provider = MetadataProvider( - 'foo.bootstrap.js', - FakeAssetReader(metadata: _noNullSafetyMetadata), - ); - expect( - await provider.libraries, - contains('org-dartlang-app:///web/main.dart'), - ); - expect(await provider.soundNullSafety, true); }); test('throws on metadata with absolute import uris', () async { From 1d3d9cde54a2568d2967f03855b68c327bc2b7d9 Mon Sep 17 00:00:00 2001 From: Jessy Yameogo Date: Thu, 10 Oct 2024 10:52:49 -0400 Subject: [PATCH 05/13] Deprecated CompilerOptions' soundNullSafety and related usage --- dwds/CHANGELOG.md | 2 +- dwds/lib/src/debugging/metadata/provider.dart | 4 +- .../src/services/chrome_proxy_service.dart | 2 - .../lib/src/services/expression_compiler.dart | 5 +- .../services/expression_compiler_service.dart | 17 +---- ..._compiler_service_ddc_and_canary_test.dart | 1 - .../expression_compiler_service_test.dart | 1 - dwds/test/fixtures/utilities.dart | 2 +- dwds/test/metadata_test.dart | 2 - frontend_server_common/lib/src/devfs.dart | 20 ++---- .../lib/src/frontend_server_client.dart | 4 +- .../lib/src/resident_runner.dart | 5 +- test_common/lib/sdk_asset_generator.dart | 65 ++++++------------- 13 files changed, 39 insertions(+), 91 deletions(-) diff --git a/dwds/CHANGELOG.md b/dwds/CHANGELOG.md index ab17743f7..8d6a08bb6 100644 --- a/dwds/CHANGELOG.md +++ b/dwds/CHANGELOG.md @@ -2,7 +2,7 @@ - Replace deprecated JS code `this.__proto__` with `Object.getPrototypeOf(this)`. - [#2500](https://github.com/dart-lang/webdev/pull/2500) - Migrate injected client code to `package:web`. - [#2491](https://github.com/dart-lang/webdev/pull/2491) -- Deprecated MetadataProvider's soundNullSafety'. - [#2427](https://github.com/dart-lang/webdev/issues/2427) +- Deprecated MetadataProvider's & CompilerOptions' soundNullSafety. - [#2427](https://github.com/dart-lang/webdev/issues/2427) ## 24.1.0 diff --git a/dwds/lib/src/debugging/metadata/provider.dart b/dwds/lib/src/debugging/metadata/provider.dart index 1068d2320..43d00e102 100644 --- a/dwds/lib/src/debugging/metadata/provider.dart +++ b/dwds/lib/src/debugging/metadata/provider.dart @@ -69,9 +69,7 @@ class MetadataProvider { /// A sound null safety mode for the whole app. /// /// All libraries have to agree on null safety mode. - @Deprecated( - 'This field is deprecated. Use sound null safety enforcement instead.', - ) + @Deprecated('Only sound null safety is supported as of Dart 3.0') Future get soundNullSafety async { await _initialize(); return true; diff --git a/dwds/lib/src/services/chrome_proxy_service.dart b/dwds/lib/src/services/chrome_proxy_service.dart index 8fda1c459..8690b39dc 100644 --- a/dwds/lib/src/services/chrome_proxy_service.dart +++ b/dwds/lib/src/services/chrome_proxy_service.dart @@ -204,13 +204,11 @@ class ChromeProxyService implements VmServiceInterface { final moduleFormat = loadStrategy.moduleFormat; final canaryFeatures = loadStrategy.buildSettings.canaryFeatures; final experiments = loadStrategy.buildSettings.experiments; - final soundNullSafety = true; _logger.info('Initializing expression compiler for $entrypoint'); final compilerOptions = CompilerOptions( moduleFormat: ModuleFormat.values.byName(moduleFormat), - soundNullSafety: soundNullSafety, canaryFeatures: canaryFeatures, experiments: experiments, ); diff --git a/dwds/lib/src/services/expression_compiler.dart b/dwds/lib/src/services/expression_compiler.dart index c1b7306b3..9a2526d76 100644 --- a/dwds/lib/src/services/expression_compiler.dart +++ b/dwds/lib/src/services/expression_compiler.dart @@ -5,13 +5,16 @@ /// Options passed to DDC and the expression compiler. class CompilerOptions { final ModuleFormat moduleFormat; + + @Deprecated('Only sound null safety is supported as of Dart 3.0') final bool soundNullSafety; + final bool canaryFeatures; final List experiments; CompilerOptions({ required this.moduleFormat, - required this.soundNullSafety, + this.soundNullSafety = true, required this.canaryFeatures, required this.experiments, }); diff --git a/dwds/lib/src/services/expression_compiler_service.dart b/dwds/lib/src/services/expression_compiler_service.dart index 0173fef1d..e533df869 100644 --- a/dwds/lib/src/services/expression_compiler_service.dart +++ b/dwds/lib/src/services/expression_compiler_service.dart @@ -53,9 +53,6 @@ class _Compiler { /// expression compilation (summaries, libraries spec, compiler worker /// snapshot). /// - /// [soundNullSafety] indicates if the compiler should support sound - /// null safety. - /// /// Performs handshake with the isolate running expression compiler /// worker to establish communication via send/receive ports, returns /// the service after the communication is established. @@ -69,16 +66,10 @@ class _Compiler { bool verbose, ) async { sdkConfiguration.validateSdkDir(); - if (compilerOptions.soundNullSafety) { - sdkConfiguration.validateSoundSummaries(); - } else { - sdkConfiguration.validateWeakSummaries(); - } + sdkConfiguration.validateSoundSummaries(); final workerUri = sdkConfiguration.compilerWorkerUri!; - final sdkSummaryUri = compilerOptions.soundNullSafety - ? sdkConfiguration.soundSdkSummaryUri! - : sdkConfiguration.weakSdkSummaryUri!; + final sdkSummaryUri = sdkConfiguration.soundSdkSummaryUri!; final args = [ '--experimental-expression-compiler', @@ -91,9 +82,7 @@ class _Compiler { '--module-format', compilerOptions.moduleFormat.name, if (verbose) '--verbose', - compilerOptions.soundNullSafety - ? '--sound-null-safety' - : '--no-sound-null-safety', + '--sound-null-safety', for (final experiment in compilerOptions.experiments) '--enable-experiment=$experiment', if (compilerOptions.canaryFeatures) '--canary', diff --git a/dwds/test/expression_compiler_service_ddc_and_canary_test.dart b/dwds/test/expression_compiler_service_ddc_and_canary_test.dart index 658d8aa67..53ce3674a 100644 --- a/dwds/test/expression_compiler_service_ddc_and_canary_test.dart +++ b/dwds/test/expression_compiler_service_ddc_and_canary_test.dart @@ -16,7 +16,6 @@ void main() async { testAll( compilerOptions: CompilerOptions( moduleFormat: ModuleFormat.ddc, - soundNullSafety: true, canaryFeatures: true, experiments: const [], ), diff --git a/dwds/test/expression_compiler_service_test.dart b/dwds/test/expression_compiler_service_test.dart index 5f59de857..19c8bdc3a 100644 --- a/dwds/test/expression_compiler_service_test.dart +++ b/dwds/test/expression_compiler_service_test.dart @@ -16,7 +16,6 @@ void main() async { testAll( compilerOptions: CompilerOptions( moduleFormat: ModuleFormat.amd, - soundNullSafety: true, canaryFeatures: false, experiments: const [], ), diff --git a/dwds/test/fixtures/utilities.dart b/dwds/test/fixtures/utilities.dart index 8f993cef6..30e1455d6 100644 --- a/dwds/test/fixtures/utilities.dart +++ b/dwds/test/fixtures/utilities.dart @@ -300,5 +300,5 @@ class TestCompilerOptions extends CompilerOptions { required super.canaryFeatures, super.experiments = const [], super.moduleFormat = ModuleFormat.amd, - }) : super(soundNullSafety: true); + }); } diff --git a/dwds/test/metadata_test.dart b/dwds/test/metadata_test.dart index 3b75af522..546132ff2 100644 --- a/dwds/test/metadata_test.dart +++ b/dwds/test/metadata_test.dart @@ -16,7 +16,6 @@ const _emptySourceMetadata = '{"version":"1.0.0","name":"web/main","closureName":"load__web__main",' '"sourceMapUri":"foo/web/main.ddc.js.map",' '"moduleUri":"foo/web/main.ddc.js",' - '"soundNullSafety":true,' '"libraries":[{"name":"main",' '"importUri":"org-dartlang-app:///web/main.dart",' '"fileUri":"org-dartlang-app:///web/main.dart","partUris":[]}]}\n' @@ -26,7 +25,6 @@ const _fileUriMetadata = '{"version":"1.0.0","name":"web/main","closureName":"load__web__main",' '"sourceMapUri":"foo/web/main.ddc.js.map",' '"moduleUri":"foo/web/main.ddc.js",' - '"soundNullSafety":true,' '"libraries":[{"name":"main",' '"importUri":"file:/Users/foo/blah/sample/lib/bar.dart",' '"fileUri":"org-dartlang-app:///web/main.dart","partUris":[]}]}\n' diff --git a/frontend_server_common/lib/src/devfs.dart b/frontend_server_common/lib/src/devfs.dart index fa0e39d45..cfb940ebd 100644 --- a/frontend_server_common/lib/src/devfs.dart +++ b/frontend_server_common/lib/src/devfs.dart @@ -24,7 +24,7 @@ class WebDevFS { required this.projectDirectory, required this.packageUriMapper, required this.index, - required this.soundNullSafety, + this.soundNullSafety = true, this.urlTunneler, required this.sdkLayout, required this.ddcModuleFormat, @@ -38,7 +38,10 @@ class WebDevFS { final PackageUriMapper packageUriMapper; final String index; final UrlEncoder? urlTunneler; + + @Deprecated('Only sound null safety is supported as of Dart 3.0') final bool soundNullSafety; + final TestSdkLayout sdkLayout; final ModuleFormat ddcModuleFormat; late final Directory _savedCurrentDirectory; @@ -142,9 +145,8 @@ class WebDevFS { assetServer.writeFile('main_module.digests', '{}'); - final sdk = soundNullSafety ? dartSdk : dartSdkWeak; - final sdkSourceMap = - soundNullSafety ? dartSdkSourcemap : dartSdkSourcemapWeak; + final sdk = dartSdk; + final sdkSourceMap = dartSdkSourcemap; assetServer.writeFile('dart_sdk.js', sdk.readAsStringSync()); assetServer.writeFile('dart_sdk.js.map', sdkSourceMap.readAsStringSync()); @@ -189,21 +191,11 @@ class WebDevFS { File get ddcModuleLoaderJS => fileSystem.file(sdkLayout.ddcModuleLoaderJsPath); File get requireJS => fileSystem.file(sdkLayout.requireJsPath); - File get dartSdkWeak => fileSystem.file(switch (ddcModuleFormat) { - ModuleFormat.amd => sdkLayout.weakAmdJsPath, - ModuleFormat.ddc => sdkLayout.weakDdcJsPath, - _ => throw Exception('Unsupported DDC module format $ddcModuleFormat.') - }); File get dartSdk => fileSystem.file(switch (ddcModuleFormat) { ModuleFormat.amd => sdkLayout.soundAmdJsPath, ModuleFormat.ddc => sdkLayout.soundDdcJsPath, _ => throw Exception('Unsupported DDC module format $ddcModuleFormat.') }); - File get dartSdkSourcemapWeak => fileSystem.file(switch (ddcModuleFormat) { - ModuleFormat.amd => sdkLayout.weakAmdJsMapPath, - ModuleFormat.ddc => sdkLayout.weakDdcJsMapPath, - _ => throw Exception('Unsupported DDC module format $ddcModuleFormat.') - }); File get dartSdkSourcemap => fileSystem.file(switch (ddcModuleFormat) { ModuleFormat.amd => sdkLayout.soundAmdJsMapPath, ModuleFormat.ddc => sdkLayout.soundDdcJsMapPath, diff --git a/frontend_server_common/lib/src/frontend_server_client.dart b/frontend_server_common/lib/src/frontend_server_client.dart index 4c7d61758..9151cdda8 100644 --- a/frontend_server_common/lib/src/frontend_server_client.dart +++ b/frontend_server_common/lib/src/frontend_server_client.dart @@ -386,9 +386,7 @@ class ResidentCompiler { ], if (useDebuggerModuleNames) '--debugger-module-names', '--experimental-emit-debug-metadata', - compilerOptions.soundNullSafety - ? '--sound-null-safety' - : '--no-sound-null-safety', + '--sound-null-safety', for (final experiment in compilerOptions.experiments) '--enable-experiment=$experiment', if (compilerOptions.canaryFeatures) '--dartdevc-canary', diff --git a/frontend_server_common/lib/src/resident_runner.dart b/frontend_server_common/lib/src/resident_runner.dart index ab15ea035..9d4d5c9a2 100644 --- a/frontend_server_common/lib/src/resident_runner.dart +++ b/frontend_server_common/lib/src/resident_runner.dart @@ -33,9 +33,7 @@ class ResidentWebRunner { required this.sdkLayout, bool verbose = false, }) { - final platformDillUri = Uri.file(compilerOptions.soundNullSafety - ? sdkLayout.soundSummaryPath - : sdkLayout.weakSummaryPath); + final platformDillUri = Uri.file(sdkLayout.soundSummaryPath); generator = ResidentCompiler( sdkLayout.sdkDirectory, @@ -79,7 +77,6 @@ class ResidentWebRunner { packageUriMapper: packageUriMapper, index: index, urlTunneler: urlTunneler, - soundNullSafety: compilerOptions.soundNullSafety, sdkLayout: sdkLayout, ddcModuleFormat: compilerOptions.moduleFormat, ); diff --git a/test_common/lib/sdk_asset_generator.dart b/test_common/lib/sdk_asset_generator.dart index bcf6d7977..f865a3f85 100644 --- a/test_common/lib/sdk_asset_generator.dart +++ b/test_common/lib/sdk_asset_generator.dart @@ -42,69 +42,54 @@ class SdkAssetGenerator { // i.e. flutter SDK or build_web_compilers. // Generate missing files for tests if needed. await _generateSdkJavaScript( - soundNullSafety: true, canaryFeatures: canaryFeatures, ); // SDK does not contain any weak assets, generate them. await _generateSdkJavaScript( - soundNullSafety: false, canaryFeatures: canaryFeatures, ); - await _generateSdkSummary(soundNullSafety: false); + await _generateSdkSummary(); } } String resolveSdkJsPath({ - required bool soundNullSafety, required bool canaryFeatures, }) => - switch ((soundNullSafety, ddcModuleFormat)) { - (true, ModuleFormat.amd) => sdkLayout.soundAmdJsPath, - (false, ModuleFormat.amd) => sdkLayout.weakAmdJsPath, - (true, ModuleFormat.ddc) => sdkLayout.soundDdcJsPath, - (false, ModuleFormat.ddc) => sdkLayout.weakDdcJsPath, + switch (ddcModuleFormat) { + ModuleFormat.amd => sdkLayout.soundAmdJsPath, + ModuleFormat.ddc => sdkLayout.soundDdcJsPath, _ => throw Exception('Unsupported DDC module format $ddcModuleFormat.') }; String resolveSdkSourcemapPath({ - required bool soundNullSafety, required bool canaryFeatures, }) => - switch ((soundNullSafety, ddcModuleFormat)) { - (true, ModuleFormat.amd) => sdkLayout.soundAmdJsMapPath, - (false, ModuleFormat.amd) => sdkLayout.weakAmdJsMapPath, - (true, ModuleFormat.ddc) => sdkLayout.soundDdcJsMapPath, - (false, ModuleFormat.ddc) => sdkLayout.weakDdcJsMapPath, + switch (ddcModuleFormat) { + ModuleFormat.amd => sdkLayout.soundAmdJsMapPath, + ModuleFormat.ddc => sdkLayout.soundDdcJsMapPath, _ => throw Exception('Unsupported DDC module format $ddcModuleFormat.') }; String resolveSdkJsFilename({ - required bool soundNullSafety, required bool canaryFeatures, }) => - switch ((soundNullSafety, ddcModuleFormat)) { - (true, ModuleFormat.amd) => sdkLayout.soundAmdJsFileName, - (false, ModuleFormat.amd) => sdkLayout.weakAmdJsFileName, - (true, ModuleFormat.ddc) => sdkLayout.soundDdcJsFileName, - (false, ModuleFormat.ddc) => sdkLayout.weakDdcJsFileName, + switch (ddcModuleFormat) { + ModuleFormat.amd => sdkLayout.soundAmdJsFileName, + ModuleFormat.ddc => sdkLayout.soundDdcJsFileName, _ => throw Exception('Unsupported DDC module format $ddcModuleFormat.') }; Future _generateSdkJavaScript({ - required bool soundNullSafety, required bool canaryFeatures, }) async { Directory? outputDir; try { // Files to copy generated files to. - final outputJsPath = resolveSdkJsPath( - soundNullSafety: soundNullSafety, canaryFeatures: canaryFeatures); - final outputJsMapPath = resolveSdkSourcemapPath( - soundNullSafety: soundNullSafety, canaryFeatures: canaryFeatures); - final outputFullDillPath = soundNullSafety - ? sdkLayout.soundFullDillPath - : sdkLayout.weakFullDillPath; + final outputJsPath = resolveSdkJsPath(canaryFeatures: canaryFeatures); + final outputJsMapPath = + resolveSdkSourcemapPath(canaryFeatures: canaryFeatures); + final outputFullDillPath = sdkLayout.soundFullDillPath; final hasJsAsset = _exists(outputJsPath); final hasJsMapAsset = _exists(outputJsMapPath); @@ -120,9 +105,7 @@ class SdkAssetGenerator { // Files to generate final jsPath = p.join( outputDir.path, - resolveSdkJsFilename( - soundNullSafety: soundNullSafety, - canaryFeatures: canaryFeatures)); + resolveSdkJsFilename(canaryFeatures: canaryFeatures)); final jsMapPath = p.setExtension(jsPath, '.js.map'); final fullDillPath = p.setExtension(jsPath, '.dill'); @@ -140,7 +123,7 @@ class SdkAssetGenerator { 'org-dartlang-sdk:///lib/libraries.json', '--modules', ddcModuleFormat.name, - soundNullSafety ? '--sound-null-safety' : '--no-sound-null-safety', + '--sound-null-safety', 'dart:core', '-o', jsPath, @@ -193,13 +176,11 @@ class SdkAssetGenerator { } } - Future _generateSdkSummary({required bool soundNullSafety}) async { + Future _generateSdkSummary() async { Directory? outputDir; try { // Files to copy generated files to. - final outputSummaryPath = soundNullSafety - ? sdkLayout.soundSummaryPath - : sdkLayout.weakSummaryPath; + final outputSummaryPath = sdkLayout.soundSummaryPath; final hasAssets = _exists(outputSummaryPath); // Files already exist. @@ -207,9 +188,8 @@ class SdkAssetGenerator { // Generate missing files. outputDir = fileSystem.systemTempDirectory.createTempSync(); - final summaryPath = soundNullSafety - ? p.join(outputDir.path, sdkLayout.soundSummaryFileName) - : p.join(outputDir.path, sdkLayout.weakSummaryFileName); + final summaryPath = + p.join(outputDir.path, sdkLayout.soundSummaryFileName); _logger.info('Generating SDK summary files...'); @@ -227,10 +207,7 @@ class SdkAssetGenerator { '--source', 'dart:core', '--summary-only', - if (soundNullSafety) - '--sound-null-safety' - else - '--no-sound-null-safety', + '--sound-null-safety', '--output', summaryPath, if (verbose) '--verbose', From b2c1366f99b318fb64baf5ff397d2c3d7f9e5ec9 Mon Sep 17 00:00:00 2001 From: Jessy Yameogo Date: Thu, 10 Oct 2024 11:08:14 -0400 Subject: [PATCH 06/13] deprecated sdk_configuration_test's soundNullSafety --- .../services/expression_compiler_service.dart | 4 +- dwds/lib/src/utilities/sdk_configuration.dart | 50 ++++--------------- dwds/test/sdk_configuration_test.dart | 30 ++++------- 3 files changed, 23 insertions(+), 61 deletions(-) diff --git a/dwds/lib/src/services/expression_compiler_service.dart b/dwds/lib/src/services/expression_compiler_service.dart index e533df869..a0b9a3f7f 100644 --- a/dwds/lib/src/services/expression_compiler_service.dart +++ b/dwds/lib/src/services/expression_compiler_service.dart @@ -66,10 +66,10 @@ class _Compiler { bool verbose, ) async { sdkConfiguration.validateSdkDir(); - sdkConfiguration.validateSoundSummaries(); + sdkConfiguration.validateSummaries(); final workerUri = sdkConfiguration.compilerWorkerUri!; - final sdkSummaryUri = sdkConfiguration.soundSdkSummaryUri!; + final sdkSummaryUri = sdkConfiguration.sdkSummaryUri!; final args = [ '--experimental-expression-compiler', diff --git a/dwds/lib/src/utilities/sdk_configuration.dart b/dwds/lib/src/utilities/sdk_configuration.dart index dcac68659..1f2b49735 100644 --- a/dwds/lib/src/utilities/sdk_configuration.dart +++ b/dwds/lib/src/utilities/sdk_configuration.dart @@ -42,25 +42,18 @@ class SdkLayout { SdkLayout.createDefault(defaultSdkDirectory); final String sdkDirectory; - final String soundSummaryPath; - final String weakSummaryPath; + final String summaryPath; final String dartdevcSnapshotPath; SdkLayout.createDefault(String sdkDirectory) : this( sdkDirectory: sdkDirectory, - soundSummaryPath: p.join( + summaryPath: p.join( sdkDirectory, 'lib', '_internal', 'ddc_outline.dill', ), - weakSummaryPath: p.join( - sdkDirectory, - 'lib', - '_internal', - 'ddc_outline_unsound.dill', - ), dartdevcSnapshotPath: p.join( sdkDirectory, 'bin', @@ -71,8 +64,7 @@ class SdkLayout { const SdkLayout({ required this.sdkDirectory, - required this.soundSummaryPath, - required this.weakSummaryPath, + required this.summaryPath, required this.dartdevcSnapshotPath, }); } @@ -87,14 +79,12 @@ class SdkConfiguration { SdkConfiguration.fromSdkLayout(SdkLayout.defaultSdkLayout); final String? sdkDirectory; - final String? weakSdkSummaryPath; - final String? soundSdkSummaryPath; + final String? sdkSummaryPath; final String? compilerWorkerPath; const SdkConfiguration({ this.sdkDirectory, - this.weakSdkSummaryPath, - this.soundSdkSummaryPath, + this.sdkSummaryPath, this.compilerWorkerPath, }); @@ -103,8 +93,7 @@ class SdkConfiguration { SdkConfiguration.fromSdkLayout(SdkLayout sdkLayout) : this( sdkDirectory: sdkLayout.sdkDirectory, - weakSdkSummaryPath: sdkLayout.weakSummaryPath, - soundSdkSummaryPath: sdkLayout.soundSummaryPath, + sdkSummaryPath: sdkLayout.summaryPath, compilerWorkerPath: sdkLayout.dartdevcSnapshotPath, ); @@ -113,8 +102,7 @@ class SdkConfiguration { path == null ? null : p.toUri(p.absolute(path)); Uri? get sdkDirectoryUri => _toUri(sdkDirectory); - Uri? get soundSdkSummaryUri => _toUri(soundSdkSummaryPath); - Uri? get weakSdkSummaryUri => _toUri(weakSdkSummaryPath); + Uri? get sdkSummaryUri => _toUri(sdkSummaryPath); /// Note: has to be ///file: Uri to run in an isolate. Uri? get compilerWorkerUri => _toAbsoluteUri(compilerWorkerPath); @@ -139,28 +127,10 @@ class SdkConfiguration { } void validateSummaries({FileSystem fileSystem = const LocalFileSystem()}) { - validateSoundSummaries(fileSystem: fileSystem); - validateWeakSummaries(fileSystem: fileSystem); - } - - void validateWeakSummaries({ - FileSystem fileSystem = const LocalFileSystem(), - }) { - if (weakSdkSummaryPath == null || - !fileSystem.file(weakSdkSummaryPath).existsSync()) { - throw InvalidSdkConfigurationException( - 'Sdk summary $weakSdkSummaryPath does not exist', - ); - } - } - - void validateSoundSummaries({ - FileSystem fileSystem = const LocalFileSystem(), - }) { - if (soundSdkSummaryPath == null || - !fileSystem.file(soundSdkSummaryPath).existsSync()) { + if (sdkSummaryPath == null || + !fileSystem.file(sdkSummaryPath).existsSync()) { throw InvalidSdkConfigurationException( - 'Sdk summary $soundSdkSummaryPath does not exist', + 'Sdk summary $sdkSummaryPath does not exist', ); } } diff --git a/dwds/test/sdk_configuration_test.dart b/dwds/test/sdk_configuration_test.dart index b772b58b8..5f11b7f52 100644 --- a/dwds/test/sdk_configuration_test.dart +++ b/dwds/test/sdk_configuration_test.dart @@ -25,7 +25,7 @@ void main() { final defaultConfiguration = await DefaultSdkConfigurationProvider().configuration; defaultConfiguration.validateSdkDir(); - defaultConfiguration.validateSoundSummaries(); + defaultConfiguration.validateSummaries(); }); test('Cannot validate an empty configuration layout', () async { @@ -55,12 +55,11 @@ void main() { final sdkLayout = FakeSdkLayout(sdkDirectory); final sdkConfiguration = FakeSdkLayout.createConfiguration(sdkLayout); - final soundSdkSummaryPath = sdkLayout.soundSummaryPath; - final summariesDir = p.dirname(soundSdkSummaryPath); + final sdkSummaryPath = sdkLayout.summaryPath; + final summariesDir = p.dirname(sdkSummaryPath); Directory(summariesDir).createSync(recursive: true); - File(defaultSdkConfiguration.soundSdkSummaryPath!) - .copySync(soundSdkSummaryPath); + File(defaultSdkConfiguration.sdkSummaryPath!).copySync(sdkSummaryPath); final compilerWorkerPath = sdkLayout.compilerWorkerPath; final workerDir = p.dirname(compilerWorkerPath); @@ -70,11 +69,11 @@ void main() { .copySync(compilerWorkerPath); expect(sdkConfiguration.sdkDirectory, equals(sdkDirectory)); - expect(sdkConfiguration.soundSdkSummaryPath, equals(soundSdkSummaryPath)); + expect(sdkConfiguration.sdkSummaryPath, equals(sdkSummaryPath)); expect(sdkConfiguration.compilerWorkerPath, equals(compilerWorkerPath)); sdkConfiguration.validateSdkDir(); - sdkConfiguration.validateSoundSummaries(); + sdkConfiguration.validateSummaries(); }); test('Cannot validate non-existing configuration layout', () async { @@ -96,22 +95,19 @@ void main() { final sdkLayout = SdkLayout.createDefault(sdkDirectory); final sdkConfiguration = SdkConfiguration.fromSdkLayout(sdkLayout); - final soundSdkSummaryPath = sdkLayout.soundSummaryPath; - final weakSdkSummaryPath = sdkLayout.weakSummaryPath; + final sdkSummaryPath = sdkLayout.summaryPath; final compilerWorkerPath = sdkLayout.dartdevcSnapshotPath; setUp(() async { fs = MemoryFileSystem(); await fs.directory(sdkDirectory).create(recursive: true); - await fs.file(soundSdkSummaryPath).create(recursive: true); - await fs.file(weakSdkSummaryPath).create(recursive: true); + await fs.file(sdkSummaryPath).create(recursive: true); await fs.file(compilerWorkerPath).create(recursive: true); }); test('Can create and validate default SDK configuration', () async { expect(sdkConfiguration.sdkDirectory, equals(sdkDirectory)); - expect(sdkConfiguration.soundSdkSummaryPath, equals(soundSdkSummaryPath)); - expect(sdkConfiguration.weakSdkSummaryPath, equals(weakSdkSummaryPath)); + expect(sdkConfiguration.sdkSummaryPath, equals(sdkSummaryPath)); expect(sdkConfiguration.compilerWorkerPath, equals(compilerWorkerPath)); sdkConfiguration.validateSdkDir(fileSystem: fs); @@ -137,17 +133,13 @@ class FakeSdkLayout { static SdkConfiguration createConfiguration(FakeSdkLayout sdkLayout) => SdkConfiguration( sdkDirectory: sdkLayout.sdkDirectory, - soundSdkSummaryPath: sdkLayout.soundSummaryPath, - weakSdkSummaryPath: sdkLayout.weakSummaryPath, + sdkSummaryPath: sdkLayout.summaryPath, compilerWorkerPath: sdkLayout.compilerWorkerPath, ); FakeSdkLayout(this.sdkDirectory); - String get weakSummaryPath => - p.join(sdkDirectory, 'summaries', 'unsound.dill'); - - String get soundSummaryPath => + String get summaryPath => p.join(sdkDirectory, 'summaries', 'sound.dill'); String get compilerWorkerPath => From f8b60d98eeaa2ff13f7036d4c1669ec67a23988c Mon Sep 17 00:00:00 2001 From: Jessy Yameogo Date: Thu, 10 Oct 2024 11:18:07 -0400 Subject: [PATCH 07/13] deprecated test_sdk_layout's soundNullSafety --- test_common/lib/test_sdk_layout.dart | 112 +++++++-------------------- 1 file changed, 26 insertions(+), 86 deletions(-) diff --git a/test_common/lib/test_sdk_layout.dart b/test_common/lib/test_sdk_layout.dart index 8d90c4894..dca372e80 100644 --- a/test_common/lib/test_sdk_layout.dart +++ b/test_common/lib/test_sdk_layout.dart @@ -27,14 +27,14 @@ class TestSdkLayout { factory TestSdkLayout.createDefaultFromSdkLayout(SdkLayout sdkLayout) => TestSdkLayout( sdkDirectory: sdkLayout.sdkDirectory, - soundSummaryPath: sdkLayout.soundSummaryPath, - soundFullDillPath: p.join( + summaryPath: sdkLayout.summaryPath, + fullDillPath: p.join( sdkLayout.sdkDirectory, 'lib', '_internal', 'ddc_platform.dill', ), - soundAmdJsPath: p.join( + amdJsPath: p.join( sdkLayout.sdkDirectory, 'lib', 'dev_compiler', @@ -42,7 +42,7 @@ class TestSdkLayout { 'amd', 'dart_sdk.js', ), - soundAmdJsMapPath: p.join( + amdJsMapPath: p.join( sdkLayout.sdkDirectory, 'lib', 'dev_compiler', @@ -50,7 +50,7 @@ class TestSdkLayout { 'amd', 'dart_sdk.js.map', ), - soundDdcJsPath: p.join( + ddcJsPath: p.join( sdkLayout.sdkDirectory, 'lib', 'dev_compiler', @@ -58,7 +58,7 @@ class TestSdkLayout { 'ddc', 'dart_sdk.js', ), - soundDdcJsMapPath: p.join( + ddcJsMapPath: p.join( sdkLayout.sdkDirectory, 'lib', 'dev_compiler', @@ -66,45 +66,6 @@ class TestSdkLayout { 'ddc', 'dart_sdk.js.map', ), - weakSummaryPath: sdkLayout.weakSummaryPath, - weakFullDillPath: p.join( - sdkLayout.sdkDirectory, - 'lib', - '_internal', - 'ddc_platform_unsound.dill', - ), - weakAmdJsPath: p.join( - sdkLayout.sdkDirectory, - 'lib', - 'dev_compiler', - 'kernel', - 'amd', - 'dart_sdk_unsound.js', - ), - weakAmdJsMapPath: p.join( - sdkLayout.sdkDirectory, - 'lib', - 'dev_compiler', - 'kernel', - 'amd', - 'dart_sdk_unsound.js.map', - ), - weakDdcJsPath: p.join( - sdkLayout.sdkDirectory, - 'lib', - 'dev_compiler', - 'kernel', - 'ddc', - 'dart_sdk_unsound.js', - ), - weakDdcJsMapPath: p.join( - sdkLayout.sdkDirectory, - 'lib', - 'dev_compiler', - 'kernel', - 'ddc', - 'dart_sdk_unsound.js.map', - ), ddcModuleLoaderJsPath: p.join( sdkLayout.sdkDirectory, 'lib', @@ -159,33 +120,19 @@ class TestSdkLayout { final String sdkDirectory; - String get soundAmdJsFileName => p.basename(soundAmdJsPath); - String get soundAmdJsMapFileName => p.basename(soundAmdJsMapPath); - String get soundDdcJsFileName => p.basename(soundDdcJsPath); - String get soundDdcJsMapFileName => p.basename(soundDdcJsMapPath); - String get soundSummaryFileName => p.basename(soundSummaryPath); - String get soundFullDillFileName => p.basename(soundFullDillPath); - - final String soundAmdJsPath; - final String soundAmdJsMapPath; - final String soundDdcJsPath; - final String soundDdcJsMapPath; - final String soundSummaryPath; - final String soundFullDillPath; - - String get weakAmdJsFileName => p.basename(weakAmdJsPath); - String get weakAmdJsMapFileName => p.basename(weakAmdJsMapPath); - String get weakDdcJsFileName => p.basename(weakDdcJsPath); - String get weakDdcJsMapFileName => p.basename(weakDdcJsMapPath); - String get weakSummaryFileName => p.basename(weakSummaryPath); - String get weakFullDillFileName => p.basename(weakFullDillPath); - - final String weakAmdJsPath; - final String weakAmdJsMapPath; - final String weakDdcJsPath; - final String weakDdcJsMapPath; - final String weakSummaryPath; - final String weakFullDillPath; + String get amdJsFileName => p.basename(amdJsPath); + String get amdJsMapFileName => p.basename(amdJsMapPath); + String get ddcJsFileName => p.basename(ddcJsPath); + String get ddcJsMapFileName => p.basename(ddcJsMapPath); + String get summaryFileName => p.basename(summaryPath); + String get fullDillFileName => p.basename(fullDillPath); + + final String amdJsPath; + final String amdJsMapPath; + final String ddcJsPath; + final String ddcJsMapPath; + final String summaryPath; + final String fullDillPath; final String ddcModuleLoaderJsPath; final String requireJsPath; @@ -200,18 +147,12 @@ class TestSdkLayout { const TestSdkLayout({ required this.sdkDirectory, - required this.soundAmdJsPath, - required this.soundAmdJsMapPath, - required this.soundDdcJsPath, - required this.soundDdcJsMapPath, - required this.soundSummaryPath, - required this.soundFullDillPath, - required this.weakAmdJsPath, - required this.weakAmdJsMapPath, - required this.weakDdcJsPath, - required this.weakDdcJsMapPath, - required this.weakSummaryPath, - required this.weakFullDillPath, + required this.amdJsPath, + required this.amdJsMapPath, + required this.ddcJsPath, + required this.ddcJsMapPath, + required this.summaryPath, + required this.fullDillPath, required this.ddcModuleLoaderJsPath, required this.requireJsPath, required this.stackTraceMapperPath, @@ -227,8 +168,7 @@ class TestSdkLayout { static SdkConfiguration createConfiguration(TestSdkLayout sdkLayout) => SdkConfiguration( sdkDirectory: sdkLayout.sdkDirectory, - weakSdkSummaryPath: sdkLayout.weakSummaryPath, - soundSdkSummaryPath: sdkLayout.soundSummaryPath, + sdkSummaryPath: sdkLayout.summaryPath, compilerWorkerPath: sdkLayout.dartdevcSnapshotPath, ); } From 9bb544de68ce33260380d8beafc65a8fb669a832 Mon Sep 17 00:00:00 2001 From: Jessy Yameogo Date: Thu, 10 Oct 2024 11:44:05 -0400 Subject: [PATCH 08/13] removed remaining use of sound/weak null safety --- dwds/CHANGELOG.md | 2 +- frontend_server_common/lib/src/devfs.dart | 8 +- .../lib/src/resident_runner.dart | 2 +- test_common/lib/sdk_asset_generator.dart | 22 +-- test_common/lib/test_sdk_configuration.dart | 6 +- .../test/sdk_asset_generator_test.dart | 130 ++++++------------ .../test/test_sdk_configuration_test.dart | 36 ++--- 7 files changed, 73 insertions(+), 133 deletions(-) diff --git a/dwds/CHANGELOG.md b/dwds/CHANGELOG.md index 8d6a08bb6..40fad610e 100644 --- a/dwds/CHANGELOG.md +++ b/dwds/CHANGELOG.md @@ -2,7 +2,7 @@ - Replace deprecated JS code `this.__proto__` with `Object.getPrototypeOf(this)`. - [#2500](https://github.com/dart-lang/webdev/pull/2500) - Migrate injected client code to `package:web`. - [#2491](https://github.com/dart-lang/webdev/pull/2491) -- Deprecated MetadataProvider's & CompilerOptions' soundNullSafety. - [#2427](https://github.com/dart-lang/webdev/issues/2427) +- Deprecated MetadataProvider's, CompilerOptions' & SdkConfiguration's soundNullSafety. - [#2427](https://github.com/dart-lang/webdev/issues/2427) ## 24.1.0 diff --git a/frontend_server_common/lib/src/devfs.dart b/frontend_server_common/lib/src/devfs.dart index cfb940ebd..47607a742 100644 --- a/frontend_server_common/lib/src/devfs.dart +++ b/frontend_server_common/lib/src/devfs.dart @@ -192,13 +192,13 @@ class WebDevFS { fileSystem.file(sdkLayout.ddcModuleLoaderJsPath); File get requireJS => fileSystem.file(sdkLayout.requireJsPath); File get dartSdk => fileSystem.file(switch (ddcModuleFormat) { - ModuleFormat.amd => sdkLayout.soundAmdJsPath, - ModuleFormat.ddc => sdkLayout.soundDdcJsPath, + ModuleFormat.amd => sdkLayout.amdJsPath, + ModuleFormat.ddc => sdkLayout.ddcJsPath, _ => throw Exception('Unsupported DDC module format $ddcModuleFormat.') }); File get dartSdkSourcemap => fileSystem.file(switch (ddcModuleFormat) { - ModuleFormat.amd => sdkLayout.soundAmdJsMapPath, - ModuleFormat.ddc => sdkLayout.soundDdcJsMapPath, + ModuleFormat.amd => sdkLayout.amdJsMapPath, + ModuleFormat.ddc => sdkLayout.ddcJsMapPath, _ => throw Exception('Unsupported DDC module format $ddcModuleFormat.') }); File get stackTraceMapper => fileSystem.file(sdkLayout.stackTraceMapperPath); diff --git a/frontend_server_common/lib/src/resident_runner.dart b/frontend_server_common/lib/src/resident_runner.dart index 9d4d5c9a2..b0d8b3a73 100644 --- a/frontend_server_common/lib/src/resident_runner.dart +++ b/frontend_server_common/lib/src/resident_runner.dart @@ -33,7 +33,7 @@ class ResidentWebRunner { required this.sdkLayout, bool verbose = false, }) { - final platformDillUri = Uri.file(sdkLayout.soundSummaryPath); + final platformDillUri = Uri.file(sdkLayout.summaryPath); generator = ResidentCompiler( sdkLayout.sdkDirectory, diff --git a/test_common/lib/sdk_asset_generator.dart b/test_common/lib/sdk_asset_generator.dart index f865a3f85..f2e8bcfd7 100644 --- a/test_common/lib/sdk_asset_generator.dart +++ b/test_common/lib/sdk_asset_generator.dart @@ -11,8 +11,8 @@ import 'package:test_common/test_sdk_layout.dart'; /// Generates sdk.js, sdk.map, sdk full dill, and sdk summary files. /// /// Generates following missing assets if needed: -/// - sound null safety: js, source map, full dill. -/// - weak null safety: js, source map, full dill, summary. +/// - js, source map, full dill. + class SdkAssetGenerator { bool _sdkAssetsGenerated = false; final _logger = Logger('SdkAssetGenerator'); @@ -57,8 +57,8 @@ class SdkAssetGenerator { required bool canaryFeatures, }) => switch (ddcModuleFormat) { - ModuleFormat.amd => sdkLayout.soundAmdJsPath, - ModuleFormat.ddc => sdkLayout.soundDdcJsPath, + ModuleFormat.amd => sdkLayout.amdJsPath, + ModuleFormat.ddc => sdkLayout.ddcJsPath, _ => throw Exception('Unsupported DDC module format $ddcModuleFormat.') }; @@ -66,8 +66,8 @@ class SdkAssetGenerator { required bool canaryFeatures, }) => switch (ddcModuleFormat) { - ModuleFormat.amd => sdkLayout.soundAmdJsMapPath, - ModuleFormat.ddc => sdkLayout.soundDdcJsMapPath, + ModuleFormat.amd => sdkLayout.amdJsMapPath, + ModuleFormat.ddc => sdkLayout.ddcJsMapPath, _ => throw Exception('Unsupported DDC module format $ddcModuleFormat.') }; @@ -75,8 +75,8 @@ class SdkAssetGenerator { required bool canaryFeatures, }) => switch (ddcModuleFormat) { - ModuleFormat.amd => sdkLayout.soundAmdJsFileName, - ModuleFormat.ddc => sdkLayout.soundDdcJsFileName, + ModuleFormat.amd => sdkLayout.amdJsFileName, + ModuleFormat.ddc => sdkLayout.ddcJsFileName, _ => throw Exception('Unsupported DDC module format $ddcModuleFormat.') }; @@ -89,7 +89,7 @@ class SdkAssetGenerator { final outputJsPath = resolveSdkJsPath(canaryFeatures: canaryFeatures); final outputJsMapPath = resolveSdkSourcemapPath(canaryFeatures: canaryFeatures); - final outputFullDillPath = sdkLayout.soundFullDillPath; + final outputFullDillPath = sdkLayout.fullDillPath; final hasJsAsset = _exists(outputJsPath); final hasJsMapAsset = _exists(outputJsMapPath); @@ -180,7 +180,7 @@ class SdkAssetGenerator { Directory? outputDir; try { // Files to copy generated files to. - final outputSummaryPath = sdkLayout.soundSummaryPath; + final outputSummaryPath = sdkLayout.summaryPath; final hasAssets = _exists(outputSummaryPath); // Files already exist. @@ -189,7 +189,7 @@ class SdkAssetGenerator { // Generate missing files. outputDir = fileSystem.systemTempDirectory.createTempSync(); final summaryPath = - p.join(outputDir.path, sdkLayout.soundSummaryFileName); + p.join(outputDir.path, sdkLayout.summaryFileName); _logger.info('Generating SDK summary files...'); diff --git a/test_common/lib/test_sdk_configuration.dart b/test_common/lib/test_sdk_configuration.dart index 1fb9ec0b7..864469f23 100644 --- a/test_common/lib/test_sdk_configuration.dart +++ b/test_common/lib/test_sdk_configuration.dart @@ -14,10 +14,8 @@ import 'package:test_common/test_sdk_layout.dart'; /// Implementation for SDK configuration for tests that can generate /// missing assets. /// -/// - Generate SDK js, source map, and full dill for weak and sound -/// modes (normally included in flutter SDK or produced by build). -/// - Need to generate SDK summary for weak null safety mode as it -/// is not provided by the SDK installation. +/// - Generate SDK js, source map, and full dill (normally included in flutter +/// SDK or produced by build). /// /// TODO(annagrin): update to only generating missing sound artifacts /// for frontend server after we have no uses of weak null safety. diff --git a/test_common/test/sdk_asset_generator_test.dart b/test_common/test/sdk_asset_generator_test.dart index 7f02ec6d0..fabf8d488 100644 --- a/test_common/test/sdk_asset_generator_test.dart +++ b/test_common/test/sdk_asset_generator_test.dart @@ -20,23 +20,16 @@ void main() { late Directory tempDir; late String sdkDirectory; - late String soundSdkSummaryPath; + late String sdkSummaryPath; late String compilerWorkerPath; - // Missing sound assets - late String soundSdkFullDillPath; - late String soundAmdSdkJsPath; - late String soundAmdSdkJsMapPath; - late String soundDdcSdkJsPath; - late String soundDdcSdkJsMapPath; - - // Missing weak assets - late String weakSdkSummaryPath; - late String weakSdkFullDillPath; - late String weakAmdSdkJsPath; - late String weakAmdSdkJsMapPath; - late String weakDdcSdkJsPath; - late String weakDdcSdkJsMapPath; + // Missing assets + late String sdkFullDillPath; + late String amdSdkJsPath; + late String amdSdkJsMapPath; + late String ddcSdkJsPath; + late String ddcSdkJsMapPath; + setUp(() async { setCurrentLogWriter(debug: debug); @@ -45,39 +38,24 @@ void main() { sdkDirectory = tempDir.path; final copySdkLayout = TestSdkLayout.createDefault(sdkDirectory); - soundSdkSummaryPath = copySdkLayout.soundSummaryPath; + sdkSummaryPath = copySdkLayout.summaryPath; compilerWorkerPath = copySdkLayout.dartdevcSnapshotPath; // Copy the SDK directory into a temp directory. await copyDirectory(TestSdkLayout.defaultSdkDirectory, sdkDirectory); - // Simulate missing sound assets. - soundSdkFullDillPath = copySdkLayout.soundFullDillPath; - soundAmdSdkJsPath = copySdkLayout.soundAmdJsPath; - soundAmdSdkJsMapPath = copySdkLayout.soundAmdJsMapPath; - soundDdcSdkJsPath = copySdkLayout.soundDdcJsPath; - soundDdcSdkJsMapPath = copySdkLayout.soundDdcJsMapPath; - - _deleteIfExists(soundSdkFullDillPath); - _deleteIfExists(soundAmdSdkJsPath); - _deleteIfExists(soundAmdSdkJsMapPath); - _deleteIfExists(soundDdcSdkJsPath); - _deleteIfExists(soundDdcSdkJsMapPath); - - // Simulate missing weak assets. - weakSdkSummaryPath = copySdkLayout.weakSummaryPath; - weakSdkFullDillPath = copySdkLayout.weakFullDillPath; - weakAmdSdkJsPath = copySdkLayout.weakAmdJsPath; - weakAmdSdkJsMapPath = copySdkLayout.weakAmdJsMapPath; - weakDdcSdkJsPath = copySdkLayout.weakDdcJsPath; - weakDdcSdkJsMapPath = copySdkLayout.weakDdcJsMapPath; - - _deleteIfExists(weakSdkSummaryPath); - _deleteIfExists(weakSdkFullDillPath); - _deleteIfExists(weakAmdSdkJsPath); - _deleteIfExists(weakAmdSdkJsMapPath); - _deleteIfExists(weakDdcSdkJsPath); - _deleteIfExists(weakDdcSdkJsMapPath); + // Simulate missing assets. + sdkFullDillPath = copySdkLayout.fullDillPath; + amdSdkJsPath = copySdkLayout.amdJsPath; + amdSdkJsMapPath = copySdkLayout.amdJsMapPath; + ddcSdkJsPath = copySdkLayout.ddcJsPath; + ddcSdkJsMapPath = copySdkLayout.ddcJsMapPath; + + _deleteIfExists(sdkFullDillPath); + _deleteIfExists(amdSdkJsPath); + _deleteIfExists(amdSdkJsMapPath); + _deleteIfExists(ddcSdkJsPath); + _deleteIfExists(ddcSdkJsMapPath); }); tearDown(() { @@ -102,30 +80,20 @@ void main() { expect(configuration.sdkDirectory, equals(sdkDirectory)); expect(configuration.compilerWorkerPath, equals(compilerWorkerPath)); - expect(sdkLayout.soundSummaryPath, equals(soundSdkSummaryPath)); - expect(sdkLayout.soundFullDillPath, equals(soundSdkFullDillPath)); - expect(sdkLayout.soundAmdJsPath, equals(soundAmdSdkJsPath)); - expect(sdkLayout.soundAmdJsMapPath, equals(soundAmdSdkJsMapPath)); - - expect(sdkLayout.weakSummaryPath, equals(weakSdkSummaryPath)); - expect(sdkLayout.weakFullDillPath, equals(weakSdkFullDillPath)); - expect(sdkLayout.weakAmdJsPath, equals(weakAmdSdkJsPath)); - expect(sdkLayout.weakAmdJsMapPath, equals(weakAmdSdkJsMapPath)); + expect(sdkLayout.summaryPath, equals(sdkSummaryPath)); + expect(sdkLayout.fullDillPath, equals(sdkFullDillPath)); + expect(sdkLayout.amdJsPath, equals(amdSdkJsPath)); + expect(sdkLayout.amdJsMapPath, equals(amdSdkJsMapPath)); // Validate that configuration files exist. configuration.validateSdkDir(); configuration.validate(); // Validate all assets exist. - expect(sdkLayout.soundSummaryPath, _exists); - expect(sdkLayout.soundFullDillPath, _exists); - expect(sdkLayout.soundAmdJsPath, _exists); - expect(sdkLayout.soundAmdJsMapPath, _exists); - - expect(sdkLayout.weakSummaryPath, _exists); - expect(sdkLayout.weakFullDillPath, _exists); - expect(sdkLayout.weakAmdJsPath, _exists); - expect(sdkLayout.weakAmdJsMapPath, _exists); + expect(sdkLayout.summaryPath, _exists); + expect(sdkLayout.fullDillPath, _exists); + expect(sdkLayout.amdJsPath, _exists); + expect(sdkLayout.amdJsMapPath, _exists); }); test( @@ -146,30 +114,20 @@ void main() { expect(configuration.sdkDirectory, equals(sdkDirectory)); expect(configuration.compilerWorkerPath, equals(compilerWorkerPath)); - expect(sdkLayout.soundSummaryPath, equals(soundSdkSummaryPath)); - expect(sdkLayout.soundFullDillPath, equals(soundSdkFullDillPath)); - expect(sdkLayout.soundDdcJsPath, equals(soundDdcSdkJsPath)); - expect(sdkLayout.soundDdcJsMapPath, equals(soundDdcSdkJsMapPath)); - - expect(sdkLayout.weakSummaryPath, equals(weakSdkSummaryPath)); - expect(sdkLayout.weakFullDillPath, equals(weakSdkFullDillPath)); - expect(sdkLayout.weakDdcJsPath, equals(weakDdcSdkJsPath)); - expect(sdkLayout.weakDdcJsMapPath, equals(weakDdcSdkJsMapPath)); + expect(sdkLayout.summaryPath, equals(sdkSummaryPath)); + expect(sdkLayout.fullDillPath, equals(sdkFullDillPath)); + expect(sdkLayout.ddcJsPath, equals(ddcSdkJsPath)); + expect(sdkLayout.ddcJsMapPath, equals(ddcSdkJsMapPath)); // Validate that configuration files exist. configuration.validateSdkDir(); configuration.validate(); // Validate all assets exist. - expect(sdkLayout.soundSummaryPath, _exists); - expect(sdkLayout.soundFullDillPath, _exists); - expect(sdkLayout.soundDdcJsPath, _exists); - expect(sdkLayout.soundDdcJsMapPath, _exists); - - expect(sdkLayout.weakSummaryPath, _exists); - expect(sdkLayout.weakFullDillPath, _exists); - expect(sdkLayout.weakDdcJsPath, _exists); - expect(sdkLayout.weakDdcJsMapPath, _exists); + expect(sdkLayout.summaryPath, _exists); + expect(sdkLayout.fullDillPath, _exists); + expect(sdkLayout.ddcJsPath, _exists); + expect(sdkLayout.ddcJsMapPath, _exists); }); test('Can generate missing SDK assets with canary features enabled', @@ -184,11 +142,8 @@ void main() { ); await assetGenerator.generateSdkAssets(); - final soundSdk = File(soundAmdSdkJsPath).readAsStringSync(); - expect(soundSdk, contains('canary')); - - final weakSdk = File(weakAmdSdkJsPath).readAsStringSync(); - expect(weakSdk, contains('canary')); + final sdk = File(amdSdkJsPath).readAsStringSync(); + expect(sdk, contains('canary')); }); test( @@ -204,11 +159,8 @@ void main() { ); await assetGenerator.generateSdkAssets(); - final soundSdk = File(soundDdcSdkJsPath).readAsStringSync(); - expect(soundSdk, contains('canary')); - - final weakSdk = File(weakDdcSdkJsPath).readAsStringSync(); - expect(weakSdk, contains('canary')); + final sdk = File(ddcSdkJsPath).readAsStringSync(); + expect(sdk, contains('canary')); }); }); } diff --git a/test_common/test/test_sdk_configuration_test.dart b/test_common/test/test_sdk_configuration_test.dart index 96b9ae54c..ada3712cc 100644 --- a/test_common/test/test_sdk_configuration_test.dart +++ b/test_common/test/test_sdk_configuration_test.dart @@ -24,16 +24,16 @@ void main() { test('Creates and deletes SDK directory copy', () async { final provider = TestSdkConfigurationProvider(verbose: debug); final sdkDirectory = provider.sdkLayout.sdkDirectory; - final weakSdkSummary = provider.sdkLayout.weakSummaryPath; + final sdkSummary = provider.sdkLayout.summaryPath; try { expect(sdkDirectory, _directoryExists, reason: 'SDK directory should be created'); - expect(weakSdkSummary, isNot(_fileExists), - reason: 'Weak SDK summary should not be generated yet.'); + expect(sdkSummary, isNot(_fileExists), + reason: 'SDK summary should not be generated yet.'); await provider.configuration; - expect(weakSdkSummary, _fileExists, - reason: 'Weak SDK summary should be generated'); + expect(sdkSummary, _fileExists, + reason: 'SDK summary should be generated'); } finally { provider.dispose(); expect(sdkDirectory, isNot(_directoryExists), @@ -59,15 +59,10 @@ void main() { final sdkLayout = provider.sdkLayout; expect(sdkLayout.sdkDirectory, _directoryExists); - expect(sdkLayout.soundDdcJsPath, _fileExists); - expect(sdkLayout.soundDdcJsMapPath, _fileExists); - expect(sdkLayout.soundSummaryPath, _fileExists); - expect(sdkLayout.soundFullDillPath, _fileExists); - - expect(sdkLayout.weakDdcJsPath, _fileExists); - expect(sdkLayout.weakDdcJsMapPath, _fileExists); - expect(sdkLayout.weakSummaryPath, _fileExists); - expect(sdkLayout.weakFullDillPath, _fileExists); + expect(sdkLayout.ddcJsPath, _fileExists); + expect(sdkLayout.ddcJsMapPath, _fileExists); + expect(sdkLayout.summaryPath, _fileExists); + expect(sdkLayout.fullDillPath, _fileExists); expect(sdkLayout.ddcModuleLoaderJsPath, _fileExists); expect(sdkLayout.stackTraceMapperPath, _fileExists); @@ -96,15 +91,10 @@ void main() { final sdkLayout = provider.sdkLayout; expect(sdkLayout.sdkDirectory, _directoryExists); - expect(sdkLayout.soundAmdJsPath, _fileExists); - expect(sdkLayout.soundAmdJsMapPath, _fileExists); - expect(sdkLayout.soundSummaryPath, _fileExists); - expect(sdkLayout.soundFullDillPath, _fileExists); - - expect(sdkLayout.weakAmdJsPath, _fileExists); - expect(sdkLayout.weakAmdJsMapPath, _fileExists); - expect(sdkLayout.weakSummaryPath, _fileExists); - expect(sdkLayout.weakFullDillPath, _fileExists); + expect(sdkLayout.amdJsPath, _fileExists); + expect(sdkLayout.amdJsMapPath, _fileExists); + expect(sdkLayout.summaryPath, _fileExists); + expect(sdkLayout.fullDillPath, _fileExists); expect(sdkLayout.requireJsPath, _fileExists); expect(sdkLayout.stackTraceMapperPath, _fileExists); From 571843832a040276512503a1cb73c2287a4f9cc7 Mon Sep 17 00:00:00 2001 From: Jessy Yameogo Date: Thu, 10 Oct 2024 11:51:35 -0400 Subject: [PATCH 09/13] deprecated sound/weak sdkSummaryPath but kept variables in constructor to avoid breaking changes --- dwds/lib/src/utilities/sdk_configuration.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dwds/lib/src/utilities/sdk_configuration.dart b/dwds/lib/src/utilities/sdk_configuration.dart index 1f2b49735..eb468da0a 100644 --- a/dwds/lib/src/utilities/sdk_configuration.dart +++ b/dwds/lib/src/utilities/sdk_configuration.dart @@ -82,9 +82,17 @@ class SdkConfiguration { final String? sdkSummaryPath; final String? compilerWorkerPath; + @Deprecated('Only sound null safety is supported as of Dart 3.0') + final String? weakSdkSummaryPath; + + @Deprecated('Only sound null safety is supported as of Dart 3.0') + final String? soundSdkSummaryPath; + const SdkConfiguration({ this.sdkDirectory, this.sdkSummaryPath, + this.weakSdkSummaryPath, + this.soundSdkSummaryPath, this.compilerWorkerPath, }); From 64ba845ea537d8b38ec14ac6c003f338033337cd Mon Sep 17 00:00:00 2001 From: Jessy Yameogo Date: Thu, 10 Oct 2024 12:00:28 -0400 Subject: [PATCH 10/13] deprecated sound/weak sdkSummaryPath for SdkLayout class but kept variables in constructor to avoid breaking changes --- dwds/CHANGELOG.md | 2 +- dwds/lib/src/utilities/sdk_configuration.dart | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dwds/CHANGELOG.md b/dwds/CHANGELOG.md index 40fad610e..3c3204f81 100644 --- a/dwds/CHANGELOG.md +++ b/dwds/CHANGELOG.md @@ -2,7 +2,7 @@ - Replace deprecated JS code `this.__proto__` with `Object.getPrototypeOf(this)`. - [#2500](https://github.com/dart-lang/webdev/pull/2500) - Migrate injected client code to `package:web`. - [#2491](https://github.com/dart-lang/webdev/pull/2491) -- Deprecated MetadataProvider's, CompilerOptions' & SdkConfiguration's soundNullSafety. - [#2427](https://github.com/dart-lang/webdev/issues/2427) +- Deprecated MetadataProvider's, CompilerOptions', SdkConfiguration's & SdkLayout's soundNullSafety. - [#2427](https://github.com/dart-lang/webdev/issues/2427) ## 24.1.0 diff --git a/dwds/lib/src/utilities/sdk_configuration.dart b/dwds/lib/src/utilities/sdk_configuration.dart index eb468da0a..7f52ae453 100644 --- a/dwds/lib/src/utilities/sdk_configuration.dart +++ b/dwds/lib/src/utilities/sdk_configuration.dart @@ -45,6 +45,12 @@ class SdkLayout { final String summaryPath; final String dartdevcSnapshotPath; + @Deprecated('Only sound null safety is supported as of Dart 3.0') + final String soundSummaryPath; + + @Deprecated('Only sound null safety is supported as of Dart 3.0') + final String weakSummaryPath; + SdkLayout.createDefault(String sdkDirectory) : this( sdkDirectory: sdkDirectory, @@ -65,6 +71,8 @@ class SdkLayout { const SdkLayout({ required this.sdkDirectory, required this.summaryPath, + this.soundSummaryPath = '', + this.weakSummaryPath = '', required this.dartdevcSnapshotPath, }); } From db778822694a7655795afc060691b5095a85116b Mon Sep 17 00:00:00 2001 From: Jessy Yameogo Date: Thu, 10 Oct 2024 12:07:33 -0400 Subject: [PATCH 11/13] formatted code --- test_common/lib/sdk_asset_generator.dart | 6 ++---- test_common/test/sdk_asset_generator_test.dart | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/test_common/lib/sdk_asset_generator.dart b/test_common/lib/sdk_asset_generator.dart index f2e8bcfd7..e86f0317e 100644 --- a/test_common/lib/sdk_asset_generator.dart +++ b/test_common/lib/sdk_asset_generator.dart @@ -104,8 +104,7 @@ class SdkAssetGenerator { // Files to generate final jsPath = p.join( - outputDir.path, - resolveSdkJsFilename(canaryFeatures: canaryFeatures)); + outputDir.path, resolveSdkJsFilename(canaryFeatures: canaryFeatures)); final jsMapPath = p.setExtension(jsPath, '.js.map'); final fullDillPath = p.setExtension(jsPath, '.dill'); @@ -188,8 +187,7 @@ class SdkAssetGenerator { // Generate missing files. outputDir = fileSystem.systemTempDirectory.createTempSync(); - final summaryPath = - p.join(outputDir.path, sdkLayout.summaryFileName); + final summaryPath = p.join(outputDir.path, sdkLayout.summaryFileName); _logger.info('Generating SDK summary files...'); diff --git a/test_common/test/sdk_asset_generator_test.dart b/test_common/test/sdk_asset_generator_test.dart index fabf8d488..da109dd29 100644 --- a/test_common/test/sdk_asset_generator_test.dart +++ b/test_common/test/sdk_asset_generator_test.dart @@ -30,7 +30,6 @@ void main() { late String ddcSdkJsPath; late String ddcSdkJsMapPath; - setUp(() async { setCurrentLogWriter(debug: debug); tempDir = Directory.systemTemp.createTempSync(); From f47d3b4cbde730a4eddf978b10262ddd51d0b3f4 Mon Sep 17 00:00:00 2001 From: Jessy Yameogo Date: Thu, 10 Oct 2024 12:09:26 -0400 Subject: [PATCH 12/13] formatted code --- dwds/test/sdk_configuration_test.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dwds/test/sdk_configuration_test.dart b/dwds/test/sdk_configuration_test.dart index 5f11b7f52..ec41bd4b7 100644 --- a/dwds/test/sdk_configuration_test.dart +++ b/dwds/test/sdk_configuration_test.dart @@ -139,8 +139,7 @@ class FakeSdkLayout { FakeSdkLayout(this.sdkDirectory); - String get summaryPath => - p.join(sdkDirectory, 'summaries', 'sound.dill'); + String get summaryPath => p.join(sdkDirectory, 'summaries', 'sound.dill'); String get compilerWorkerPath => p.join(sdkDirectory, 'snapshots', 'test.snapshot'); From ff4517c45886468df77e7be5ef9865cc362d3a08 Mon Sep 17 00:00:00 2001 From: Jessy Yameogo Date: Wed, 16 Oct 2024 15:57:49 -0400 Subject: [PATCH 13/13] Deprecated public getters soundSdkSummaryUri & weakSdkSummaryUri --- dwds/lib/src/utilities/sdk_configuration.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dwds/lib/src/utilities/sdk_configuration.dart b/dwds/lib/src/utilities/sdk_configuration.dart index 7f52ae453..507aaae56 100644 --- a/dwds/lib/src/utilities/sdk_configuration.dart +++ b/dwds/lib/src/utilities/sdk_configuration.dart @@ -120,6 +120,12 @@ class SdkConfiguration { Uri? get sdkDirectoryUri => _toUri(sdkDirectory); Uri? get sdkSummaryUri => _toUri(sdkSummaryPath); + @Deprecated('Only sound null safety is supported as of Dart 3.0') + Uri? get soundSdkSummaryUri => _toUri(soundSdkSummaryPath); + + @Deprecated('Only sound null safety is supported as of Dart 3.0') + Uri? get weakSdkSummaryUri => _toUri(weakSdkSummaryPath); + /// Note: has to be ///file: Uri to run in an isolate. Uri? get compilerWorkerUri => _toAbsoluteUri(compilerWorkerPath);