This new flag will run the CFE to create a kernel and then run a series of checks over the resulting kernel to look for errors that could block a wasm migration.
The compiler will then exit before actually starting the wasm compilation process. This means no output file will be emitted so callers must be aware of this.
This first CL is not meant to cover every check we could add here. It adds some initial checks and we can expand on this to include more in follow-up changes.
One of the checks implemented here is also provided by a lint. While ideally we would share code between lints and these checks, the delta in the CFE vs analyzer model makes that infeasible today.
Sample output:
```
Found incompatibilities with WebAssembly.
package:dryrun/test.dart 5:15 - Cannot test a JS value against String (3)
package:dryrun/test.dart 6:7 - JS interop class 'B' cannot extend Dart class 'A'. (2)
```
Bug: https://github.com/dart-lang/sdk/issues/60050
Change-Id: Ib2c8e3501cc42d57b86ebaa749359ce6c5dba974
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/437960
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Without their own pubspecs, they belong to `_` project from the root
`pubspec.yaml`. As a result, once we bump the SDK version, these
scripts cannot be executed with the checked in sdk.
Note: when we bump the SDK version we also must bump the version in
the root pubspec, otherwise unreleased language experiments break.
Change-Id: Ie2ec35865a5966d6801de832a4b6ad312a24d277
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/436901
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
The name has always been annoying because it did not add strong typing. And now there aren't variants of the VM platform to distinguish.
Leave a copy at the old name to not immediately break illegal uses.
TEST=ci
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,flutter-frontend-try,flutter-linux-try
Change-Id: Ie76fa7f16940aa1ba8d582eb5197f0ae55dc8938
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429828
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Refactors the hot reload test suite to support non-FE server based hot reload. Similar to DartPad it uses a DDC process running in '--persistent_worker' mode and sends bazel requests for each reload.
I call this "stateless" mode because the compilation process itself is not maintaining any state. The necessary metadata is passed from one compilation to the other via a delta dill. This differs from the "stateful" mode where the FE server persists a kernel AST in memory from one compilation to the next.
Disregarding the browsers there are effectively 3 run modes now:
- web stateful
- web stateless (new)
- vm stateful
One key difference between the "stateless" and "stateful" modes is the output format of the JS files. In stateful mode DDC emits a file per library being re-compiled. In stateless mode DDC is emitting a single file with all the libraries.
DartPad's workflow is slightly simpler than what's seen in the stateless mode here. It only supports editing a single library so we skip processing any metadata. To simulate this I've added the special 'main_only' which passes a single library for each reload generation. I've verified that this would fail if not for the change recently made to ddc_module_loader.js.
Change-Id: If05da6dbeded4dd20e9e6d9dfaed52151541a19b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434340
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
The previous three scripts had some redundancies:
* Both the flutter/flutter analyzing script and the flutter/packages
analyzing script checked out flutter/flutter. Combining them saves
several minutes.
* The script that analyzed flutter/engine was pointing to the old
engine repo, which was archived months ago. In pointing the script
to the new sources at flutter/flutter, this would introduce another
instance of cloning flutter/flutter. Combining this with the other
scripts saves several minutes.
The only other little changes to the code are the introduction of
more echo commands, more `pushd`/`popd` vs `cd`, and isolating the
three tasks into functions for readability.
Change-Id: I08414d824c25075a8810b1aa0cc299c64328abbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432881
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Use a combination of gen_snapshot's new ability to generate dylibs directly and the copy of llvm in buildtools to avoid using XCode, which is not available in shards.
Add definitions for debug builders now that they can complete without timing out.
Cq-Include-Trybots: luci.dart.try:vm-aot-mac-product-arm64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try
Change-Id: I79924128f11aafab4cd74ea6e9ab5848c64557da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431700
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Currently, the configuration code only has a boolean option, 'use-elf'
for specifying the output format for gen_snapshot. If false, then the
output format is assumed to be assembly.
Add a new GenSnapshotFormat enum and replace the old 'use-elf' option
with a new 'gen-snapshot-format' option. The new enum has two getters:
* snapshotType returns the appropriate string to pass to gen_snapshot
via the '--snapshot-type' option.
* fileOption returns the name of the option used to specify the
output path for the given format.
In addition, make it so the Configuration only has a non-null
genSnapshotFormat field if the compiler is Compiler.dartkp to avoid
spurious differences in Configurations that are created with different
GenSnapshotFormat values when the configurations in question don't
actually call gen_snapshot.
TEST=pkg/smith/test/configuration_test.dart (and the CI in general)
Change-Id: I7f17dc8d3a1bb6d4bf57750bc5ef4a16b8a78c11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429980
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
This change further prepares for the removal of Observatory from the
shipped Dart SDK by creating a fork to be used by the remaining
Observatory users.
This is basically a straight copy of the contents from
runtime/observatory with the exception of two new scripts:
- `bin/observatory.dart`, a utility to launch Observatory
- `bin/activate.dart`, which globally activates `bin/observatory.dart`
as `observatory`
This change also updates the presubmits to ensure that
`runtime/observatory` is effectively placed in read-only mode to prevent
any divergences with the fork.
Work towards https://github.com/dart-lang/sdk/issues/50233
Change-Id: Iff3a7512058f36afa2a96d45d94a1dff424401d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429800
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This PR enables native assets on the main and dev channel by default,
and make native assets available on the beta channel.
This PR removes the flag from invocations.
The helper packages (`package:hooks` and `package:code_assets`) will
stay 0.x for now, until the SDK constraint can be bumped to a beta
release and we're happy with the Dart API.
`dart build` is also made available as preview (without a flag on
the main, dev, and beta channels). We're still finalizing the spec for
this command. (https://github.com/dart-lang/sdk/issues/60730)
`dart test` will need https://github.com/dart-lang/test/pull/2501.
This means users will need to update their `package:test` dependency.
This PR refactors the way that invalid `package_config.json`s are
handled: they are now loaded in the dartdev commands and handled there.
Bug: https://github.com/dart-lang/sdk/issues/50565
Project: https://github.com/orgs/dart-lang/projects/99/
Change-Id: I7db9ff6d7196750cab9379a4605c6bbf89a974d7
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-win-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429920
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Switch build to use Clang. This somewhat degrades FFI testing, but reduces build time by roughly half or one hour.
Cq-Include-Trybots: luci.dart.try:pkg-win-release-arm64-try,vm-aot-win-debug-arm64-try,vm-aot-win-release-arm64-try,vm-win-debug-arm64-try,vm-win-release-arm64-try
Change-Id: Ie267942e99934312b228cfadcd6d5b8477f855c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429421
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Add builder definitions for ASAN on Mac and Windows.
Combine reload and reload rollback into one builder.
Change-Id: If464f82d1d8c0560f4e7f1e341f59e5f29301a30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427303
Reviewed-by: Alexander Aprelev <aam@google.com>
This is a reland of commit 7ae1d75869
TEST=manual, no watchOS SDK on bots yet.
Original change's description:
> watchOS target os
>
> - add support for --os=watchos | --os=watchos_simulator
> - do not depend on perfetto if dart_support_perfetto is false
> - change the default value for dart_support_perfetto to !is_watchos
>
> To minimize changes and to avoid modifying third-party zlib BUILD file, is_watchos implies is_ios for now.
>
> TEST=manual, no watchOS SDK on bots yet.
>
> Cq-Include-Trybots: luci.dart.try:vm-mac-debug-arm64-try,vm-mac-release-arm64-try
> Change-Id: If2130068ef546162a07a9ba53f94b11ff25fb565
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415021
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
Cq-Include-Trybots: luci.dart.try:vm-mac-debug-arm64-try,vm-mac-release-arm64-try
Change-Id: I2b50f7eb4da173627aeb4833b88a08712b278d9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425523
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
`package:native_assets_cli` has been split up and
`package:native_assets_builder` has been renamed.
Change-Id: Ic9d5c21bb3c7ecf7924fdee6b4281153ad37fac5
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-win-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425504
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>