[S] Change in dart/sdk[main]: [vm,dynamic_modules] Add private FFI callables to dynamic_interface.yaml

0 views
Skip to first unread message

Tess Strickland (Gerrit)

unread,
Apr 21, 2026, 7:24:00 AM (yesterday) Apr 21
to Alexander Markov, rev...@dartlang.org
Attention needed from Alexander Markov

Tess Strickland voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Alexander Markov
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • 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: Iec6ae553de3c6deb77e900577d9d3eea5c032b4c
Gerrit-Change-Number: 496342
Gerrit-PatchSet: 5
Gerrit-Owner: Tess Strickland <sstr...@google.com>
Gerrit-Reviewer: Alexander Markov <alexm...@google.com>
Gerrit-Reviewer: Tess Strickland <sstr...@google.com>
Gerrit-Attention: Alexander Markov <alexm...@google.com>
Gerrit-Comment-Date: Tue, 21 Apr 2026 11:23:56 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Alexander Markov (Gerrit)

unread,
Apr 21, 2026, 10:49:35 AM (yesterday) Apr 21
to Tess Strickland, dart-...@luci-project-accounts.iam.gserviceaccount.com, Alexander Markov, rev...@dartlang.org
Attention needed from Tess Strickland

Alexander Markov added 1 comment

File utils/dynamic_module_runner/dynamic_interface.yaml
Line 46, Patchset 6 (Latest): # Private members of `dart:ffi` and its classes used by the FFI transformer.
Alexander Markov . unresolved

We should not expect users to add our private implementation methods to the dynamic interface (they may not know about them and they can be changed without notice).

Instead, we have pragmas (`dyn-module:language-impl:callable`, `dyn-module:language-impl:extendable`, `dyn-module:language-impl:can-be-overridden`) which can be used to add certain classes and members from core library to the dynamic interface implicitly, if dynamic interface is specified.

Annotating with these pragmas have 2 downsides: size increase (incurred by all apps with dynamic interface, we can measure the impact) and a potential breach in the specified API surface - currently dynamic module validation guarantees that dynamic modules are not allowed to use dangerous dart:ffi APIs if they are not specified in the dynamic interface. This latter is probably a less of an issue for private APIs, which are not accessible directly anyway, but we should be careful to not expose potentially unsafe APIs.

If current dyn-module:language-impl:* pragmas would not work well for this case, then we should think about extending them or providing another mechanism.

Open in Gerrit

Related details

Attention is currently required from:
  • Tess Strickland
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • 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: Iec6ae553de3c6deb77e900577d9d3eea5c032b4c
Gerrit-Change-Number: 496342
Gerrit-PatchSet: 6
Gerrit-Owner: Tess Strickland <sstr...@google.com>
Gerrit-Reviewer: Alexander Markov <alexm...@google.com>
Gerrit-Reviewer: Tess Strickland <sstr...@google.com>
Gerrit-Attention: Tess Strickland <sstr...@google.com>
Gerrit-Comment-Date: Tue, 21 Apr 2026 14:49:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Tess Strickland (Gerrit)

unread,
8:31 AM (3 hours ago) 8:31 AM
to dart-...@luci-project-accounts.iam.gserviceaccount.com, Alexander Markov, rev...@dartlang.org
Attention needed from Alexander Markov

Tess Strickland added 1 comment

File utils/dynamic_module_runner/dynamic_interface.yaml
Line 46, Patchset 6 (Latest): # Private members of `dart:ffi` and its classes used by the FFI transformer.
Alexander Markov . unresolved

We should not expect users to add our private implementation methods to the dynamic interface (they may not know about them and they can be changed without notice).

Instead, we have pragmas (`dyn-module:language-impl:callable`, `dyn-module:language-impl:extendable`, `dyn-module:language-impl:can-be-overridden`) which can be used to add certain classes and members from core library to the dynamic interface implicitly, if dynamic interface is specified.

Annotating with these pragmas have 2 downsides: size increase (incurred by all apps with dynamic interface, we can measure the impact) and a potential breach in the specified API surface - currently dynamic module validation guarantees that dynamic modules are not allowed to use dangerous dart:ffi APIs if they are not specified in the dynamic interface. This latter is probably a less of an issue for private APIs, which are not accessible directly anyway, but we should be careful to not expose potentially unsafe APIs.

If current dyn-module:language-impl:* pragmas would not work well for this case, then we should think about extending them or providing another mechanism.

Tess Strickland

Yeah, hmm. Perhaps there should be something akin to the existing pragmas, but conditional on either the enclosing class and/or library being properly annotated, and if it isn't, then they aren't. That is, something like @pragma('dyn-module:language-impl:callable-with-enclosing') or something, I'm not sure of a pithy way of saying it that doesn't end up with a really long pragma name.

Or even make it more general, specifying the dependency explicitly, e.g. `@pragma('dyn-module:language-impl:callable-with-library', 'dart:ffi')` or something similar, to say something like "if the library 'dart:ffi' is annotated as callable, then this method should be callable, and if it isn't, this method isn't".

Any thoughts?

Open in Gerrit

Related details

Attention is currently required from:
  • Alexander Markov
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • 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: Iec6ae553de3c6deb77e900577d9d3eea5c032b4c
Gerrit-Change-Number: 496342
Gerrit-PatchSet: 6
Gerrit-Owner: Tess Strickland <sstr...@google.com>
Gerrit-Reviewer: Alexander Markov <alexm...@google.com>
Gerrit-Reviewer: Tess Strickland <sstr...@google.com>
Gerrit-Attention: Alexander Markov <alexm...@google.com>
Gerrit-Comment-Date: Wed, 22 Apr 2026 12:31:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Alexander Markov <alexm...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages