[M] Change in dart/sdk[main]: [ DDC / CFE ] Add support for allowing imports of unsupported libraries

0 views
Skip to first unread message

Sigmund Cherem (Gerrit)

unread,
Dec 3, 2025, 4:05:17 PMDec 3
to Ben Konyi, Sigmund Cherem, Commit Queue, Alexander Markov, Jens Johansen, dart-dc-te...@google.com, dart-fe-te...@google.com, dart2js-te...@google.com, rev...@dartlang.org

Sigmund Cherem added 4 comments

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Sigmund Cherem . resolved

Just some drive-by comments to share.

File pkg/compiler/lib/src/kernel/dart2js_target.dart
Line 383, Patchset 5 (Latest): : super(supported: const {'_dart2js_only', '_js_annotations'});
Sigmund Cherem . unresolved

is this change needed?

This only changes whether you can use `_js_annotations` in a conditional import, but our preference is generally not to allow using internal libraries in that context ([ref][1])

[1]: https://github.com/dart-lang/sdk/blob/f19440c37b1433921c4bdf55cee11f9710dc816c/pkg/_fe_analyzer_shared/lib/src/util/libraries_specification.dart#L64

File pkg/dev_compiler/lib/src/kernel/target.dart
Line 333, Patchset 5 (Latest): // These two native libraries have always been "supported" for DDC and
Sigmund Cherem . unresolved

I believe we don't need to add them here, as these are derived automatically from the library specification.

Suggestion: could we also lean into the library specification to declare libraries that can be imported when the flag is enabled?

The motivation is a bit nuanced. The original goal with that specification was to centralize knowledge and try to use a declarative syntax for how our targets are configured. I still imagine however that the effective result is equivalent to your current implementation, though.

The full specification is described in the specification parser here: https://github.com/dart-lang/sdk/blob/f19440c37b1433921c4bdf55cee11f9710dc816c/pkg/_fe_analyzer_shared/lib/src/util/libraries_specification.dart, and I imagine we can extend it to add a new parameter to encode the new logic without having to replicate the information in the Target implementation class.

For example, if instead of `supported: false`, we change it to:
```
io:
url: ...
support_direct_import: true
support_conditional_import: false # << equivalent to supported: false
ffi:
url: ...
support_direct_import: with_flag # << the new semantics
support_conditional_import: false # << still says false in conditional imports
```

Thoughts?

Line 342, Patchset 5 (Latest): '_js_annotations',
Sigmund Cherem . unresolved

same as in the dart2js target, I don't think we should add this one. (side comment, I wish the way we did _ddc_only/_dart2js_only was to add `supported: true` to the specification to override the default, but those libraries are already a workaround because we wanted a way to distinguish tools rather than libraries in conditional imports).

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedCommit-Message-Has-TEST
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Ife819b2e1a6d28f67d80aab6701cd23a1724aa4d
Gerrit-Change-Number: 465760
Gerrit-PatchSet: 5
Gerrit-Owner: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-CC: Alexander Markov <alexm...@google.com>
Gerrit-CC: Jens Johansen <je...@google.com>
Gerrit-CC: Sigmund Cherem <sig...@google.com>
Gerrit-Comment-Date: Wed, 03 Dec 2025 21:05:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Sigmund Cherem (Gerrit)

unread,
Dec 8, 2025, 3:55:58 PM (13 days ago) Dec 8
to Ben Konyi, Sigmund Cherem, Commit Queue, Alexander Markov, Jens Johansen, dart-dc-te...@google.com, dart-fe-te...@google.com, dart2js-te...@google.com, rev...@dartlang.org
Attention needed from Ben Konyi

Sigmund Cherem added 8 comments

Patchset-level comments
File-level comment, Patchset 7:
Sigmund Cherem . resolved

Thanks so much for making the changes Ben, this looks great! I only have minor comments and suggestions below.

File pkg/_fe_analyzer_shared/lib/src/util/libraries_specification.dart
Line 365, Patchset 7: importability: importability,
Sigmund Cherem . resolved

Just a comment to share with you and the CFE team (nothing to change for this CL): I believe the CFE separately has other logic to allow/disallow imports to `dart:_` libraries. Those rules include asking the target class (e.g. we allow them from tests, but not from user's code). I wonder if this new concept of importability can be generalized for that too.

File pkg/dev_compiler/lib/src/kernel/target.dart
Line 99, Patchset 7: List<String> get extraRequiredLibrariesPlatform => const ['dart:ffi'];
Sigmund Cherem . unresolved

I wonder if we need both this and the change above, or only one of them?

File pkg/front_end/lib/src/base/uri_translator.dart
Line 59, Patchset 7: Importability.always;
Sigmund Cherem . unresolved

I wonder if the default here should be `never`. That is, the reason the first expression would be null is if we are missing an entry in the .yaml file for a specific library.

It's possible we have test coverage for it elsewhere, but if not, it may help to also add a test for trying to import a library that doesn't exist in the specification and making sure we provide the right diagnostic in that case too.

File pkg/front_end/test/unsupported_platform_dart_library_import_test.dart
Line 29, Patchset 7: var unsupportedLibraryUris = new Set<String>();
Sigmund Cherem . unresolved

minor: consider using a List, rather than a Set, to also validate that the size of the set is 1 (only 1 diagnostic is reported). Ditto with the next test?

File pkg/frontend_server/lib/frontend_server.dart
Line 64, Patchset 7: help: 'Whether platform specific dart:* libraries should be importable '
Sigmund Cherem . resolved

optional nit: consider inverting the sentence to say that the library is unsupported, rather than the runtime? Maybe "Whether to allow imports to unsupported platform libraries."

File pkg/kernel/lib/src/ast/libraries.dart
Line 47, Patchset 7: bool get isUnsupported => flags & SupportConditionalImportsFlag != 0;
Sigmund Cherem . unresolved

(not to fix on this CL) - it would be nice to make this consistent with `importability` (either combining the two, or renaming this to conditionalImportability). Maybe add a TODO or filing a bug to track this?

File sdk/lib/libraries.yaml
Line 271, Patchset 7: support_conditional_import: false
Sigmund Cherem . unresolved

Question: Any reason to keep `supported` here during a transition period?
I'm mainly thinking about the rollout into google3 and flutter, where we also have library specification files that contain "imports" to this specification file. I believe the way you made the change (where `supported` is deprecated but still supported) should gracefully allow for rolling out this change without causing issues, but I'm not 100% sure. The one piece that gives me concern is where we mix of code rolled from the Flutter SDK combined with code from the Dart SDK at different versions. We kept the SDKs disjoint for mobile targets, but we do mix them a bit for web targets in g3.

Open in Gerrit

Related details

Attention is currently required from:
  • Ben Konyi
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedCommit-Message-Has-TEST
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Ife819b2e1a6d28f67d80aab6701cd23a1724aa4d
Gerrit-Change-Number: 465760
Gerrit-PatchSet: 7
Gerrit-Owner: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-CC: Alexander Markov <alexm...@google.com>
Gerrit-CC: Jens Johansen <je...@google.com>
Gerrit-CC: Sigmund Cherem <sig...@google.com>
Gerrit-Attention: Ben Konyi <bko...@google.com>
Gerrit-Comment-Date: Mon, 08 Dec 2025 20:55:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Ben Konyi (Gerrit)

unread,
Dec 9, 2025, 4:53:37 PM (12 days ago) Dec 9
to Sigmund Cherem, Commit Queue, Alexander Markov, Jens Johansen, dart-dc-te...@google.com, dart-fe-te...@google.com, dart2js-te...@google.com, rev...@dartlang.org
Attention needed from Sigmund Cherem

Ben Konyi voted and added 8 comments

Votes added by Ben Konyi

Commit-Queue+1

8 comments

File pkg/compiler/lib/src/kernel/dart2js_target.dart
Line 383, Patchset 5: : super(supported: const {'_dart2js_only', '_js_annotations'});
Sigmund Cherem . resolved

is this change needed?

This only changes whether you can use `_js_annotations` in a conditional import, but our preference is generally not to allow using internal libraries in that context ([ref][1])

[1]: https://github.com/dart-lang/sdk/blob/f19440c37b1433921c4bdf55cee11f9710dc816c/pkg/_fe_analyzer_shared/lib/src/util/libraries_specification.dart#L64

Ben Konyi

Done

File pkg/dev_compiler/lib/src/kernel/target.dart
Line 99, Patchset 7: List<String> get extraRequiredLibrariesPlatform => const ['dart:ffi'];
Sigmund Cherem . resolved

I wonder if we need both this and the change above, or only one of them?

Ben Konyi

I think we need both. This property is only used when generating the `platform.dill`, which ensures that it's actually included. `extraRequiredLibraries` is used when compiling actual applications to determine which libraries should be loaded, so we probably don't want to load libraries that aren't importable.

Line 333, Patchset 5: // These two native libraries have always been "supported" for DDC and
Sigmund Cherem . resolved

I believe we don't need to add them here, as these are derived automatically from the library specification.

Suggestion: could we also lean into the library specification to declare libraries that can be imported when the flag is enabled?

The motivation is a bit nuanced. The original goal with that specification was to centralize knowledge and try to use a declarative syntax for how our targets are configured. I still imagine however that the effective result is equivalent to your current implementation, though.

The full specification is described in the specification parser here: https://github.com/dart-lang/sdk/blob/f19440c37b1433921c4bdf55cee11f9710dc816c/pkg/_fe_analyzer_shared/lib/src/util/libraries_specification.dart, and I imagine we can extend it to add a new parameter to encode the new logic without having to replicate the information in the Target implementation class.

For example, if instead of `supported: false`, we change it to:
```
io:
url: ...
support_direct_import: true
support_conditional_import: false # << equivalent to supported: false
ffi:
url: ...
support_direct_import: with_flag # << the new semantics
support_conditional_import: false # << still says false in conditional imports
```

Thoughts?

Ben Konyi

Done

Line 342, Patchset 5: '_js_annotations',
Sigmund Cherem . resolved

same as in the dart2js target, I don't think we should add this one. (side comment, I wish the way we did _ddc_only/_dart2js_only was to add `supported: true` to the specification to override the default, but those libraries are already a workaround because we wanted a way to distinguish tools rather than libraries in conditional imports).

Ben Konyi

Done

File pkg/front_end/lib/src/base/uri_translator.dart
Line 59, Patchset 7: Importability.always;
Sigmund Cherem . resolved

I wonder if the default here should be `never`. That is, the reason the first expression would be null is if we are missing an entry in the .yaml file for a specific library.

It's possible we have test coverage for it elsewhere, but if not, it may help to also add a test for trying to import a library that doesn't exist in the specification and making sure we provide the right diagnostic in that case too.

Ben Konyi

Yeah, I think this can be `never`. We should be checking that this is a `dart:*` URI before trying to call this function, so we can default to `always` in the situation where we're not looking at a core library where this is called.

File pkg/front_end/test/unsupported_platform_dart_library_import_test.dart
Line 29, Patchset 7: var unsupportedLibraryUris = new Set<String>();
Sigmund Cherem . resolved

minor: consider using a List, rather than a Set, to also validate that the size of the set is 1 (only 1 diagnostic is reported). Ditto with the next test?

Ben Konyi

Done

File pkg/kernel/lib/src/ast/libraries.dart
Line 47, Patchset 7: bool get isUnsupported => flags & SupportConditionalImportsFlag != 0;
Sigmund Cherem . unresolved

(not to fix on this CL) - it would be nice to make this consistent with `importability` (either combining the two, or renaming this to conditionalImportability). Maybe add a TODO or filing a bug to track this?

Ben Konyi

Not sure how I missed the part that said not to fix on this CL, but I fixed it on this CL... I don't think it adds too much, but I can revert if needed.

File sdk/lib/libraries.yaml
Line 271, Patchset 7: support_conditional_import: false
Sigmund Cherem . resolved

Question: Any reason to keep `supported` here during a transition period?
I'm mainly thinking about the rollout into google3 and flutter, where we also have library specification files that contain "imports" to this specification file. I believe the way you made the change (where `supported` is deprecated but still supported) should gracefully allow for rolling out this change without causing issues, but I'm not 100% sure. The one piece that gives me concern is where we mix of code rolled from the Flutter SDK combined with code from the Dart SDK at different versions. We kept the SDKs disjoint for mobile targets, but we do mix them a bit for web targets in g3.

Ben Konyi

I was keeping it around with the assumption that there were uses of `supported` in Flutter, but it doesn't look like there is. I'm going to try removing it and see what happens.

Open in Gerrit

Related details

Attention is currently required from:
  • Sigmund Cherem
Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement satisfiedCommit-Message-Has-TEST
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: Ife819b2e1a6d28f67d80aab6701cd23a1724aa4d
    Gerrit-Change-Number: 465760
    Gerrit-PatchSet: 12
    Gerrit-Owner: Ben Konyi <bko...@google.com>
    Gerrit-Reviewer: Ben Konyi <bko...@google.com>
    Gerrit-CC: Alexander Markov <alexm...@google.com>
    Gerrit-CC: Jens Johansen <je...@google.com>
    Gerrit-CC: Sigmund Cherem <sig...@google.com>
    Gerrit-Attention: Sigmund Cherem <sig...@google.com>
    Gerrit-Comment-Date: Tue, 09 Dec 2025 21:53:34 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Sigmund Cherem <sig...@google.com>
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Sigmund Cherem (Gerrit)

    unread,
    Dec 9, 2025, 5:16:24 PM (12 days ago) Dec 9
    to Ben Konyi, Sigmund Cherem, Commit Queue, Alexander Markov, Jens Johansen, dart-dc-te...@google.com, dart-fe-te...@google.com, dart2js-te...@google.com, rev...@dartlang.org
    Attention needed from Ben Konyi

    Sigmund Cherem added 5 comments

    Patchset-level comments
    File-level comment, Patchset 13 (Latest):
    Sigmund Cherem . resolved

    Nice! LGTM, thanks for making all the changes.

    File pkg/front_end/lib/src/kernel/kernel_target.dart
    Line 1840, Patchset 13 (Latest): final List<Library> libraries = loader.libraries;
    Sigmund Cherem . resolved

    Nice that you moved this here - seems like we can keep the logic within the CFE for now and not expose ways to override it on targets yet if we don't need to.

    File pkg/front_end/testcases/general/supported_libraries/main.dart
    File pkg/kernel/lib/src/ast/libraries.dart
    Line 47, Patchset 7: bool get isUnsupported => flags & SupportConditionalImportsFlag != 0;
    Sigmund Cherem . resolved

    (not to fix on this CL) - it would be nice to make this consistent with `importability` (either combining the two, or renaming this to conditionalImportability). Maybe add a TODO or filing a bug to track this?

    Ben Konyi

    Not sure how I missed the part that said not to fix on this CL, but I fixed it on this CL... I don't think it adds too much, but I can revert if needed.

    Sigmund Cherem

    Thanks, looks good to me :)

    File sdk/lib/libraries.yaml
    Line 271, Patchset 7: support_conditional_import: false
    Sigmund Cherem . resolved

    Question: Any reason to keep `supported` here during a transition period?
    I'm mainly thinking about the rollout into google3 and flutter, where we also have library specification files that contain "imports" to this specification file. I believe the way you made the change (where `supported` is deprecated but still supported) should gracefully allow for rolling out this change without causing issues, but I'm not 100% sure. The one piece that gives me concern is where we mix of code rolled from the Flutter SDK combined with code from the Dart SDK at different versions. We kept the SDKs disjoint for mobile targets, but we do mix them a bit for web targets in g3.

    Ben Konyi

    I was keeping it around with the assumption that there were uses of `supported` in Flutter, but it doesn't look like there is. I'm going to try removing it and see what happens.

    Sigmund Cherem

    Oh, sorry for the confusion and ambiguity on my initial message - I meant actually a bit the opposite: instead of just keep `supported` in the implementation of the spec format, I was wondering if we should also keep `supported` in the .yaml/.json file for a while longer and wait to remove it after we do a roll and we see that everything continues to work.

    That said - I have no strong opinions here. I'm happy with any approach. I was just looking to reduce friction/toil in the rollout process.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Ben Konyi
    Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement satisfiedCommit-Message-Has-TEST
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: Ife819b2e1a6d28f67d80aab6701cd23a1724aa4d
    Gerrit-Change-Number: 465760
    Gerrit-PatchSet: 13
    Gerrit-Owner: Ben Konyi <bko...@google.com>
    Gerrit-Reviewer: Ben Konyi <bko...@google.com>
    Gerrit-CC: Alexander Markov <alexm...@google.com>
    Gerrit-CC: Jens Johansen <je...@google.com>
    Gerrit-CC: Sigmund Cherem <sig...@google.com>
    Gerrit-Attention: Ben Konyi <bko...@google.com>
    Gerrit-Comment-Date: Tue, 09 Dec 2025 22:16:21 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Ben Konyi <bko...@google.com>
    Comment-In-Reply-To: Sigmund Cherem <sig...@google.com>
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Ben Konyi (Gerrit)

    unread,
    Dec 10, 2025, 12:45:08 PM (11 days ago) Dec 10
    to Sigmund Cherem, Commit Queue, Alexander Markov, Jens Johansen, dart-dc-te...@google.com, dart-fe-te...@google.com, dart2js-te...@google.com, rev...@dartlang.org
    Attention needed from Sigmund Cherem

    Ben Konyi added 1 comment

    File pkg/front_end/testcases/general/supported_libraries/main.dart
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Sigmund Cherem
    Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement satisfiedCommit-Message-Has-TEST
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: Ife819b2e1a6d28f67d80aab6701cd23a1724aa4d
    Gerrit-Change-Number: 465760
    Gerrit-PatchSet: 14
    Gerrit-Owner: Ben Konyi <bko...@google.com>
    Gerrit-Reviewer: Ben Konyi <bko...@google.com>
    Gerrit-CC: Alexander Markov <alexm...@google.com>
    Gerrit-CC: Jens Johansen <je...@google.com>
    Gerrit-CC: Sigmund Cherem <sig...@google.com>
    Gerrit-Attention: Sigmund Cherem <sig...@google.com>
    Gerrit-Comment-Date: Wed, 10 Dec 2025 17:45:05 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Sigmund Cherem <sig...@google.com>
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Ben Konyi (Gerrit)

    unread,
    Dec 10, 2025, 12:57:16 PM (11 days ago) Dec 10
    to Nate Biggs, Jens Johansen, Sigmund Cherem, Commit Queue, Alexander Markov, dart-dc-te...@google.com, dart-fe-te...@google.com, dart2js-te...@google.com, rev...@dartlang.org
    Attention needed from Jens Johansen and Sigmund Cherem

    Ben Konyi added 1 comment

    Patchset-level comments
    File-level comment, Patchset 16 (Latest):
    Ben Konyi . resolved

    Okay, I think this is ready for an actual review now. PTAL!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jens Johansen
    • Sigmund Cherem
    Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement satisfiedCommit-Message-Has-TEST
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: Ife819b2e1a6d28f67d80aab6701cd23a1724aa4d
    Gerrit-Change-Number: 465760
    Gerrit-PatchSet: 16
    Gerrit-Owner: Ben Konyi <bko...@google.com>
    Gerrit-Reviewer: Ben Konyi <bko...@google.com>
    Gerrit-Reviewer: Jens Johansen <je...@google.com>
    Gerrit-Reviewer: Sigmund Cherem <sig...@google.com>
    Gerrit-CC: Alexander Markov <alexm...@google.com>
    Gerrit-CC: Nate Biggs <nate...@google.com>
    Gerrit-Attention: Sigmund Cherem <sig...@google.com>
    Gerrit-Attention: Jens Johansen <je...@google.com>
    Gerrit-Comment-Date: Wed, 10 Dec 2025 17:57:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Jens Johansen (Gerrit)

    unread,
    Dec 11, 2025, 3:25:46 AM (11 days ago) Dec 11
    to Ben Konyi, Johnni Winther, Nate Biggs, Sigmund Cherem, Commit Queue, Alexander Markov, dart-dc-te...@google.com, dart-fe-te...@google.com, dart2js-te...@google.com, rev...@dartlang.org
    Attention needed from Ben Konyi, Johnni Winther and Sigmund Cherem

    Jens Johansen added 5 comments

    Patchset-level comments
    File-level comment, Patchset 17 (Latest):
    Jens Johansen . resolved

    I don't have any objections, but have left a few comments. (would also like some more unit tests to get rid of some of the coverage ignore comments)

    I will refer to Johnni though as he knows more about the unsupported/supported stuff.

    File pkg/_fe_analyzer_shared/lib/src/util/libraries_specification.dart
    Line 338, Patchset 17 (Latest):
    final Object? supportConditionalImport =
    data['support_conditional_import'];
    if (supportConditionalImport != null &&
    supportConditionalImport is! bool) {
    _reportError(
    messagePropertyIsNotABool(
    'support_conditional_import',
    supportConditionalImport,
    ),
    );
    }
    Jens Johansen . unresolved

    Maybe

    ```
    final Object supportConditionalImport =
    data['support_conditional_import'] ?? true;
    if (supportConditionalImport is! bool) {
    _reportError(
    messagePropertyIsNotABool(
    'support_conditional_import',
    supportConditionalImport,
    ),
    );
    }
    ```

    would read better (and avoid the `?? true` below)

    File pkg/front_end/lib/src/builder/compilation_unit.dart
    Line 51, Patchset 17 (Latest): /// Specifies if the library is importable on the target platform.
    Jens Johansen . unresolved

    `if` doesn't seem to capture a three-valued enum. Also below.

    File pkg/front_end/lib/src/kernel/kernel_target.dart
    Line 1873, Patchset 17 (Latest): // TODO: is there a better way to get this offset?
    dependency.fileOffset + 'import '.length,
    Jens Johansen . unresolved

    I do think we should do this. Both `import "foo.dart"` and
    ```
    import
    "foo.dart"
    ```

    are perfectly legal.

    File pkg/front_end/lib/src/source/source_loader.dart
    Line 427, Patchset 17 (Latest): conditionalImportSupported:
    origin?.conditionalImportSupported ??
    isDartLib && target.uriTranslator.isLibrarySupported(importUri.path),
    Jens Johansen . unresolved

    Hasn't the logic been inverted here?
    Before in the `??` case on a non-dart-import it would be `isUnsupported: false`, now the same situation becomes `conditionalImportSupported: false`. In other places a default of `true` has become `false` (e.g. below).

    (Or is it a bug-fix, because non-dart libraries should never be supported? And maybe more a no-op because it's only used for dart libraries anyway?)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Ben Konyi
    • Johnni Winther
    • Sigmund Cherem
    Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement satisfiedCommit-Message-Has-TEST
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: Ife819b2e1a6d28f67d80aab6701cd23a1724aa4d
    Gerrit-Change-Number: 465760
    Gerrit-PatchSet: 17
    Gerrit-Owner: Ben Konyi <bko...@google.com>
    Gerrit-Reviewer: Ben Konyi <bko...@google.com>
    Gerrit-Reviewer: Jens Johansen <je...@google.com>
    Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
    Gerrit-Reviewer: Sigmund Cherem <sig...@google.com>
    Gerrit-CC: Alexander Markov <alexm...@google.com>
    Gerrit-CC: Nate Biggs <nate...@google.com>
    Gerrit-Attention: Ben Konyi <bko...@google.com>
    Gerrit-Attention: Sigmund Cherem <sig...@google.com>
    Gerrit-Attention: Johnni Winther <johnni...@google.com>
    Gerrit-Comment-Date: Thu, 11 Dec 2025 08:25:39 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Ben Konyi (Gerrit)

    unread,
    Dec 11, 2025, 4:02:36 PM (10 days ago) Dec 11
    to Johnni Winther, Nate Biggs, Jens Johansen, Sigmund Cherem, Commit Queue, Alexander Markov, dart-dc-te...@google.com, dart-fe-te...@google.com, dart2js-te...@google.com, rev...@dartlang.org
    Attention needed from Jens Johansen, Johnni Winther and Sigmund Cherem

    Ben Konyi voted and added 4 comments

    Votes added by Ben Konyi

    Commit-Queue+1

    4 comments

    File pkg/_fe_analyzer_shared/lib/src/util/libraries_specification.dart

    final Object? supportConditionalImport =
    data['support_conditional_import'];
    if (supportConditionalImport != null &&
    supportConditionalImport is! bool) {
    _reportError(
    messagePropertyIsNotABool(
    'support_conditional_import',
    supportConditionalImport,
    ),
    );
    }
    Jens Johansen . resolved

    Maybe

    ```
    final Object supportConditionalImport =
    data['support_conditional_import'] ?? true;
    if (supportConditionalImport is! bool) {
    _reportError(
    messagePropertyIsNotABool(
    'support_conditional_import',
    supportConditionalImport,
    ),
    );
    }
    ```

    would read better (and avoid the `?? true` below)

    Ben Konyi

    Done

    File pkg/front_end/lib/src/builder/compilation_unit.dart
    Line 51, Patchset 17: /// Specifies if the library is importable on the target platform.
    Jens Johansen . resolved

    `if` doesn't seem to capture a three-valued enum. Also below.

    Ben Konyi

    Done

    File pkg/front_end/lib/src/kernel/kernel_target.dart
    Line 1873, Patchset 17: // TODO: is there a better way to get this offset?
    dependency.fileOffset + 'import '.length,
    Jens Johansen . resolved

    I do think we should do this. Both `import "foo.dart"` and
    ```
    import
    "foo.dart"
    ```

    are perfectly legal.

    Ben Konyi

    Yeah, this felt weird to me. I've inverted the logic here to look at accessors of libraries rather than imports / exports within a library to get access to the correct offsets.

    File pkg/front_end/lib/src/source/source_loader.dart
    Line 427, Patchset 17: conditionalImportSupported:

    origin?.conditionalImportSupported ??
    isDartLib && target.uriTranslator.isLibrarySupported(importUri.path),
    Jens Johansen . resolved

    Hasn't the logic been inverted here?
    Before in the `??` case on a non-dart-import it would be `isUnsupported: false`, now the same situation becomes `conditionalImportSupported: false`. In other places a default of `true` has become `false` (e.g. below).

    (Or is it a bug-fix, because non-dart libraries should never be supported? And maybe more a no-op because it's only used for dart libraries anyway?)

    Ben Konyi

    Yeah, non-dart libraries should never be supported WRT conditional imports and `isLibrarySupported` should only be used to determine if a dart: library is supported.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jens Johansen
    • Johnni Winther
    • Sigmund Cherem
    Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement satisfiedCommit-Message-Has-TEST
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: Ife819b2e1a6d28f67d80aab6701cd23a1724aa4d
    Gerrit-Change-Number: 465760
    Gerrit-PatchSet: 19
    Gerrit-Owner: Ben Konyi <bko...@google.com>
    Gerrit-Reviewer: Ben Konyi <bko...@google.com>
    Gerrit-Reviewer: Jens Johansen <je...@google.com>
    Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
    Gerrit-Reviewer: Sigmund Cherem <sig...@google.com>
    Gerrit-CC: Alexander Markov <alexm...@google.com>
    Gerrit-CC: Nate Biggs <nate...@google.com>
    Gerrit-Attention: Sigmund Cherem <sig...@google.com>
    Gerrit-Attention: Jens Johansen <je...@google.com>
    Gerrit-Attention: Johnni Winther <johnni...@google.com>
    Gerrit-Comment-Date: Thu, 11 Dec 2025 21:02:33 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Jens Johansen <je...@google.com>
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Nicholas Shahan (Gerrit)

    unread,
    Dec 12, 2025, 3:24:08 PM (9 days ago) Dec 12
    to Ben Konyi, Johnni Winther, Nate Biggs, Jens Johansen, Sigmund Cherem, Commit Queue, Alexander Markov, dart-dc-te...@google.com, dart-fe-te...@google.com, dart2js-te...@google.com, rev...@dartlang.org
    Attention needed from Ben Konyi, Jens Johansen, Johnni Winther and Sigmund Cherem

    Nicholas Shahan added 1 comment

    File pkg/dev_compiler/lib/src/command/arguments.dart
    Line 105, Patchset 21 (Latest): } else if (arg == '--include-unsupported-platform-library-stubs') {
    includeUnsupportedPlatformLibraryStubs = true;
    Nicholas Shahan . unresolved

    Summary from our discussion:

    • This flag is only propagated to the creation of the `Target`.
    • The widget previews rely on the frontend server to create the `Target` instance.
    • We can probably remove the command line flag from DDC for now and add it if we have a direct use when compiling from the command line invocation.
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Ben Konyi
    • Jens Johansen
    • Johnni Winther
    • Sigmund Cherem
    Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement satisfiedCommit-Message-Has-TEST
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: Ife819b2e1a6d28f67d80aab6701cd23a1724aa4d
    Gerrit-Change-Number: 465760
    Gerrit-PatchSet: 21
    Gerrit-Owner: Ben Konyi <bko...@google.com>
    Gerrit-Reviewer: Ben Konyi <bko...@google.com>
    Gerrit-Reviewer: Jens Johansen <je...@google.com>
    Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
    Gerrit-Reviewer: Sigmund Cherem <sig...@google.com>
    Gerrit-CC: Alexander Markov <alexm...@google.com>
    Gerrit-CC: Nate Biggs <nate...@google.com>
    Gerrit-CC: Nicholas Shahan <nsh...@google.com>
    Gerrit-Attention: Ben Konyi <bko...@google.com>
    Gerrit-Attention: Sigmund Cherem <sig...@google.com>
    Gerrit-Attention: Jens Johansen <je...@google.com>
    Gerrit-Attention: Johnni Winther <johnni...@google.com>
    Gerrit-Comment-Date: Fri, 12 Dec 2025 20:24:05 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Johnni Winther (Gerrit)

    unread,
    Dec 15, 2025, 4:19:01 AM (7 days ago) Dec 15
    to Ben Konyi, Nicholas Shahan, Nate Biggs, Jens Johansen, Sigmund Cherem, Commit Queue, Alexander Markov, dart-dc-te...@google.com, dart-fe-te...@google.com, dart2js-te...@google.com, rev...@dartlang.org
    Attention needed from Ben Konyi, Jens Johansen and Sigmund Cherem

    Johnni Winther voted Code-Review+1

    Code-Review+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Ben Konyi
    • Jens Johansen
    • Sigmund Cherem
    Submit Requirements:
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedCommit-Message-Has-TEST
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: sdk
      Gerrit-Branch: main
      Gerrit-Change-Id: Ife819b2e1a6d28f67d80aab6701cd23a1724aa4d
      Gerrit-Change-Number: 465760
      Gerrit-PatchSet: 21
      Gerrit-Owner: Ben Konyi <bko...@google.com>
      Gerrit-Reviewer: Ben Konyi <bko...@google.com>
      Gerrit-Reviewer: Jens Johansen <je...@google.com>
      Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
      Gerrit-Reviewer: Sigmund Cherem <sig...@google.com>
      Gerrit-CC: Alexander Markov <alexm...@google.com>
      Gerrit-CC: Nate Biggs <nate...@google.com>
      Gerrit-CC: Nicholas Shahan <nsh...@google.com>
      Gerrit-Attention: Ben Konyi <bko...@google.com>
      Gerrit-Attention: Sigmund Cherem <sig...@google.com>
      Gerrit-Attention: Jens Johansen <je...@google.com>
      Gerrit-Comment-Date: Mon, 15 Dec 2025 09:18:58 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Ben Konyi (Gerrit)

      unread,
      Dec 15, 2025, 10:03:52 AM (6 days ago) Dec 15
      to Johnni Winther, Nicholas Shahan, Nate Biggs, Jens Johansen, Sigmund Cherem, Commit Queue, Alexander Markov, dart-dc-te...@google.com, dart-fe-te...@google.com, dart2js-te...@google.com, rev...@dartlang.org
      Attention needed from Jens Johansen, Johnni Winther, Nicholas Shahan and Sigmund Cherem

      Ben Konyi voted and added 1 comment

      Votes added by Ben Konyi

      Commit-Queue+1

      1 comment

      File pkg/dev_compiler/lib/src/command/arguments.dart
      Line 105, Patchset 21: } else if (arg == '--include-unsupported-platform-library-stubs') {
      includeUnsupportedPlatformLibraryStubs = true;
      Nicholas Shahan . resolved

      Summary from our discussion:

      • This flag is only propagated to the creation of the `Target`.
      • The widget previews rely on the frontend server to create the `Target` instance.
      • We can probably remove the command line flag from DDC for now and add it if we have a direct use when compiling from the command line invocation.
      Ben Konyi

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Jens Johansen
      • Johnni Winther
      • Nicholas Shahan
      • Sigmund Cherem
      Submit Requirements:
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement satisfiedCommit-Message-Has-TEST
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: sdk
        Gerrit-Branch: main
        Gerrit-Change-Id: Ife819b2e1a6d28f67d80aab6701cd23a1724aa4d
        Gerrit-Change-Number: 465760
        Gerrit-PatchSet: 22
        Gerrit-Owner: Ben Konyi <bko...@google.com>
        Gerrit-Reviewer: Ben Konyi <bko...@google.com>
        Gerrit-Reviewer: Jens Johansen <je...@google.com>
        Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
        Gerrit-Reviewer: Sigmund Cherem <sig...@google.com>
        Gerrit-CC: Alexander Markov <alexm...@google.com>
        Gerrit-CC: Nate Biggs <nate...@google.com>
        Gerrit-CC: Nicholas Shahan <nsh...@google.com>
        Gerrit-Attention: Sigmund Cherem <sig...@google.com>
        Gerrit-Attention: Jens Johansen <je...@google.com>
        Gerrit-Attention: Nicholas Shahan <nsh...@google.com>
        Gerrit-Attention: Johnni Winther <johnni...@google.com>
        Gerrit-Comment-Date: Mon, 15 Dec 2025 15:03:48 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        Comment-In-Reply-To: Nicholas Shahan <nsh...@google.com>
        unsatisfied_requirement
        satisfied_requirement
        open
        diffy

        Ben Konyi (Gerrit)

        unread,
        Dec 15, 2025, 10:45:18 AM (6 days ago) Dec 15
        to Nicholas Shahan, Johnni Winther, Nate Biggs, Jens Johansen, Sigmund Cherem, Commit Queue, Alexander Markov, dart-dc-te...@google.com, dart-fe-te...@google.com, dart2js-te...@google.com, rev...@dartlang.org
        Attention needed from Jens Johansen, Johnni Winther, Nicholas Shahan and Sigmund Cherem

        Ben Konyi voted Commit-Queue+1

        Commit-Queue+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Jens Johansen
        • Johnni Winther
        • Nicholas Shahan
        • Sigmund Cherem
        Submit Requirements:
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement satisfiedCommit-Message-Has-TEST
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: sdk
        Gerrit-Branch: main
        Gerrit-Change-Id: Ife819b2e1a6d28f67d80aab6701cd23a1724aa4d
        Gerrit-Change-Number: 465760
        Gerrit-PatchSet: 22
        Gerrit-Owner: Ben Konyi <bko...@google.com>
        Gerrit-Reviewer: Ben Konyi <bko...@google.com>
        Gerrit-Reviewer: Jens Johansen <je...@google.com>
        Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
        Gerrit-Reviewer: Nicholas Shahan <nsh...@google.com>
        Gerrit-Reviewer: Sigmund Cherem <sig...@google.com>
        Gerrit-CC: Alexander Markov <alexm...@google.com>
        Gerrit-CC: Nate Biggs <nate...@google.com>
        Gerrit-Attention: Sigmund Cherem <sig...@google.com>
        Gerrit-Attention: Jens Johansen <je...@google.com>
        Gerrit-Attention: Nicholas Shahan <nsh...@google.com>
        Gerrit-Attention: Johnni Winther <johnni...@google.com>
        Gerrit-Comment-Date: Mon, 15 Dec 2025 15:45:16 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        unsatisfied_requirement
        satisfied_requirement
        open
        diffy

        Johnni Winther (Gerrit)

        unread,
        Dec 15, 2025, 10:51:59 AM (6 days ago) Dec 15
        to Ben Konyi, Nicholas Shahan, Nate Biggs, Jens Johansen, Sigmund Cherem, Commit Queue, Alexander Markov, dart-dc-te...@google.com, dart-fe-te...@google.com, dart2js-te...@google.com, rev...@dartlang.org
        Attention needed from Ben Konyi, Jens Johansen, Nicholas Shahan and Sigmund Cherem

        Johnni Winther voted Code-Review+1

        Code-Review+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Ben Konyi
        • Jens Johansen
        • Nicholas Shahan
        • Sigmund Cherem
        Submit Requirements:
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedCommit-Message-Has-TEST
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: sdk
          Gerrit-Branch: main
          Gerrit-Change-Id: Ife819b2e1a6d28f67d80aab6701cd23a1724aa4d
          Gerrit-Change-Number: 465760
          Gerrit-PatchSet: 22
          Gerrit-Owner: Ben Konyi <bko...@google.com>
          Gerrit-Reviewer: Ben Konyi <bko...@google.com>
          Gerrit-Reviewer: Jens Johansen <je...@google.com>
          Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
          Gerrit-Reviewer: Nicholas Shahan <nsh...@google.com>
          Gerrit-Reviewer: Sigmund Cherem <sig...@google.com>
          Gerrit-CC: Alexander Markov <alexm...@google.com>
          Gerrit-CC: Nate Biggs <nate...@google.com>
          Gerrit-Attention: Ben Konyi <bko...@google.com>
          Gerrit-Attention: Sigmund Cherem <sig...@google.com>
          Gerrit-Attention: Jens Johansen <je...@google.com>
          Gerrit-Attention: Nicholas Shahan <nsh...@google.com>
          Gerrit-Comment-Date: Mon, 15 Dec 2025 15:51:52 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy

          Nicholas Shahan (Gerrit)

          unread,
          Dec 16, 2025, 12:29:39 PM (5 days ago) Dec 16
          to Ben Konyi, Johnni Winther, Nate Biggs, Jens Johansen, Sigmund Cherem, Commit Queue, Alexander Markov, dart-dc-te...@google.com, dart-fe-te...@google.com, dart2js-te...@google.com, rev...@dartlang.org
          Attention needed from Ben Konyi, Jens Johansen and Sigmund Cherem

          Nicholas Shahan added 2 comments

          Patchset-level comments
          File-level comment, Patchset 22 (Latest):
          Nicholas Shahan . resolved

          I really hope that in the future we can find a more wholistic approach for handling platform specific libraries. This does the job for this targeted use case but like we've discussed I don't think it offers a good solution for end users and the package ecosystem if we truly want it to be multi-platform. Thanks for all of the discussions around this CL.

          File pkg/vm/lib/kernel_front_end.dart
          Line 999, Patchset 22 (Latest): includeUnsupportedPlatformLibraryStubs:
          includeUnsupportedPlatformLibraryStubs,
          Nicholas Shahan . resolved

          Wow, I was looking all over the CL for this code. I didn't expect to find it here.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Ben Konyi
          • Jens Johansen
          • Sigmund Cherem
          Gerrit-Comment-Date: Tue, 16 Dec 2025 17:29:36 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy

          Nicholas Shahan (Gerrit)

          unread,
          Dec 16, 2025, 12:29:45 PM (5 days ago) Dec 16
          to Ben Konyi, Johnni Winther, Nate Biggs, Jens Johansen, Sigmund Cherem, Commit Queue, Alexander Markov, dart-dc-te...@google.com, dart-fe-te...@google.com, dart2js-te...@google.com, rev...@dartlang.org
          Attention needed from Ben Konyi, Jens Johansen and Sigmund Cherem

          Nicholas Shahan voted Code-Review+1

          Code-Review+1
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Ben Konyi
          • Jens Johansen
          • Sigmund Cherem
          Submit Requirements:
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedCommit-Message-Has-TEST
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: sdk
          Gerrit-Branch: main
          Gerrit-Change-Id: Ife819b2e1a6d28f67d80aab6701cd23a1724aa4d
          Gerrit-Change-Number: 465760
          Gerrit-PatchSet: 22
          Gerrit-Owner: Ben Konyi <bko...@google.com>
          Gerrit-Reviewer: Ben Konyi <bko...@google.com>
          Gerrit-Reviewer: Jens Johansen <je...@google.com>
          Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
          Gerrit-Reviewer: Nicholas Shahan <nsh...@google.com>
          Gerrit-Reviewer: Sigmund Cherem <sig...@google.com>
          Gerrit-CC: Alexander Markov <alexm...@google.com>
          Gerrit-CC: Nate Biggs <nate...@google.com>
          Gerrit-Attention: Ben Konyi <bko...@google.com>
          Gerrit-Attention: Sigmund Cherem <sig...@google.com>
          Gerrit-Attention: Jens Johansen <je...@google.com>
          Gerrit-Comment-Date: Tue, 16 Dec 2025 17:29:42 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          open
          diffy

          Ben Konyi (Gerrit)

          unread,
          Dec 16, 2025, 1:13:44 PM (5 days ago) Dec 16
          to Nicholas Shahan, Johnni Winther, Nate Biggs, Jens Johansen, Sigmund Cherem, Commit Queue, Alexander Markov, dart-dc-te...@google.com, dart-fe-te...@google.com, dart2js-te...@google.com, rev...@dartlang.org
          Attention needed from Jens Johansen and Sigmund Cherem

          Ben Konyi voted Commit-Queue+2

          Commit-Queue+2
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Jens Johansen
          • Sigmund Cherem
          Submit Requirements:
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedCommit-Message-Has-TEST
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: sdk
          Gerrit-Branch: main
          Gerrit-Change-Id: Ife819b2e1a6d28f67d80aab6701cd23a1724aa4d
          Gerrit-Change-Number: 465760
          Gerrit-PatchSet: 22
          Gerrit-Owner: Ben Konyi <bko...@google.com>
          Gerrit-Reviewer: Ben Konyi <bko...@google.com>
          Gerrit-Reviewer: Jens Johansen <je...@google.com>
          Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
          Gerrit-Reviewer: Nicholas Shahan <nsh...@google.com>
          Gerrit-Reviewer: Sigmund Cherem <sig...@google.com>
          Gerrit-CC: Alexander Markov <alexm...@google.com>
          Gerrit-CC: Nate Biggs <nate...@google.com>
          Gerrit-Attention: Sigmund Cherem <sig...@google.com>
          Gerrit-Attention: Jens Johansen <je...@google.com>
          Gerrit-Comment-Date: Tue, 16 Dec 2025 18:13:41 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          open
          diffy

          Ben Konyi (Gerrit)

          unread,
          Dec 17, 2025, 11:52:22 AM (4 days ago) Dec 17
          to Nicholas Shahan, Johnni Winther, Nate Biggs, Jens Johansen, Sigmund Cherem, Commit Queue, Alexander Markov, dart-dc-te...@google.com, dart-fe-te...@google.com, dart2js-te...@google.com, rev...@dartlang.org
          Gerrit-Comment-Date: Wed, 17 Dec 2025 16:52:19 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          open
          diffy

          Commit Queue (Gerrit)

          unread,
          Dec 17, 2025, 12:30:47 PM (4 days ago) Dec 17
          to Ben Konyi, Nicholas Shahan, Johnni Winther, Nate Biggs, Jens Johansen, Sigmund Cherem, Alexander Markov, dart-dc-te...@google.com, dart-fe-te...@google.com, dart2js-te...@google.com, rev...@dartlang.org

          Commit Queue submitted the change

          Change information

          Commit message:
          [ DDC / CFE ] Add support for allowing imports of unsupported libraries

          This change adds support for allowing for imports of unsupported
          platform-specific libraries when the
          `--include-unsupported-platform-library-stubs` flag is provided to the
          CFE.

          This flag sets the `includeUnsupportedPlatformLibraryStubs` property in
          `TargetFlags`, which `Target`s can use to conditionally return different
          `DartLibrarySupport` objects with different supported/unsupported
          library sets.

          A `checkForUnsupportedDartColonImports` function has been added to
          `Target` that uses the value of `dartLibrarySupport` to determine if
          there's any unsupported library imports. This function is called after
          the various transformation operations provided by the `Target`
          implementation, meaning the import of an unsupported library specified
          in `dartLibrarySupport` will now result in a compilation error (this
          includes `dart:mirrors` imports for VM targets when mirrors are
          disabled, which was previously handled by the VM itself).

          Related to https://github.com/dart-lang/sdk/issues/62125

          TEST=Tests added / modified
          Change-Id: Ife819b2e1a6d28f67d80aab6701cd23a1724aa4d
          Reviewed-by: Nicholas Shahan <nsh...@google.com>
          Reviewed-by: Johnni Winther <johnni...@google.com>
          Commit-Queue: Ben Konyi <bko...@google.com>
          Files:
          • M pkg/_fe_analyzer_shared/lib/src/util/libraries_specification.dart
          • M pkg/_fe_analyzer_shared/test/util/libraries_specification_test.dart
          • M pkg/dev_compiler/lib/src/kernel/target.dart
          • M pkg/dev_compiler/test/expression_compiler/expression_compiler_test.dart
          • M pkg/front_end/lib/src/base/incremental_compiler.dart
          • M pkg/front_end/lib/src/base/uri_translator.dart
          • M pkg/front_end/lib/src/builder/compilation_unit.dart
          • M pkg/front_end/lib/src/builder/library_builder.dart
          • M pkg/front_end/lib/src/codes/cfe_codes_generated.dart
          • M pkg/front_end/lib/src/dill/dill_library_builder.dart
          • M pkg/front_end/lib/src/kernel/benchmarker.dart
          • M pkg/front_end/lib/src/kernel/constant_evaluator.dart
          • M pkg/front_end/lib/src/kernel/kernel_target.dart
          • M pkg/front_end/lib/src/source/source_compilation_unit.dart
          • M pkg/front_end/lib/src/source/source_library_builder.dart
          • M pkg/front_end/lib/src/source/source_loader.dart
          • M pkg/front_end/messages.yaml
          • M pkg/front_end/test/generator_to_string_test.dart
          • M pkg/front_end/test/spell_checking_list_code.txt
          • M pkg/front_end/test/spell_checking_list_common.txt
          • M pkg/front_end/test/spell_checking_list_messages.txt
          • M pkg/front_end/test/static_types/cfe_allowed.json
          • M pkg/front_end/test/types/cfe_types_test.dart
          • M pkg/front_end/test/types/kernel_type_parser_test.dart
          • A pkg/front_end/test/unsupported_platform_dart_library_import_test.dart
          • M pkg/front_end/testcases/general/patch_internal/main.dart.strong.expect
          • M pkg/front_end/testcases/general/patch_internal/main.dart.strong.modular.expect
          • M pkg/front_end/testcases/general/patch_internal/main.dart.strong.outline.expect
          • M pkg/front_end/testcases/general/patch_internal/main.dart.strong.transformed.expect
          • A pkg/front_end/testcases/general/supported_libraries/import_unsupported.not.importable_lib.dart
          • M pkg/front_end/testcases/general/supported_libraries/libraries.json
          • M pkg/front_end/testcases/general/supported_libraries/main.dart
          • M pkg/front_end/testcases/general/supported_libraries/main.dart.strong.expect
          • M pkg/front_end/testcases/general/supported_libraries/main.dart.strong.modular.expect
          • M pkg/front_end/testcases/general/supported_libraries/main.dart.strong.outline.expect
          • M pkg/front_end/testcases/general/supported_libraries/main.dart.strong.transformed.expect
          • M pkg/front_end/testcases/general/supported_libraries/main.dart.textual_outline.expect
          • M pkg/front_end/testcases/general/supported_libraries/main.dart.textual_outline_modelled.expect
          • A pkg/front_end/testcases/general/supported_libraries/unsupported.not.importable_lib.dart
          • M pkg/front_end/tool/dart_doctest_impl.dart
          • M pkg/frontend_server/lib/frontend_server.dart
          • M pkg/kernel/lib/ast.dart
          • M pkg/kernel/lib/src/ast/libraries.dart
          • M pkg/kernel/lib/target/targets.dart
          • M pkg/kernel/lib/testing/type_parser_environment.dart
          • M pkg/kernel/lib/text/ast_to_text.dart
          • M pkg/vm/lib/kernel_front_end.dart
          • M pkg/vm/testcases/transformations/mixin_deduplication/generic.dart.expect
          • M pkg/vm/testcases/transformations/mixin_deduplication/generic_recursive_bounds.dart.expect
          • M pkg/vm/testcases/transformations/mixin_deduplication/multiple_libraries_main.dart.expect
          • M pkg/vm/testcases/transformations/mixin_deduplication/non_generic.dart.expect
          • M sdk/lib/libraries.json
          • M sdk/lib/libraries.yaml
          • M tests/co19/co19-kernel.status
          • M tests/lib/js/static_interop_test/disallowed_interop_libraries_test.dart
          Change size: L
          Delta: 55 files changed, 834 insertions(+), 148 deletions(-)
          Branch: refs/heads/main
          Submit Requirements:
          • requirement satisfiedCode-Review: +1 by Nicholas Shahan, +1 by Johnni Winther
          Open in Gerrit
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: merged
          Gerrit-Project: sdk
          Gerrit-Branch: main
          Gerrit-Change-Id: Ife819b2e1a6d28f67d80aab6701cd23a1724aa4d
          Gerrit-Change-Number: 465760
          Gerrit-PatchSet: 23
          Gerrit-Owner: Ben Konyi <bko...@google.com>
          Gerrit-Reviewer: Ben Konyi <bko...@google.com>
          Gerrit-Reviewer: Jens Johansen <je...@google.com>
          Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
          Gerrit-Reviewer: Nicholas Shahan <nsh...@google.com>
          Gerrit-Reviewer: Sigmund Cherem <sig...@google.com>
          Gerrit-CC: Alexander Markov <alexm...@google.com>
          Gerrit-CC: Nate Biggs <nate...@google.com>
          open
          diffy
          satisfied_requirement

          Alexander Markov (Gerrit)

          unread,
          Dec 18, 2025, 12:06:38 PM (3 days ago) Dec 18
          to Ben Konyi, Commit Queue, Nicholas Shahan, Johnni Winther, Nate Biggs, Jens Johansen, Sigmund Cherem, Alexander Markov, dart-dc-te...@google.com, dart-fe-te...@google.com, dart2js-te...@google.com, rev...@dartlang.org

          Alexander Markov has created a revert of this change

          Related details

          Attention set is empty
          Submit Requirements:
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedCommit-Message-Has-TEST
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: revert
          satisfied_requirement
          open
          diffy
          Reply all
          Reply to author
          Forward
          0 new messages