Doesn't change anything in `front_end/*testcases/primary_constructors/`.
(Would have skipped any other file with `test` in its path and
an explicit language version marker, but there weren't any outside
of those `front_end` directories).
Almost no files used as test input were affected, and none testing the actual syntax changed.
The `.../nnbd/required_2.dart` test case was split into a legacy version retaining the `var`/`final` with a language marker, and a new version without the `var`/`final` cases.
The `pkg/analyzer/` tests, and any other tests that have source code
in strings, are not migrated by this CL.
Tested: No change to behavior. One test split into legacy and new.
Change-Id: I7f5aa4cc98001a9adecacd106c0b3be14f96be1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/480542
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
This change fixes the following problems when parsing DART_VM_OPTIONS
environment variable:
* Resize vm_options to accomodate for extra flags from
DART_VM_OPTIONS.
* Prepend executable name to the argv to be compatible with
implementation of Platform.executableArguments.
* Use strchr instead of strtok_r to avoid modifying value of
DART_VM_OPTIONS environment variable in place.
TEST=pkg/dartdev/test/commands/compile_test.dart
Fixes https://github.com/dart-lang/sdk/issues/62957
Fixes https://github.com/dart-lang/sdk/issues/62958
Change-Id: I86e0ece20844888333b2a0765c82a5ad1fba54b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491001
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
The `Match.operator[]` does the same thing and is
generally recommended (and shorter).
(I want to deprecate `group` and `groups`)
Tested: Refactoring.
CoreLibraryReviewExempt: Calling equivalent function.
Change-Id: I4c758968ae622fe16b7322be1b29b05b91e7fcd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/489021
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Recorded uses have two use cases:
1. In link hooks by package authors.
2. In SDKs that wrap Dart standalone.
The second use case is already used for dart2js with
`--write-resources`. dart2wasm already added a `--recorded-uses` flag.
Let's add the same flag for `dart compile` subcommands.
TEST=pkg/dartdev/test/native_assets/compile_test.dart
Change-Id: Iec31b7339d244d67a35cb9a072dff43ddc3983fa
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-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488461
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
This CL is part of an effort to bump the SDK requirement to `3.12.0-0`
for all the packages in `pkg` that are not published to `pub`, so that
we can get better testing of the "private named parameters" feature.
(Packages that *are* published to `pub` can't be safely bumped yet,
because SDK 3.12 hasn't been released, and I don't want to block those
packages' ability to publish useful updates to customers.)
This change covers the following packages, which are owned by OWNERS_ENG:
- pkg/async_helper
- pkg/bisect_dart
- pkg/dartdev
- pkg/expect
Changes to `pubspec.yaml` files were made manually.
Changes to `.dart` files were made automatically, using `dart fix` to
migrate to using private named parameters where it is possible to do
so without changing semantics. Note that this migration is
conservative; see https://github.com/dart-lang/sdk/issues/58607 for
details.
Change-Id: I56bdd1f2665b0a0b79ebb8484e49ce176a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487940
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Stream various updates from different components to `stderr` instead
of `stdout` on `dart run`.
TEST=pkg/dartdev/test/
Fixes: https://github.com/dart-lang/sdk/issues/62818
Change-Id: Icd5caa65aab092341d370b09c016f89ae2a57987
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-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486203
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Architecture:
* The backends piece together the information of the original
definitions by undoing the name mangling.
Classes, top-level methods, and static methods have the kind and
disambiguator now.
Bug: https://github.com/dart-lang/native/issues/2888
Extension name and extension method names are now tracked properly.
Unnamed extensions are named `<unnamed>` for now. We should consider
making `name` optional in the format.
Bug: https://github.com/dart-lang/native/issues/2948
We don't have test coverage for enums. The current implementation
reports them as instances.
Bug: https://github.com/dart-lang/native/issues/2944
TEST=pkg/compiler/test/record_use/record_use_test.dart
TEST=pkg/dart2wasm/test/record_use_test.dart
TEST=pkg/vm/test/transformations/record_use_test.dart
Change-Id: I7f87fcac3d2333b150cc7ed30bce7960f8a845e3
Cq-Include-Trybots: luci.dart.try:dart2wasm-asserts-linux-chrome-try,dart2wasm-asserts-minified-linux-d8-try,dart2wasm-linux-chrome-try,dart2wasm-linux-d8-try,dart2wasm-linux-firefox-try,dart2wasm-linux-jscm-chrome-try,dart2wasm-linux-optimized-jsc-try,pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try,dart2js-canary-linux-try,dart2js-hostasserts-linux-d8-try,dart2js-linux-chrome-try,dart2js-linux-firefox-try,dart2js-mac-chrome-try,dart2js-mac-safari-try,dart2js-minified-csp-linux-chrome-try,dart2js-minified-linux-d8-try,dart2js-unit-linux-x64-release-try,dart2js-win-chrome-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/481100
Reviewed-by: Nate Biggs <natebiggs@google.com>
`dart build cli` only supports `bin/` scripts. So don't suggest it
as replacement for `dart compile` for non bin scripts.
Bug: https://github.com/dart-lang/sdk/issues/62593
Change-Id: I61cf60d4f168f10067295d4876c859e72eb32881
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-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/478640
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Morgan :) <davidmorgan@google.com>
This adds handling of upper case letters in `dart create`. This command is run from IDEs (IntelliJ, atleast) and if you use upper case letters in the directory, the `dart create` would (silently) fail instead of normalizing the directing to a valid package name, leaving the created project folder with no content.
All upper case names are normalized to all lower case, and mixed case are normalized to snake case, as if it was from camel case.
Change-Id: If854e17a0273eb0d02f4f0c5dcd4b50752e57bd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/474641
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This updates the `Dockerfile` generated by `dart create` with the
`server-shelf` template to use `dart build cli` instead of `dart
compile exe`. The benefit of using the `build` command is that it runs
hooks and bundles code assets. These assets should also be present in
the container image.
TEST=Tested manually (create template, build image, run)
Change-Id: Ia8ccbba4ea6631ec6d5bb8866fd59ae4821375ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470661
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
`dart compile wasm` currently checks `--strip-wasm` and passes it along
if it's set.
This doesn't do anything because `--strip-wasm` is already the default
in dart2wasm, and `dart compile wasm` never passes `--no-strip-wasm`.
Instead of passing `--strip-wasm`, pass `--no-strip-wasm`.
To help debugging this kind of thing future, `--verbose` output is
improved:
- Print `--strip-wasm` flag value with other flag values.
- When running `wasm-opt` print the `wasm-opt` flags.
Change-Id: Iaa24836a439294badf5470446a2bb83031a79a98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/469582
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Testing for semantic equality means that we don't have to update
the expectation files every time a backwards compatible change to the
json serialization rolls in.
This also i a step towards being able to share the expect files
between the VM and dart2js.
Bug: https://github.com/dart-lang/native/issues/2885
TEST=pkg/compiler/test/record_use/record_use_test.dart
TEST=pkg/dartdev/test/native_assets/compile_test.dart
TEST=pkg/vm/test/transformations/record_use_test.dart
For reference, to update the goldens:
```
$ tools/test.py -m release --vm-options -DupdateExpectations=true pkg/vm/test/transformations/record_use && \
tools/test.py -m release --vm-options -DupdateExpectations=true pkg/compiler/test/record_use/record_use
```
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-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try,dart2js-linux-chrome-try,dart2js-unit-linux-x64-release-try,dart2wasm-linux-jscm-chrome-try,dart2wasm-linux-optimized-jsc-try
Change-Id: I462350909eb82f486d09b813f2bc516fe50ce0fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/469580
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
The new record_use serializer orders keys alphabetically, the files
are staying the same length in lines.
Note: In a later PR we should update the golden files to be identical
between both compilers to ensure correctness across the compilers.
TEST=pkg/compiler/test/record_use/record_use_test.dart
TEST=pkg/dartdev/test/native_assets/*_test.dart
TEST=pkg/vm/test/transformations/record_use_test.dart
Change-Id: I3b4209b8952a0c86017fdc26c0e2351ba78a8f72
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-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try,dart2js-canary-linux-try,dart2js-hostasserts-linux-d8-try,dart2js-linux-chrome-try,dart2js-linux-firefox-try,dart2js-mac-chrome-try,dart2js-mac-safari-try,dart2js-minified-csp-linux-chrome-try,dart2js-minified-linux-d8-try,dart2js-unit-linux-x64-release-try,dart2js-win-chrome-try,dart2wasm-linux-jscm-chrome-try,dart2wasm-linux-optimized-jsc-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/469060
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Fixes errors of the sort
```
mosum@mosum2:~/projects/i18n/pkgs/intl4x/example$ dart --enable-experiment=record-use build cli example.dart
There are multiple possible targets in the `bin/` directory, and the 'target' argument wasn't specified.mosum@mosum2
```
Change-Id: I7ed6dbd21838506c1fe60b6d69d6066406d3b7c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467842
Auto-Submit: Moritz Sümmermann <mosum@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
We don't have a way to mechanically verify the exampes and fixed code,
so please look to see whether any of it looks wrong. And, of course, let
me know if any of the text appears to be incorrect or could be better.
Change-Id: I9b059524ffcedc1e3b8a7602b7124f419095a702
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/455481
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
To help facilitate this we move all IO into a separate helper
library/class. This makes it easier to have symmetric read/write
functions and to do IO within compile.dart where necessary.
Adding the new `opt` phase allows us to remove the duplicated code
between dartdev and compile_benchmark simplifying those two files a lot.
It will also allow us to more easily invoke wasm-opt within our internal
build pipeline.
For compile_benchmark we still run the opt phase independently (but
through dart2wasm) to keep the benchmark data as consistent as possible.
Change-Id: Iaa855dbc3a05abfedbc3eea4af32e3ba27e84600
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/464640
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
progress
This enables running one-off commands via `dart run <remote>` and
only having the stdout from the program.
TEST=pkg/dartdev/test/native_assets/run_remote_test.dart
Bug: https://github.com/dart-lang/sdk/issues/61996
Change-Id: Ia60bd2b3754b407686718b33b1934d8687dac8d4
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-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/464384
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Michael Goderbauer <goderbauer@google.com>
This roll moves `package:record_use` to the dart-lang/native repo.
Change-Id: I31183dc8b72272d7e94ed3031ca0b8bfca583e0d
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-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/463662
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Michael Goderbauer <goderbauer@google.com>
The user might want to access the assets from dev dependencies.
The Dart code might want to use dev dependencies. `dart run test`.
Closes: https://github.com/dart-lang/tools/issues/2237
Change-Id: Ib8c9b4a7f3f2dedb33777e1f29cb82fc678edd4f
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-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/462980
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Michael Goderbauer <goderbauer@google.com>
Enables "run-from-remote" with `dart run`.
```
Run a Dart program from a file, a local package, or a remote package.
Usage: dart [vm-options] run [arguments] [<dart-file>|<local-package>|<remote-executable> [args]]
<dart-file>
A path to a Dart script (e.g., `bin/main.dart`).
<local-package>
An executable from a local package dependency, in the format <package>[:<executable>].
For example, `test:test` runs the `test` executable from the `test` package.
If the executable is not specified, the package name is used.
<remote-executable>
An executable from a remote package. This can be from a hosted package server
(like pub.dev) or a git repository.
When running a remote executable, all other command-line flags are disabled,
except for the options for remote executables. `dart run <remote-executable>`
uses `dart install` under the hood and compiles the app into a standalone
executable, preventing passing VM options.
From a hosted package server:
<hosted-url>/<package>[@<version>][:<executable>]
Downloads the package from a hosted package server and runs the specified
executable.
If a version is provided, the specified version is downloaded.
If an executable is not specified, the package name is used.
For example, `https://pub.dev/dcli@1.0.0:dcli_complete` runs the
`dcli_complete` executable from version 1.0.0 of the `dcli` package.
From a git repository:
<git-url>[:<executable>]
Clones the git repository and runs the specified executable from it.
If an executable is not specified, the package name from the cloned
repository's pubspec.yaml is used.
The git url can be any valid git url.
```
Notable implementation decisions:
* Does not redownload if the pubspec.lock is identical from the last
remote run. Always does a pub resolve to see if the pubspec.lock
would be identical.
* pub urls must start with `https://`. This makes parsing with local
file paths more tractible.
* git urls may use either urls, or git ssh. (Git SSH is not tested due
to not wanting to run an ssh server locally.)
* Shares as much implementation with `dart install` as possible. The
`dart install` implementation was made public where necessary. The
`dart install` implementation was kept in place to keep the git diff
small.
* Test lives in pkg/dartdev/test/native_assets/ so that its not run
on a shard and xcode and git commands are available.
TEST=pkg/dartdev/test/native_assets/run_remote_test.dart
Closes: https://github.com/dart-lang/sdk/issues/61588
Change-Id: I6a641c670a61da309027d3f82c90f4b59e70933b
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-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/457640
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
First step into making both dart2js and the vm output the same
for recorded uses.
This CL changes the output format to be the same.
It does not
- change the annotations which are read,
- add support for named arguments,
- add support for const source locations, and
- test feature parity.
Bug: https://github.com/dart-lang/native/issues/2717
Internal customers are migrated in cl/830421816.
TEST=pkg/dartdev/test/native_assets/compile_test.dart
Change-Id: I67b5e3d4aebac6c22b185c77f5cb69025d746a32
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-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try,dart2js-canary-linux-try,dart2js-hostasserts-linux-d8-try,dart2js-linux-chrome-try,dart2js-linux-firefox-try,dart2js-mac-chrome-try,dart2js-mac-safari-try,dart2js-minified-csp-linux-chrome-try,dart2js-minified-linux-d8-try,dart2js-unit-linux-x64-release-try,dart2js-win-chrome-try,dart2wasm-linux-jscm-chrome-try,dart2wasm-linux-optimized-jsc-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416000
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
`connected_app_service_test` went from flaky to always failing on Windows recently (on what seems like a completely unrelated CL of mine).
The cause is failure to delete this directory due to file locks, which is something we often see on Windows and usually wrap deletes with some retries instead of immediately failing. This adds the same here,
Change-Id: I3f9b4f52d2327c3b3ef3e70674059366caa26093
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/461420
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jessy Yameogo <yjessy@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>