[M] Change in dart/sdk[main]: [dart2bytecode] Add test for prefixed duplicate libraries

0 views
Skip to first unread message

Sigmund Cherem (Gerrit)

unread,
Feb 13, 2026, 11:44:21 AM (3 days ago) Feb 13
to Ivan Inozemtsev, Sigmund Cherem, Commit Queue, rev...@dartlang.org
Attention needed from Ivan Inozemtsev

Sigmund Cherem voted and added 2 comments

Votes added by Sigmund Cherem

Code-Review+1

2 comments

File pkg/dynamic_modules/test/data/duplicate_library_prefixed/main.dart
Line 11, Patchset 4 (Latest): await helper.load('entry1.dart');
Sigmund Cherem . unresolved

since the value you are creating in both entry1 and entry2 is a constant, it will also show one of the nuances of doing import rewrites: the two constants are no longer the same, since each `common.dart` copy is unique.

Consider adding an expectation check here about that? For example:
```
final a1 = await.load('entry1.dart');
final a2 = await.load('entry2.dart');
Expect.notEquals(a1, a2);
Expect.notEquals(a1.runtimeType, a2.runtimeType);
helper.done();
```

File pkg/dynamic_modules/test/runner/vm.dart
Line 206, Patchset 4 (Latest): if (test.name.endsWith('_prefixed'))
Sigmund Cherem . unresolved

(optional) now that we have this, I'm torn about whether to still pass a prefix all the time. It is not harmful, so I guess it's OK, but may be confusing.

The alternative would be to move the flag under this condition too:
```
if (test.name.endsWith('_prefixed'))
...[
'--prefix-library-uris',
name
],
```
Open in Gerrit

Related details

Attention is currently required from:
  • Ivan Inozemtsev
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • 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: Ide29de6cb04bdb7f85386892fd5c909300725cc6
Gerrit-Change-Number: 480260
Gerrit-PatchSet: 4
Gerrit-Owner: Ivan Inozemtsev <iinoz...@google.com>
Gerrit-Reviewer: Ivan Inozemtsev <iinoz...@google.com>
Gerrit-Reviewer: Sigmund Cherem <sig...@google.com>
Gerrit-Attention: Ivan Inozemtsev <iinoz...@google.com>
Gerrit-Comment-Date: Fri, 13 Feb 2026 16:44:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Ivan Inozemtsev (Gerrit)

unread,
9:17 AM (7 hours ago) 9:17 AM
to Sigmund Cherem, Commit Queue, rev...@dartlang.org

Ivan Inozemtsev added 2 comments

File pkg/dynamic_modules/test/data/duplicate_library_prefixed/main.dart
Line 11, Patchset 4: await helper.load('entry1.dart');
Sigmund Cherem . resolved

since the value you are creating in both entry1 and entry2 is a constant, it will also show one of the nuances of doing import rewrites: the two constants are no longer the same, since each `common.dart` copy is unique.

Consider adding an expectation check here about that? For example:
```
final a1 = await.load('entry1.dart');
final a2 = await.load('entry2.dart');
Expect.notEquals(a1, a2);
Expect.notEquals(a1.runtimeType, a2.runtimeType);
helper.done();
```

Ivan Inozemtsev

Great suggestion! Done.

File pkg/dynamic_modules/test/runner/vm.dart
Line 206, Patchset 4: if (test.name.endsWith('_prefixed'))
Sigmund Cherem . resolved

(optional) now that we have this, I'm torn about whether to still pass a prefix all the time. It is not harmful, so I guess it's OK, but may be confusing.

The alternative would be to move the flag under this condition too:
```
if (test.name.endsWith('_prefixed'))
...[
'--prefix-library-uris',
name
],
```
Ivan Inozemtsev

I think "constant" prefixing is still beneficial to check that uri rewriting works correctly, but I've changed this to make args closer to each other

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • 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: Ide29de6cb04bdb7f85386892fd5c909300725cc6
Gerrit-Change-Number: 480260
Gerrit-PatchSet: 5
Gerrit-Owner: Ivan Inozemtsev <iinoz...@google.com>
Gerrit-Reviewer: Ivan Inozemtsev <iinoz...@google.com>
Gerrit-Reviewer: Sigmund Cherem <sig...@google.com>
Gerrit-Comment-Date: Mon, 16 Feb 2026 14:17:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Sigmund Cherem <sig...@google.com>
satisfied_requirement
open
diffy

Ivan Inozemtsev (Gerrit)

unread,
9:57 AM (6 hours ago) 9:57 AM
to Sigmund Cherem, Commit Queue, rev...@dartlang.org

Ivan Inozemtsev voted Commit-Queue+2

Commit-Queue+2
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • 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: Ide29de6cb04bdb7f85386892fd5c909300725cc6
Gerrit-Change-Number: 480260
Gerrit-PatchSet: 5
Gerrit-Owner: Ivan Inozemtsev <iinoz...@google.com>
Gerrit-Reviewer: Ivan Inozemtsev <iinoz...@google.com>
Gerrit-Reviewer: Sigmund Cherem <sig...@google.com>
Gerrit-Comment-Date: Mon, 16 Feb 2026 14:57:08 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Commit Queue (Gerrit)

unread,
9:57 AM (6 hours ago) 9:57 AM
to Ivan Inozemtsev, Sigmund Cherem, rev...@dartlang.org

Commit Queue submitted the change with unreviewed changes

Unreviewed changes

4 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: pkg/dynamic_modules/test/data/duplicate_library_prefixed/main.dart
Insertions: 5, Deletions: 2.

The diff is too large to show. Please review the diff.
```
```
The name of the file: pkg/dynamic_modules/test/runner/vm.dart
Insertions: 9, Deletions: 5.

The diff is too large to show. Please review the diff.
```

Change information

Commit message:
[dart2bytecode] Add test for prefixed duplicate libraries
Change-Id: Ide29de6cb04bdb7f85386892fd5c909300725cc6
Reviewed-by: Sigmund Cherem <sig...@google.com>
Commit-Queue: Ivan Inozemtsev <iinoz...@google.com>
Files:
  • A pkg/dynamic_modules/test/data/duplicate_library_prefixed/dynamic_interface.yaml
  • A pkg/dynamic_modules/test/data/duplicate_library_prefixed/main.dart
  • A pkg/dynamic_modules/test/data/duplicate_library_prefixed/modules/common.dart
  • A pkg/dynamic_modules/test/data/duplicate_library_prefixed/modules/entry1.dart
  • A pkg/dynamic_modules/test/data/duplicate_library_prefixed/modules/entry2.dart
  • M pkg/dynamic_modules/test/runner/vm.dart
Change size: M
Delta: 6 files changed, 57 insertions(+), 2 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Sigmund Cherem
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: Ide29de6cb04bdb7f85386892fd5c909300725cc6
Gerrit-Change-Number: 480260
Gerrit-PatchSet: 6
Gerrit-Owner: Ivan Inozemtsev <iinoz...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages