Commit Graph

8 Commits

Author SHA1 Message Date
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
Alexander Markov 3d8829fad2 Add dart2bytecode snapshot and VM/AOT dynamic modules test configurations
Change-Id: I84f8dbc174dbac5a11ca84e248c7aecb3759aaad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380283
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-08-15 15:28:25 +00:00
Alexander Markov 531a4c8f62 Expose experimental dynamic modules API through package:dynamic_modules
Change-Id: I14963de5f6face564276955d21d63f4b038cf990
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378722
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-08-12 17:56:29 +00:00