Commit Graph

22 Commits

Author SHA1 Message Date
Nate Biggs 5de2352091 [dart2wasm] Fix URI resolution for wasm compiled on windows.
Reverts the change applied to `option.dart` here:
https://dart-review.googlesource.com/c/sdk/+/397721/63/pkg/dart2wasm/lib/option.dart

Fixes: https://github.com/dart-lang/sdk/issues/60126
Change-Id: I13629f79fd2b6d8990f2c32da0c5aa0a7d7f8046
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409781
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Nate Biggs <natebiggs@google.com>
Reviewed-by: Morgan :) <davidmorgan@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2025-02-14 00:20:18 -08:00
Nate Biggs a4a4ca8a41 [dart2wasm] Dynamic modules
Missing from this implementation:
- Closure/dynamic calls with differing signatures
- Overrides with extra optional parameters
- Records with same shape defined in different dynamic modules
- Avoiding running TFA on dynamic module.
- Recompilation of only updateable functions from main module.
- Persist wasm def types from main module.

Testing is currently done locally via the dynamic_modules package test suite:
dart pkg/dynamic_modules/test/runner/main.dart --runtime=dart2wasm

Immediately after this lands we can introduce a new step to one of the wasm test matrix configurations that runs the above test suite (the VM has a similar configuration).

Change-Id: I3386d84be11b773842d45f4268a62a54c47e352b
Tested: Tested via new tests in dynamic_modules package. Tests run locally but will add to existing config.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397721
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2025-02-11 13:59:46 -08:00
Nate Biggs 92ef752810 [dynamic-modules] Add pragma annotating implicitly extendable types.
All supertypes of classes marked as "dyn-module:extendable" are technically also extendable in dynamic modules since subtyping is transitive.

Also skip marking 'final' classes as dynamic module extendable.

Change-Id: I124eae56b78b98aba8712158fda87bbc8e652ed3
Tested: Ran tests for dynamic interface annotator.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403960
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2025-01-09 14:42:41 -08:00
Nate Biggs d0f34d918f [dynamic_modules] Fix multiple_classes/dynamic_interfaces.yaml for vm.
Bug: https://github.com/dart-lang/sdk/issues/59735
Change-Id: Ie9656f257e59ad8b24dba74376a54fe9d338868b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401281
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-12-17 08:59:28 -08:00
Nate Biggs e303f5435b Add dart2wasm support to pkg/dynamic_modules.
Also introduce some tests that include some potential pitfalls in the  wasm implementation.

Change-Id: I904930db992d45414b6e214b68ca542ca29419e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400901
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2024-12-16 18:37:32 -08:00
Sigmund Cherem 579de4e2d3 [dyn-modules] fix ddc test runner in windows
Windows paths of the form `c:` are parsed incorrectly by the
subprocesses actions when reading the package path. This change ensures
they are encoded as `file:` URIs instead to ensure they are parsed
properly.

Fixes https://github.com/dart-lang/sdk/issues/56725

TESTED=dynamic_modules_suite

Change-Id: Iadcfc8bf08b8845620dcf2be5fafadb975a8edc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397180
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-12-02 23:15:39 +00:00
Sigmund Cherem d58b002b46 [dyn_modules] add more test cases.
This includes:
* tests extending non-base class
* tests for applying mixins
* generalization of top-level test to include methods and gettters
* tests for annotating entities indirectly (reexport, hidden
  implementation)
* test for using core libraries and core language features.

Change-Id: I2ff928c15794547368d2871f5b982685593ef662
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396105
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-11-21 21:53:03 +00:00
asiva 8b2b6b2440 Reland ""[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory""
This reverts commit 74c5aa3a7a.

Reason for revert: Fix golem breakage by not changing the script dart_precompiled_runtime2

TEST=ci

Original change's description:
> Revert ""[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory""
>
> This reverts commit f81a402aa1.
>
> Reason for revert: golem benchmarks are failing to run
>
> TEST=ci
>
> Original change's description:
> > "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
> >
> > Fixed golem breakage by temporarily copying dartaotruntime to dart_precompiled_runtime
> >
> > This reverts commit 75e6a748f7.
> >
> > TEST=ci
> >

Change-Id: I9efe40643c59bc617f6fb484b89b038deaffbb93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393941
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-11-08 04:36:23 +00:00
Alexander Markov a36dbc78ff [vm, dynamic_modules] Support loading of dynamic modules from unmodifiable view
TEST=pkg/dynamic_modules/test/data/load_unmodifiable_view
Fixes https://github.com/dart-lang/sdk/issues/57039

Change-Id: I5b04acd458da437b6ce4cf4b36e0c60c3d3458aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393920
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-11-06 20:23:58 +00:00
Siva Annamalai 74c5aa3a7a Revert ""[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory""
This reverts commit f81a402aa1.

Reason for revert: golem benchmarks are failing to run

TEST=ci

Original change's description:
> "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
>
> Fixed golem breakage by temporarily copying dartaotruntime to dart_precompiled_runtime
>
> This reverts commit 75e6a748f7.
>
> TEST=ci
>
> Original change's description:
> > Revert "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
> >
> > This reverts commit 1b331d05c2.
> >
> > Reason for revert: golem builds are failing
> >
> > Original change's description:
> > > [SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory
> > >
> > > TEST=ci
> > >
>
> Change-Id: Id0f383eabb496c06c0acebc639c8e3b056ba82d0
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393781
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

Change-Id: Iec494940412aa31dbefdc5280e35ae99e8cecb26
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393764
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-11-06 05:37:46 +00:00
asiva f81a402aa1 "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
Fixed golem breakage by temporarily copying dartaotruntime to dart_precompiled_runtime

This reverts commit 75e6a748f7.

TEST=ci

Original change's description:
> Revert "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
>
> This reverts commit 1b331d05c2.
>
> Reason for revert: golem builds are failing
>
> Original change's description:
> > [SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory
> >
> > TEST=ci
> >

Change-Id: Id0f383eabb496c06c0acebc639c8e3b056ba82d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393781
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-11-06 03:10:31 +00:00
Siva Annamalai 75e6a748f7 Revert "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
This reverts commit 1b331d05c2.

Reason for revert: golem builds are failing

Original change's description:
> [SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory
>
> TEST=ci
>
> Change-Id: I96ed52994e0d955300c18026032e68003504666d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389760
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>

Change-Id: I5dc14973f4ee4e577b2c996839d5e497c97fb440
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393761
Commit-Queue: Siva Annamalai <asiva@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-11-05 21:58:09 +00:00
asiva 1b331d05c2 [SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory
TEST=ci

Change-Id: I96ed52994e0d955300c18026032e68003504666d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389760
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2024-11-05 20:39:15 +00:00
Alexander Markov c409e77d1e Validation of dynamic modules
TEST=pkg/front_end/testcases/general/dynamic_modules


Change-Id: I591d029ed163961f5ece859233874f828d63c857
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388442
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-10-24 16:51:53 +00:00
asiva da14b16ef3 [Web/DDC] - Convert the kernel_worker and dartdevc snapshots to an AOT snapshot
Converts kernel_worker.dart.snapshot and dartdevc.dart.snapshot to
 AOT snapshots. Fixes tests and paths in the code accordingly.

TESTS=ci

Change-Id: Ib99b2a3343e23252c3a6b5295b0d20f0f486aede
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381388
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-10-22 17:39:27 +00:00
Lasse R.H. Nielsen f8086c81ae Collect all test-related files in package:expect.
Collects files from `package:async_helper` and `tests/language`
that are generally useful, so that all test-related helpers are
in `package:expect`.

Moves the two libraries from `package:async_helper` into `package:expect`,
and the `tests/language/static_type_helper.dart` file too.

Deprecates `async_minitest.dart`, to follow `minitest.dart`,
expecting the Flutter use of it to have been fixed to not break
on deprecation (I believe Flutter no longer breaks builds on deprecations at all).

Patch 1 is the actual change.
Patch 2+4+8 is changing all existing references to the files.
Patch 6 ignores deprecation in files still using `async_minitest.dart`.

3+5+7+9 are updating this text to make the numbers match.
Then it's just test-expectations and small tweaks from there.

Change-Id: I1b665135b5fef9b9a0c3b340ffe9daf874d0174c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373120
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2024-10-11 16:53:52 +00:00
Sigmund Cherem cb4aedd2ea [ddc] fix windows tests for dynamic modules.
Using toFilePath produces an absolute path with `c:` some of our snapshots (like kenrel_worker) don't know how to parse.

Using the URI string representation includes the scheme and addresses the issues (eg. example failure from before  https://dart-ci.appspot.com/log/ddc-win-chrome/ddc-win-chrome/6835/dynamic_modules_suite/shared_const)

Change-Id: Id71faf7745e5843cff6fa06fd198576b7560acf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385301
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-09-13 17:08:54 +00:00
Sigmund Cherem fd3cb424e2 [dynamic_modules] Run dynamic module tests in CQ
* Adds support to emit log records for test outcomes and failure logs
* Adds steps to the test_matrix

Change-Id: Ibabf0410a0304aae446387a0d3ca147488f56df3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383929
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-09-12 15:36:40 +00:00
Alexander Markov ad94d963ed [dart2bytecode] Remove the requirement for dynamic module to have 'main'
TEST=DART_CONFIGURATION=DebugX64 out/DebugX64/dart-sdk/bin/dart pkg/dynamic_modules/test/runner/main.dart -r aot --verbose

Change-Id: I8647822982b051b4846dfe4ed7e51a19ef466cf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384311
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-09-10 14:37:00 +00:00
Sigmund Cherem 25bc18c3b3 Add support for AOT in dynamic_modules tests
* Introduce steps to execute tests in AOT (using gen-kernel,
  dart2bytecode, and aot compiler)
* Accept using filesystem-scheme to provide dynamic_interfaces.yaml input
* Accept empty dynamic_interfaces.yaml
* Make temporary test changes to get them running:
   * include core types in dynamic_interfaces that we may want to have
     by default
   * rename entrypoint to `main`

Most existing test pass, the two tests that validate that a library
cannot be defined twice fail (expectation is to throw, bytecode ignores
the second definition).

To run locally:
```
./tool/build.py -m release --dart-dynamic-modules create_sdk
DART_CONFIGURATION=ReleaseX64 out/ReleaseX64/dart-sdk/bin/dart pkg/dynamic_modules/test/runner/main.dart -r aot
```

Tested: CL adds additional test coverage, currently ran manually, integrated in CI in child CL
Change-Id: I4868e765855d9951bff160c18b846aa628f5e0b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383928
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-09-10 04:09:21 +00:00
Sigmund Cherem 9c91f31c10 DDC implementation of experimental dynamic modules.
In particular,

* Provides a DDC implementation for dynamic modules, where the download
  and instantiation of the module is delegated to the embedder of the
  program.

* Exposes an embedding API to allow embedders to define the loading logic.

* Adds a flag to compile code as a dynamic module. This includes
  generating an entrypoint trampoline and checks to validate that a
  dynamic module doesn't stump over previously defined libraries.

* Adds test coverage for DDC under `pkg/dynamic_modules/test/`.

Test suite can be run by executing:
```
DART_CONFIGURATION=ReleaseX64 out/ReleaseX64/dart-sdk/bin/dart \
    pkg/dynamic_modules/test/runner/main.dart -t ddc
```

Once we provide integration of test configuration results to that test
runner, we will add it as part of the test matrix.


Change-Id: I626b5fefe9a27546cc6d1630d17e812544a711c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379748
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-09-10 00:55:02 +00:00
Sigmund Cherem 99cff54882 Add test framework for experimental dynamic modules API.
This CL introduces a test runner and test cases under
`pkg/dynamic_modules/test/`. These tests are end-to-end tests that
specifically target the dynamic modules semantics. This includes:
* semantics expecations on the program evolutions (e.g. libraries
  defined only once)
* individual cases around the dynamic interface (callable, extensible,
  overrides).

We should continue to add more test as we discover coner cases worth validating
(e.g. mixins, constants, etc).

The suite is not yet integrated to the test matrix, my plan is to do so
after we have some initial targets set up.

Change-Id: I2a63946c36d99baacb6fb7edc01c4ef377ce20b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379921
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-09-05 22:24:25 +00:00