Adds a generator that reads the platform libraries dill and outputs
maps that correspond to the various bindings e.g. `@Native` values
that exist in the web libraries. These maps will be consumed during
the analyzer run for lints.
Change-Id: I5b5bf91ff0e32964b97c9e52be414ec84ff88765
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272720
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
This prepares dart2js to default to sound null safety in Dart 3.0.
The compiler no longer infers the default mode based on the input
program, instead uses sound null safety unless
'--no-sound-null-safety' is specified.
On a separate change, we expect to remove the option of disabling
null safety.
Note: this change should also be reflected in the CHANGELOG, but
we've currently not included it to redeuce merge conflicts, as we plan
to land multiple 3.0-alpha changes in a short window of time
Change-Id: Id87498cc5976548ec89d1f36c60674b72406950a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270860
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
- Flip flag to make strong null safety the default
- Remove code that auto detects null safety mode from source files,
it is necessary to specify --no-strong-null-safety to opt out.
- Retains sniffing of AOT/JIT snapshots and kernel files to determine
null safety mode, the opt out has to be done when generating these
file.
TEST=ci
Change-Id: If2c9608eedb7c46d9c3cd85e261ee9640e0d28eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261140
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Change-Id: Ie0946865371d9e35de0fff1c972732f96ea09e8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272662
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Change-Id: Idd0aaec42e1a92f57515dbb6bda27f1011c7d77d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272782
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Change-Id: I0f973090b6fab0be0f9c774636b3cc4248dc2c22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272362
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
This made the docker build work for me locally. The "updates" list was
probably needed on jessie but isn't needed on bullseye anymore.
Change-Id: I88f257b928f6ef690dac9e7d450eaa4c2ea12b2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271102
Reviewed-by: William Hesse <whesse@google.com>
This CL changes the spec parser grammar, Dart.g, such that its pattern
related rules correspond to the recent updates in the patterns feature
specification.
Change-Id: I8d07cdb4c7ce22e0625da5bc8224ca2cf57af095
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268920
Reviewed-by: William Hesse <whesse@google.com>
Auto-Submit: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Have a separate flag from patterns, even though sealed families are to be shipped with patterns -- keep the work separate for now.
Change-Id: Ic3996b81d9a61f2a3b1e5137e7cc32ecc8bdec9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267289
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
This adds the 'views' feature flag together with parser support
for 'view class'. If the feature is not enabled, an error is reported.
TEST=pkg/front_end/parser_testcases/views/...
Change-Id: I813ac86a0e7de9f0a5729c6d7ae35b82d1258ae5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265780
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: William Hesse <whesse@google.com>
The debian packages on the release branches are now uploaded to the
version directory only when the tools/VERSION file changes, allowing
cherry-picks to land asynchronously on the beta/stable branches via
gerrit without clobbering any existing release artifacts. This logic
matches the changes made to the recipe for the dart-sdk builders. This
change is required to enforce our data security policies for mandatory
code review on the beta and stable branches using the new release
pipeline workflow.
This change needs to be cherry-picked to beta and stable before
launching the new cherry-pick workflow to avoid clobbering artifacts.
This change is safe because it doesn't affect any aspect of the Dart
SDK except the final upload of .deb files that has been locally tested.
Match the dart-sdk builder logic by also uploading by git hash and to
the latest directory.
Bug: b/256599191
Change-Id: Ib0d4853482edd1bd68f459fc97410fe61b4981c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266685
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: William Hesse <whesse@google.com>
This CL changes $SDK/tools/spec_parser/Dart.g to include grammar rules
associated with the upcoming feature 'patterns'.
Change-Id: I3c8a5404471b0957d8e2a2b833156e02bbd3607b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266628
Commit-Queue: William Hesse <whesse@google.com>
Auto-Submit: Erik Ernst <eernst@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Both the production and try builders for the Linux SDK have been
migrated to the new recipe that doesn't use the test matrix.
The tools/bots/dart_sdk.py script is is no longer use and is removed.
Bug: b/253079985
Change-Id: I85a122b6165858b3dd43e7a1baad1dcd23f32ecb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265341
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
Allows for tests to pass with dart2wasm. This CL also adds these
tests to the test_matrix.json.
Change-Id: I970ef26b0fb377095c3889e6f52bef256d618850
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264604
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
This reverts commit 97eaded1ed.
Reason for revert: It was not erroring on the annotation on the
library, but on the implicit import statement above it due to
template:top.
https://github.com/dart-lang/sdk/issues/50291#issuecomment-1290158070
Original change's description:
> [tools] `verify_docs` don't error on library annotations
>
> Dartdoc code snippets should be able to have annotations before the
> `library` keyword.
>
> Bug: https://github.com/dart-lang/sdk/issues/49803#issuecomment-1287044157
>
> Change-Id: I7ec0b6db296274a1173d10d900f7af38a1f2b552
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265321
> Reviewed-by: Devon Carew <devoncarew@google.com>
> Auto-Submit: Daco Harkes <dacoharkes@google.com>
> Commit-Queue: Daco Harkes <dacoharkes@google.com>
> Commit-Queue: Devon Carew <devoncarew@google.com>
TBR=lrn@google.com,devoncarew@google.com,dacoharkes@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: I379a1871a1acd4d1c66804c3948f38e45691fd55
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/49803#issuecomment-1287044157
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265324
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Thomas <athom@google.com>
This CL changes the output of the tool to have the desired commit
message, including title and reference to the script.
Also scan repos in parallel, reducing execution time from 19 to 4
seconds on my machine.
Change-Id: Ia5fe75c21dd3b217038337e31161d2b88d22026c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265282
Reviewed-by: Devon Carew <devoncarew@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
* Use dartk as the default compiler for runtime=vm.
* Status file entries for checking for the `none` compiler now either
use dartk or are deleted.
Tested: Standard CQ and local testing.
Fixes: https://github.com/dart-lang/sdk/issues/50241
Change-Id: I7a08d3e491ae1c82a0348fb66ea7b557398f97e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264682
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Change-Id: I3eb11e4eb2d3f2db5329df7245fbca969e2956f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263660
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This change is needed as a consequence of
https://github.com/dart-lang/language/pull/2422
where `()` was introduced as the syntax for the empty record as well
as the empty record type.
Change-Id: Ia8b3f590361343ca14355043c5898e7bd084c04e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261645
Reviewed-by: William Hesse <whesse@google.com>
Auto-Submit: Erik Ernst <eernst@google.com>
Commit-Queue: William Hesse <whesse@google.com>
This adds support for the experimental 'records' feature in the sdk
by settings its experimental release version to 2.19 and opting the sdk
into the feature the allowed_experiments.
Change-Id: I7a30212e5724e5d8ae3208f177103764b9aed737
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262760
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
This CL adds an interactive command line tool to analyze
heapsnapshots generated by the Dart VM.
The tool works by operating on sets of objects. It supports operations
like users, transitive closure, union, ...
An example usage that loads snapshot, finds all live objects, finds
the empty lists in them and prints retainers of the empty lists:
```
% dart bin/explore.dart
(hsa) load foo.heapsnapshot
(hsa) all = closure roots
(hsa) stat all
size count class
-------- -------- --------
43861 kb 8371 _Uint8List dart:typed_data
...
-------- -------- --------
108904 kb 400745
(hsa) empty-lists = dfilter (filter all _List) ==0
(hsa) empty-growable-lists = filter (users empty-lists) _GrowableList
(hsa) retain empty-growable-lists
There are 5632 retaining paths of
_GrowableList (dart:core)
⮑ ・UnlinkedLibraryImportDirective.configurations (package:analyzer/src/dart/analysis/unlinked_data.dart)
⮑ ﹢_List (dart:core)
⮑ ・...
```
For now the tool lives only in dart-lang/sdk.
TEST=pkg/heapsnapshot/test/*_test.dart
Change-Id: I671c2e3ca770e1a5aa3e590e850a5694070b4c3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261100
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This CL updates Dart.g and hence the spec parser to handle new features
added to Dart in 2.17.
Change-Id: I42d6534d933df9a30453f12643dcc90e4d86fa80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260821
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Note: this "upgrades" ninja to 1.11.1.
Change-Id: Idca0f8a2a67cf5d5dbe75661bb14de174012580f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261101
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Three improvements to the generated compile_commands.json on Windows.
1. Prevent the use of .rsp files by using `ninja -t compdb -x`.
Start using the ninja from DEPS that supports the `-x` flag.
2. Remove the `ninja -t msvc` part of the the build commands. Clangd
does not understand it.
3. Add the windows sysroots (which are set with `-e environment.x64`
in the build).
Currently, these are hardcoded to the ones shipped in depot_tools
because the `environment.x64` is non-trivial to parse.
Bug: https://github.com/dart-lang/sdk/issues/50032
Change-Id: I897ded9e7c97abdf4dde738c275db36536e0b0c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260701
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
This CL introduces a new kernel-to-kernel pass in Wasm backend to
compile `FfiNative`-annotated external functions to external functions
with `wasm:import` pragmas.
The new pass `WasmFfiNativeTransformer` extends `FfiNativeTransformer`.
Some `FfiNativeTransformer` methods made public to allow reuse in the
pass.
The conversion works like this: when we see a member like:
@FfiNative<Int8 Function(Int8, Int8)>("ffi.addInt8")
external int addInt8(int a, int b);
We generate a Wasm import using Wasm ABI types according to emscripten
calling conventions:
@pragma('wasm:import', 'ffi.addInt8')
external static WasmI32 addInt8_$import(WasmI32 a, WasmI32 b);
and convert the original member (`addInt8()`) to a wrapper function that
calls the Wasm import, converting the arguments and return values to
Dart types:
static int addInt8(int a, int b) {
return WasmI32.toIntSigned(
addInt8_$import(
WasmI32::int8FromInt(a),
WasmI32::int8FromInt(b),
));
}
Build, test, and CI changes:
- Test runner now uses `// SharedObjects=...` lines in dart2wasm tests
to pass extra Wasm modules to d8 command used to run the tests.
Support for `// SharedObjects=...` lines were already used in
native/AOT FFI tests, not added in this CL. We just start to use those
lines in dart2wasm tests.
- dart2wasm gn file updated with a target "test_wasm_modules" that
builds FFI test Wasm modules to Wasm using emcc (emscripten C
compiler).
- CI dart2wasm_hostasserts configuration updated to copy the Wasm files
generated by the "test_wasm_modules" target to the shards.
TEST=tests/web/wasm/ffi_native_test
Change-Id: I6527fe4e2ca2b582e16d84fee244e9cbe6dee307
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252822
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Change-Id: I7cb158d2e30e999564c11454783082837c7e5984
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259901
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
A few co19 tests are marked as skipped for now, as they are hanging
due to https://github.com/dart-lang/sdk/issues/50026
Increase the number of shards to match the increased number of tests.
Change-Id: Ib91127986d13140164c357a22f2d1d9b7b2b7636
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260361
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Registering custom elements are already broken -- see: https://github.com/dart-lang/sdk/issues/49536. There are plans on deleting this code at some point. This current change cleans up dynamic invocations in the deprecated code.
Removes cruft on already-deprecated code and doing it now because I assume dynamic clean up will finish before the issue resolves.
Change-Id: Ic6250c139c5d9b08d88650110f55442a7bf5dd42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259247
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Both the production and try builders for the Windows SDK have been
migrated to the new recipe that doesn't use the test matrix.
Bug: b/247507699
Change-Id: I7a603e716492ffa272a43eea959b721c8c4a8f1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259842
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Both the production and try builders for the macOS SDK have been
migrated to the new recipe that doesn't use the test matrix.
Bug: b/236109661
Change-Id: I4f578a162c866da6673b228023adb5966f1ca505
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259423
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
Avoid removing dynamic invocations in sanitizing code as we don't know what type the element and its attributes may be.
Change-Id: I057d908027befe7fd284bf4ec6c68bd1d0e977f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259108
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Adds a flag `--generate-prototype-events` to the dart:html generation
scripts, which causes a `prototype_events.dart` file to be generated
with EventStreamProviders and extensions for all events generated
in legacy dart:html. The generated file can be copied and pasted into `html_events.dart` to be used in the new dart:html prototype.
The script `prototype_htmleventgenerator.py` reuses as much common functionality as possible from the `htmleventgenerator.py`.
There were many edge cases to consider, like:
- de-conflicting names with different event types (e.g. ProgressEvent onError vs SpeechRecognitionErrorEvent onError)
- hiding deprecated types that don't appear in the Web IDL and haven't been needed in the glue code prototype yet
- renaming extension on-types that have been renamed from the Web IDL
- hiding custom events, which then need to be added to the prototype by hand
- prefixing some events with the correct web library
Change-Id: I6ab944d74ede6d8a2178bbf9aa580a6ab7d67a77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259063
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>