Commit graph

533 commits

Author SHA1 Message Date
Martin Kustermann e18c43a21e [dart2wasm] Add dart2wasm-asserts-* configurations
Our tests (including code in core libraries) are never run with
assertions enabled.

=> Add the necessary configuration support in test_matrix.json
=> We'll then add a new builder running one configuration with asserts.

Change-Id: Id1bc27ddf7d683846510af4711679ad14f0e4168
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370620
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-06-10 14:24:12 +00:00
Ryan Macnak 3da6b50905 [infra] Add configurations for ARM64 sanitizer testing.
Runs only the ffi test suite with no shards due to limited capacity. Runs JIT and AOT on the same builder to avoid building twice without RBE.

Change-Id: I1cebff950d89b3302169e9e4cdb68772cd8bf413
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365865
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-05-17 16:57:13 +00:00
Martin Kustermann 8fa0675a6d [dart2wasm] Make optimized builders run with --use-sdk (and therefore dart compile wasm)
This gives some more coverage for `dart compile wasm`

Change-Id: I62e7f9c6ecbdf80a1445c35d1733a7f89e6bcf54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366623
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-05-17 13:08:31 +00:00
Devon Carew 2837647bea [wiki] move the https://github.com/dart-lang/sdk/wiki to the docs/ dir
Change-Id: I28db796fadcc111d97d3589bf3988ea0bbb8e18a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366682
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-05-16 18:19:40 +00:00
Martin Kustermann 09361f0f16 [dart2wasm] Make test runner use pkg/dart2wasm/tool/run_benchmark (just as golem does)
* We make the test runner use the same runner script as golem uses
* We make the runner script work for different JS shells

=> The runner script encapsulates how to invoke different JS shells, the
   commandline format, environment variables, ...

=> Golem can then continue to use same runner script, but also with new
   shells

Change-Id: Iad63fe6c0563cfeac28cbfb25eb41ee1b7c13f3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365740
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-05-08 11:00:33 +00:00
Konstantin Shcheglov 33f0388776 Test. Support for optinal 'deferred as' to find URIs.
Change-Id: I923b65931de5d7ac56bea0b356474113ebb9a778
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364627
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-05-01 15:45:58 +00:00
Ryan Macnak d42a4b7219 [test] Run FFI tests on Fuchsia ARM64.
- Compile tests to kernel and use that instead of source for the Fuchsia test package.
 - Skip multitests instead of the running them and approving the failures.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/38752
Change-Id: Idd9bef0f6026c6d882712eb1083e88433bb53b13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333121
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-04-30 17:37:45 +00:00
Konstantin Shcheglov 5b2ea0c7a2 Test. Check path in StaticError.matchLocation()
This was causing issues with tests when there are two expected
errors at the same lines, in different files. The first expected
error would (and consume) both actual errors. So, the second expected
error would say that is unsatisfied.

Change-Id: I0bd7b56d070732c83d1d87f3dcf8ba20a693028c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364604
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-04-27 18:07:53 +00:00
Ryan Macnak 1ff4f72ebc Mark file system event tests as slow.
Restore timeout for windows-arm64, which did not get faster.

Change-Id: I9f032c25fc69454929348f0589d35200a4728142
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364625
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-04-26 23:46:17 +00:00
Ryan Macnak f02007839d [test_runner] Reduce timeouts.
We've roughly doubled bot speeds; half timeouts to provide pressure against this simply getting filled with slower tests.

Change-Id: I812da7adc6c08e6d484732c2558e0d3f63b2694a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364385
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-04-26 21:39:34 +00:00
William Hesse c10ecb8fe5 [test] Convert most lib/mirrors multitests to static error tests
Change-Id: I4f3b728a94291bf0a31a5f38af9d8b877a9900af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363702
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2024-04-23 23:33:48 +00:00
Nicholas Shahan 6c2819d8ba [ddc] Fix runtime flags in d8 test runner
When running in d8 the runtime flags need to be set by loading an
SDK with the same name passed for the application that gets used
when the application is started. If not the module system will
create an additional instance of the SDK module. This meant the
runtime flags were being set in one instance while the application
read them from another.

The same issue was present in the ddb script and this change fixes
it there as well.

Add the `--interop-null-assertions` option to the ddb script that uses
the runtime flag to enable null checks on non-static JavaScript
interop APIs.

Issue: https://github.com/dart-lang/sdk/issues/55378
Change-Id: Id8c31383fa601f5953e2cc41021746aa918186b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361133
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-04-06 00:45:37 +00:00
William Hesse 9fcd15941d [test] Add detailed error message to test_runner's results loading
Scripts that load logs and results produced by package test_runner
will print more error details when a results file does not contain
a valid JSON map on each line.

Change-Id: Ia2789dd5c0bf565eb74f6960ec8783201ff9f0ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359220
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2024-04-05 09:16:25 +00:00
Johnni Winther 63d2008355 [cfe] Make kernel AST and CompilerOptions use strong mode by default
TEST=existing

Change-Id: I8d8bc59dc742a7499338ea2d23a611696492603c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359222
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2024-04-05 07:45:08 +00:00
Nicholas Shahan 5532568778 [ddc] Add configuration to compile with asserts
- Assertions are enabled in the compiler itself. DDC already enables
  assertions in the test code by default. 
- Runs tests in d8.

Change-Id: Ibdf285d9ab182c3859f4724b4c0740579d6d2377
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349361
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2024-04-04 14:40:30 +00:00
Nicholas Shahan 2379cdc080 [ddc] Enforce more null safety on js interop
- Add a runtime flag to enable checks on non-nullable APIs that
  return values from non-static JavaScript interop.
- Call a new helper method at the call site when these APIs are
  detected to perform the null check.
- Add test file for the cases we can detect and enforce.

NOTE: This does not make non-static JavaScript interop sound.
This only adds more checks to enforce soundness with respect
to nullability in some cases. There are still holes that will
never be closed due to the permissive nature of this form of
JavaScript interop.

Change-Id: I2f88d1543a683fdc84d764e2b0eaafeb0ca73107
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358581
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-04-03 23:20:15 +00:00
David Morgan a3f8fb9578 [test_runner] Fix error parsing: paths do not contain newlines.
This stops over-matching which was causing paths to be incorrect when there were multiple errors, breaking the expectation updater.

R=srujzs@google.com

Change-Id: I357d0c96ed2d5bc3658d6cc2eb9ca82f86860818
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357700
Commit-Queue: Morgan :) <davidmorgan@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Auto-Submit: Morgan :) <davidmorgan@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2024-03-18 09:10:25 +00:00
Johnni Winther a0b6f1ef45 [test_runner] Avoid capture newline as path
The updates the static error parser for the CFE to avoid capturing
previous messages as part of the path for the subsequent error.

Change-Id: I131f14000a874ff9336244372b47a3913237c939
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357323
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-03-15 10:40:57 +00:00
Daco Harkes 6270a46469 [deps] Roll package:native_assets_builder
Manual roll of https://github.com/dart-lang/native/pull/946.

Change-Id: I6d4fd28f4174307024526dd73ff29b63e570bfd7
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-try,pkg-mac-release-try,pkg-win-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357623
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-03-14 18:06:13 +00:00
Jens Johansen ae019bda36 [test_runner] First batch test after compiler launch gets more timeout (v2)
This is a redo of https://dart-review.googlesource.com/c/sdk/+/332220
where extra timeout wasn't given to a new process after a timeout
actually occurred, which can lead to cascades of timeouts in unfortunate
circumstances.
The extra startup time is furthermore increased from 30 seconds to 60
seconds.

Change-Id: I7d052fc1e04b374d3a6d1d82370f8edc1143291e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357280
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2024-03-13 10:21:10 +00:00
Vyacheslav Egorov f694d3ea18 [infra] Undo accidental change in test runner
R=whesse@google.com

Change-Id: If496048ce4f4d9d16ea6f0f976958199b6e605c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357020
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2024-03-12 10:32:14 +00:00
Slava Egorov c2e9ceeb6b [vm/io] Cleanup long path handling on Windows
* Switch to `std::unique_ptr<wchar_t[]>` to represent a
dynamically strings instead of wrappers like
`StringRAII` and `Utf8ToWideScope`;
* Avoid back and forth conversion between UTF8 and UTF16:
convert to UTF16 first then work on that. This also simplifies
code - previously it tried to work with strings allocated in
different ways uniformly, which is actually unnecessary if
resulting string needs to be converted to UTF16 (and allocated
with `malloc`) anyway;
* Fix a bug in `File::CreateLink`: it was handling relative
links with long paths incorrectly. Change file_long_path_test
to cover this case and make it run on non-Windows systems as
well to ensure that all behavior that can match actually
matches.

TEST=ci

Change-Id: I1279aff1d2cdace5e2ce8633c2f7ea69a34fe41a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356680
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-03-12 08:29:36 +00:00
William Hesse dfe0457f84 [test] Remove buildbot progress reporter and step-name option
The buildbot progress reporter is no longer used by anything
in our CI setup. The step-name option was only used by this
progress reporter.

Bug: https://github.com/dart-lang/sdk/issues/33078
Change-Id: Ibbee189eb08c91c9306b349b3a09a781695f095b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356800
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2024-03-12 00:50:43 +00:00
David Morgan 261e16e822 [test_runner] Support static error test expectations in augmentation libraries.
R=eernst@google.com

Change-Id: I52fd157be6ba561f571170ce393d80820b2744dc
Bug: https://github.com/dart-lang/sdk/issues/44990
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356401
Reviewed-by: Erik Ernst <eernst@google.com>
Auto-Submit: Morgan :) <davidmorgan@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
2024-03-08 12:59:59 +00:00
David Morgan c2004efd47 [macros] Add macro build tests.
These are a new type of test that runs with the SDK under test against what
looks like an external package; they start by running "pub get" then run SDK
build commands to build the package, and check that macros applied correctly.

Add tests for various builds that already pass, plus one that doesn't:
cfe_sdk_cli_test fails because it was switched to run from an AOT snapshot
and that doesn't support macros yet.

Change-Id: Ic801cb61bd414d4876566452e01dd8c8203e9013
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353100
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
2024-03-06 12:31:37 +00:00
Ryan Macnak a07cf4202f [test_runner] Fix null assertion failure running on RISC-V.
Bug: https://github.com/dart-lang/sdk/issues/48545
Change-Id: Ic97dab268386423fd74adc0f0cef3ce361dc610e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350684
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-02-28 00:16:52 +00:00
David Morgan dd828b4be5 [test_runner] Fix expectations on Windows when there are import loops.
The checking for loops did not normalize the first entry, causing the
expectation to be read twice in case of a loop, and the test to fail.

Simplify a little by checking when adding to the "already seen" set.

R=brianwilkerson@google.com

Change-Id: I1862f98051fc5e4f867fdf0d9b1b0884b99610ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353681
Reviewed-by: William Hesse <whesse@google.com>
Auto-Submit: Morgan :) <davidmorgan@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2024-02-23 12:10:18 +00:00
Sergey G. Grekhov 3b52517bca [test] Add support of dart2wasm.status in co19 tests
Fixes: #54971

Change-Id: I033c8ba78e6cdcf26dce9cae8998308a595a37e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353262
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2024-02-21 14:03:23 +00:00
David Morgan cccde729eb [test_runner] Fix static_error_test on Windows.
The path separator in the expect makes it fail; shorten the path, there
is no need for a separator in the test case.

R=whesse@google.com

Change-Id: Ief6078828daa18e1bf552e62ea0d3d4dee70ec84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353400
Reviewed-by: Jonas Termansen <sortie@google.com>
Auto-Submit: Morgan :) <davidmorgan@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2024-02-21 09:46:42 +00:00
David Morgan 980cf725ff [test] Check all local files for error strings.
Based on abandoned change #264261.

Changes to that PR: compare and show file paths, improve part parsing, include analyzer expectations from other files as well as CFE expectations, update unit tests.

Add end to end tests. The simplest case "library_failure_test.dart" passes before this PR, all others require the change in this PR to pick up expectations in other files.
Change-Id: Ia71b78a8f0dced83f603309877132f261b47c5a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345541
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
2024-02-20 09:31:21 +00:00
Kallen Tu 7a82e8e995 [test_runner] Support new features in Requirements.
Support `checkedExplicitCasts`,`checkedImplicitDowncasts`, `checkedParameters`, `jsNumbers`, and `nativeNumbers`.

dart2js and DDC configs should support `jsNumbers`.
dart2js and dart2wasm (both optimized) do not support checked parameters nor implicit downcasts checks.
dart2wasm optimized does not support explicit cast checks.

This CL adds these features and makes sure certain configs are opting into these features.

Bug: https://github.com/dart-lang/sdk/issues/54798
Change-Id: If61d513569259317b1fb89c27d3fd97e3542697d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352103
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2024-02-14 19:55:51 +00:00
Nicholas Shahan 30a94fceaf Reland "[ddc] Fix running d8 with test.py"
This is a reland of commit 244f8cee87
with fixes for the file URIs passed on the command line.

Original change's description:
> [ddc] Fix running d8 with test.py
>
> - Add build targets to compile .dill outlines for common test 
>   dependencies using kernel_worker.dart.
> - Build ddc modules for common test dependencies and move amd versions
>   to a separate subdirectory.
>
> Change-Id: I126b5821f6aea00b753d83560c76f00c6c5edc61
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350081
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Nicholas Shahan <nshahan@google.com>

Change-Id: I5a77512984fda1d91c812f1e240e9c10609914f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351622
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-02-13 20:09:58 +00:00
Nicholas Shahan 08f0ffeb60 Revert "[ddc] Fix running d8 with test.py"
This reverts commit 244f8cee87.

Reason for revert: Breaks windows builds.

Original change's description:
> [ddc] Fix running d8 with test.py
>
> - Add build targets to compile .dill outlines for common test 
>   dependencies using kernel_worker.dart.
> - Build ddc modules for common test dependencies and move amd versions
>   to a separate subdirectory.
>
> Change-Id: I126b5821f6aea00b753d83560c76f00c6c5edc61
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350081
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Nicholas Shahan <nshahan@google.com>

Change-Id: Ic5a17edc323b298eb8d60c82c755c6929e2cacc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351520
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Nicholas Shahan <nshahan@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-02-09 18:25:56 +00:00
Nicholas Shahan 244f8cee87 [ddc] Fix running d8 with test.py
- Add build targets to compile .dill outlines for common test 
  dependencies using kernel_worker.dart.
- Build ddc modules for common test dependencies and move amd versions
  to a separate subdirectory.

Change-Id: I126b5821f6aea00b753d83560c76f00c6c5edc61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350081
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-02-09 00:47:02 +00:00
Nicholas Shahan 0dbeb2135e [test_runner] Rename host-checked to host-asserts
Cleanup this old naming scheme before adding new configs for DDC
that run with assertions enabled in the host compiler.

Change-Id: Icbdee694fac46b3a1d5bab7ee7411c8e9be8c4a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335385
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2024-02-08 22:01:09 +00:00
Martin Kustermann a46d59fe3b [dart2wasm] Allow --minify/--no-minify to override defaults from -O<level>
* Allow --minify/--no-minify to override defaults from -O<level>

* Remove the unused(!) --name-section option from pkg/dart2wasm/*
  => Stripping it only makes sense at the binaryen step

* Make pkg/dart2wasm/tool/compile_benchmark support -g/--no-minify
  => Only useful for dart2wasm developers

Issue https://github.com/dart-lang/sdk/issues/54675

Change-Id: I695e985897b212fc345dcfd776553a009723d3b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351121
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-02-08 16:46:19 +00:00
Kallen Tu a8b6f23906 [test_runner] Add readable-type-strings to requirements features.
Adds `readableTypeStrings` feature.
Configurations where `Type.toString` is expected to show the original type name and original names in function type named parameters will have this feature.

Exceptions are dart2js-prod, dart2js-minified, and vm-obfuscated configurations.

Change-Id: I5423bc31afd586733c6249519f030f7152ac4fc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349460
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2024-02-05 20:47:14 +00:00
MarkZ 91d22a7e40 [ddc] Renaming dart_library.js to ddc_module_loader.js
This also removes deprecated references to the DDC module system as the "legacy" module system.

This is part of an ongoing effort to deprecate the AMD module system: https://github.com/dart-lang/sdk/issues/52361

Change-Id: Ic32c6c6a0b7bf2c3bf0326be42cc9a88db8e303e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348183
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2024-01-30 19:43:49 +00:00
William Hesse 74672eca0a [dart2wasm] Fix jsc path in testing support for jsc
The CIPD download puts the platform-specific executable for jsc
(JavaScriptCore) directly in the third_party/jsc directory.

Follow-up to https://dart-review.googlesource.com/c/sdk/+/347283

Bug: b/322134579
Change-Id: I6af151de10e28fee06f6ba64a288f12859516151
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348642
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: William Hesse <whesse@google.com>
2024-01-26 13:31:00 +00:00
MarkZ 8edbcacfb0 [ddc] Removing some references to "legacy" DDC modules.
"DDC" is now the accepted name for the module system.

Change-Id: I655219ccc7cff7ff99b1311518ef6ed6e7d1b2a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348085
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-01-24 21:22:25 +00:00
Martin Kustermann 89060a64e9 [dart2wasm] Make dart compile wasm pass through -D & --minify flags to dart2wasm
This also fixes some code that was assuming the args parser returns
`Map<String, String>` for the `--define` multi-option, it's rather returning
a `List<String>`.

Forwarding these two flags will allow running some of our configurations
using `dart compile wasm` as opposed to
`pkg/dart2wasm/tool/compile_benchmark` (though the former is still
slower than the ladder).

Though since `dart compile wasm` is still a bit slower then the shell
script, we'll do that only for one configuration.

Issue https://github.com/dart-lang/sdk/issues/54675

Change-Id: I74e9edb2f635f48faade8d843857be2aa7c6066f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347903
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-01-24 14:38:41 +00:00
Martin Kustermann 6788b733f3 [dart2wasm] Make dart compile wasm use AOT-compiled dart2wasm via subprocess
This reduces time for `dart compile wasm` on a hello world in

* `--no-optimize` mode from 8.2 to 1.8 seconds (0.6 sec via [0])
* `--optimize` mode from 9.2 to 3 seconds (1.6 sec via [0])

[0] pkg/dart2wasm/tool/compile_benchmark

Issue https://github.com/dart-lang/sdk/issues/54675

Change-Id: I47093e747f343b542bc7faa34e102c62657c7b81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347902
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-01-24 13:20:15 +00:00
Martin Kustermann 3a314331a7 [dart2wasm] Add support for testing dart2wasm with JSC
JSC only supports `print()` but not `console.log()`.

=> The changes to `printToConsole()` are therefore extended
to check for `console.log()` as well as `print()`.
=> This is extending it to a broader subset of dart2js's print

Change-Id: I7efa697477aa60e473d01716b104fc1526035c67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347283
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-01-22 12:04:37 +00:00
Martin Kustermann 1fc755eb54 [dart2wasm] Remove sdk/bin/dart2wasm{,_developer} scripts
We already have a shell script that compiles dart code to wasm and
optimizes it. I think it's rather confusing to have multiple, they
contain somewhat duplicated code as well.

We therefore remove `sdk/bin/dart2wasm{,_developer}` (which is
not used by any CI but purely for developers) in favor of
`pkg/dart2wasm/tool/compile_benchmark`.

=> It support with/without binaryen
=> It support measuring size/time/memory of dart2was & binaryen
=> It supports running compiler with assertions

Some flags/vars are not supported anymore:

* `DART_VM_OPTIONS`: Has no effect (as there's no need to support this)
* `sdk/bin/dart2wasm_developer`: Pass `--compiler-asserts` to `compile_benchmark`.
* `-O`: Optimizes now by-default, pass `--no-binaryen` to `compile_benchmark` to disable
* `-O`: Doesn't implicitly pass `--inlining-limit=10`

Change-Id: Ice656d1bfc216a536522b254e2d52bd4cad73e8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347040
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-01-19 16:05:27 +00:00
Daco Harkes ae5db20deb [deps] Roll native_assets_cli to internal import
https://dart-review.googlesource.com/c/sdk/+/346761 can't land,
because then flutter_tools in g3 breaks.
flutter_tools in g3 can't be forwarded because
https://github.com/dart-lang/native/pull/886 isn't in g3 yet.

Landing https://github.com/dart-lang/native/pull/886 in g3
should work, because it shouldn't break flutter_tools.

Change-Id: Ida60ed22093ace535c00114fc8b088ba2100eb1a
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-win-release-try,pkg-win-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346960
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-01-18 12:50:21 +00:00
David Morgan 435cee17b7 [test] Skip chrome Gnome keyring, KDE wallet.
Prevents a popup on chrome start on my cloudtop; see:
https://github.com/GoogleChrome/chrome-launcher/blob/main/docs/chrome-flags-for-tools.md#chromium-annoyances

R=sortie@google.com

Change-Id: I3f1def07bb940dd8930f5b2eed81053c24775197
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346320
Auto-Submit: Morgan :) <davidmorgan@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2024-01-15 13:01:54 +00:00
Paul Berry 355d7e02fc Stop testing nnbd-weak and nnbd-legacy on analyzer.
After discussion with Siggi about
https://dart-review.googlesource.com/c/sdk/+/341020 (which removed a
lot of mixed-mode tests from the language test suite), we've decided
that these tests are worth keeping around, because they exercise
important "weak mode" runtime functionality on the web platform, and
weak mode is still used inside google3.

However, we would like to unblock removal of legacy support from the
analyzer (because this is _not_ used inside google3 anymore, and
there's a nontrivial cost to maintaining it). So, to ensure that
removing legacy support from the analyzer doesn't cause test failures,
we need to stop running these "weak mode" tests on the analyzer
platform.

The test runner already has the ability to recognize these tests and
skip them; it recognizes them by the comment `Requirements=nnbd-weak`
at the top of the test. We simply need to instruct the test runner not
to run these tests on the analyzer platform anymore.

This CL also disables running of `Requirements=nnbd-legacy` tests on
the analyzer. No such tests exist anymore, but since support for this
requirements comment still exists in the test runner, it makes sense
to include it in the effect of this CL.

Change-Id: Ib5d5eb7c1bf879581b21fa5093fa7fa6304005a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342080
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-12-19 02:19:39 +00:00
Ben Konyi f6205e0013 [ test matrix ] Run package:vm_service tests on VM configurations
Change-Id: I69eb125f0df46bdc3be65b99985bfcdaa0d51bfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337300
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-12-08 15:58:52 +00:00
Ömer Sinan Ağacan 7cceaebd49 [dart2wasm] Start using WebAssembly.String imports
Refactor `JSStringImpl` to use the js-string-builtins API[1].

When the module `WebAssembly.String` is not available we define a
"polyfill" with the previous imports, so this change is backwards
compatible.

Also updates some of the methods to use avoid multiple `this.length`
calls (which do an FFI call), and use unchecked getters when possible.

A new library `dart:_error_utils` is introduced for faster range and
index checks when the length (or max value) is known to be positive
(e.g. when it's the length of a string).

For now only `JSStringImpl` and `operator []` and `operator []=` of
`JSArrayImpl` are updated to use the new range and index checks. Rest of
the libraries will be updated separately.

[1]: https://github.com/WebAssembly/js-string-builtins

CoreLibraryReviewExempt: dart2wasm specific library change.
Change-Id: I9436def0cfe59c631f6f4e15ea06cc18a47a738e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335043
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-12-08 10:04:41 +00:00
Ryan Macnak 09da512b67 [vm] Consistently apply --target_unknown_cpu to AOT compilation.
- Fixes new AOT snapshots in the SDK failing with SIGILL in ARM environments that don't support the integer division instructions.
 - Likewise fixes snapshot generated by `dart compile exe`.

TEST=local QEMU
Bug: https://github.com/dart-lang/sdk/issues/54198
Change-Id: Ifb998ced4e900a64ef02a464903a50954f6e0699
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339104
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-11-30 23:44:50 +00:00