Commit Graph

113495 Commits

Author SHA1 Message Date
Tess Strickland 34c4e4799d [vm,dyn_modules] Ensure coverage arrays during source reporting.
The original iteration of adding coverage arrays originally eagerly
allocated coverage arrays for bytecode methods with recorded coverage.

Now that these coverage arrays are lazily allocated,
Function::GetCoverageArray() needs to ensure that the appropriate
coverage array has been allocated.  Otherwise, no misses within the
function are recorded in cases where no RecordCoverage instruction in
the method has yet been executed.

TEST=vm/cc/SourceReport_Coverage_UnusedClass_ForceCompile
     pkg/vm_service/test/branch_coverage_test
     pkg/vm_service/test/coverage_async_test
     pkg/vm_service/test/coverage_closure_call_after_optimization_test
     pkg/vm_service/test/coverage_closure_call_test
     pkg/vm_service/test/coverage_instance_call_after_optimization_test
     pkg/vm_service/test/coverage_static_call_after_optimization_test

Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try
Change-Id: Iff4ddaf583d0f9583bc415142bdee52c046a6712
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507440
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2026-06-01 10:35:58 -07:00
Paul Berry ca78143775 Merge OWNERS_FOUNDATION into OWNERS_LANGUAGE.
These two groups were the same (except for Kallen, who was
accidentally not included in OWNERS_FOUNDATION and should have been),
so we decided to merge them. Internally, the group is called the "Dart
Language and Core Libraries" team, so `OWNERS_LANGUAGE` seems like the
one to keep.

Change-Id: I606ba5828f482c04841c2e995a0066ad6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/508166
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2026-06-01 09:59:56 -07:00
Konstantin Shcheglov 771a30f853 CQ. Extract _IndexTextBuilder.
Change-Id: I0119c2c312dd666fc42654e04c9dd445e8fb900e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507740
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-06-01 09:56:51 -07:00
Konstantin Shcheglov bf02a527ce Augment. Update ConstructorBodyTest.
Change-Id: Ic1bed2f8ac28b480e28ffa0bb3dccc4f26857f1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507721
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-06-01 09:56:25 -07:00
Alexander Markov 5dd8edc9ff [modular_aot] Support enclosing function type arguments
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I89fb302bc3f7b1e6e28ac80dddb756c6b2447c8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505421
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-06-01 09:56:02 -07:00
Konstantin Shcheglov 55b35f58b8 Augment. Remove 4 tests from SubtypeTest.
Type operations are based on the elements, augmentations do not matter
here.

Change-Id: I7f71afbf6aa9c77f43af4a82077dab474f8e7af9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507620
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-06-01 09:55:25 -07:00
Konstantin Shcheglov f2b4ba88f6 Augment. Remove most TODO-skipped tests in resolution, migrate 3.
These tests were testing that elements declared in augmentations
can be target. But resolution is based on the element model, and we
already have tests that show how we aggregate declatations into th
element model.

Migrated 3 tests that show that `this` and `super` prefixes work
inside augmentations.

Change-Id: I36d7b1044a856e64ed92990f0e4a732f2b41a4b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507281
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-06-01 09:54:44 -07:00
Konstantin Shcheglov b9d3c903a0 Patterns. Report invalidConstantPatternBinary for 'case a.b + c.d'.
Bug: https://github.com/dart-lang/sdk/issues/63356
Change-Id: Id26a0cebf5aa0320e1d3fc62ca630fe8e7716241
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507580
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-06-01 09:53:09 -07:00
Ryan Macnak d62a57b4f8 [build] Remove deprecated copy_trees template.
Change-Id: Ic9c4233f022cfa0aa7708ff9cf777e8c6faf741b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/508163
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-06-01 09:48:16 -07:00
Ben Konyi 1e7b080ed7 fix(dds): mark server connection tests as slow in status file
Mark server_connection_api_test and server_connection_vm_service_test as Slow, Pass in pkg/pkg.status to prevent false-positive timeouts on slower/loaded builders.

TAG=agy
CONV=2fddba4d-da91-4fcd-923a-faee680c5b4e

Change-Id: Ic4fa73242c3c64d517294d9a8fb1fec5e0423380
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507660
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2026-06-01 09:35:32 -07:00
Ryan Macnak 7d6c973ed9 [build] Remove the last absolute paths from RBE builds.
Extend --check-clean (enabled on bots) to verify build commands don't include absolute paths.

The non-RBE GCC and MSVC builds still have absolute paths. GCC doesn't have -ffile-compilation-dir so it uses -fdebug-prefix-map, which is not fixable. The MSVC build has absolute path in the toolchain wrappers, which might be fixable.

TEST=ci
Change-Id: I3b984aaab7aefa7ff527f0a039ca42281224a09d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506505
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-06-01 08:46:47 -07:00
dart-autoroll@skia-public.iam.gserviceaccount.com bd304d04bc Roll BoringSSL from 5ee9407bc28d to f449f7206f62 (7 revisions)
https://boringssl.googlesource.com/boringssl.git/+log/5ee9407bc28d..f449f7206f62

2026-05-26 davidben@google.com Reject legacy_cookie in DTLS 1.3
2026-05-26 agl@chromium.org Switch away from being an entropy-injected FIPS module.
2026-05-26 rpolzer@google.com Tag new BoringSSL release for Bazel.
2026-05-26 rpolzer@google.com RC2: fix RC2 heap overflow with _huge_ key lengths.
2026-05-26 rpolzer@google.com DSA_check_signature: on failure, set *out_valid = 0.
2026-05-22 mattm@google.com add CBS_get_u48
2026-05-22 davidben@google.com Bump BORINGSSL_API_VERSION

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/boringssl-dart-sdk
Please CC dart-engprod@google.com,dart-vm-gardener@rotations.google.com,dart-vm-team@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in BoringSSL: https://crbug.com/boringssl/new
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Tbr: dart-vm-gardener@rotations.google.com
Change-Id: I801a9c0cbeb641edca4683ffa098ecf0852ab418
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506540
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-06-01 08:43:13 -07:00
Ryan Macnak 7e5b075680 Reland "[standalone] Remove the fallback root certificates."
Leave in hooks for the google3 build.

TEST=ci
Change-Id: Ib5768d27fcdbf3d4963da3d8dd142bea5fae10ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506420
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-06-01 08:32:26 -07:00
dart-autoroll@skia-public.iam.gserviceaccount.com 742b999750 Roll Fuchsia GN SDK from SEfYx3xgueX3aFAY3... to oOAcFhkoE2_-Sy67z...
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/fuchsia-gn-sdk-dart-sdk
Please CC fuchsia-3p-engprod@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Fuchsia GN SDK: https://bugs.fuchsia.dev/p/fuchsia/issues/list
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-x64-try;luci.dart.try:vm-fuchsia-release-arm64-try
Change-Id: I731187527bfd5339a00b02f3db60b5cfdcbc0a1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507640
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-06-01 08:06:09 -07:00
Jonas Finnemann Jensen 50cb703dee Fix hotReload for Flutter in clientside dartpad backend
R=goderbauer
Change-Id: Id704c270ba851b987d84b76c652eb8a1b7ceeafb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/508102
Commit-Queue: Michael Goderbauer <goderbauer@google.com>
Reviewed-by: Michael Goderbauer <goderbauer@google.com>
Auto-Submit: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Jonas Jensen <jonasfj@google.com>
2026-06-01 07:44:23 -07:00
Danny Tuppeny 0bb9fa32a5 [analysis_server] Fix isolate plugin test on Windows
Fixes:
  Expected: ['/pkg1']
  Actual: ['C:\\pkg1']
   Which: at location [0] is 'C:\\pkg1' instead of '/pkg1'
Change-Id: I6bd2abaa77eea7193794ece126201958e11639db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/508040
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-06-01 07:24:26 -07:00
Ryan Macnak fc750ac8e0 [build] Remove unsigned executable memory permissions from the AOT runtime on Mac.
Snapshots are now generally signed Mach-O dylibs loaded by dlopen, instead of ELF files mapped executable by the VM's loader.

TEST=ci
Change-Id: Id19877bed0bd0282b320f070904a848b0c076a54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505200
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-06-01 07:21:29 -07:00
Paul Berry 94b953305a [front_end] Adapt parser_ast_indexer to handle new constructor syntax.
Previously, when the code in `parser_ast_indexer.dart` encountered a
constructor, it assumed that it could figure out the constructor's
name by looking at the last identifier (before parameters) of the
signature, and prepending the class name with a `.`. This had the side
effect that "unnamed" constructors were given a name of
`ClassName.ClassName`.

With the new constructor syntax, this doesn't work anymore, because
for unnamed constructors the signature looks like
`new(...parameters...)` or `factory(...parameters...)`, so there are
no identifiers, leading to a crash.

At the moment we don't see the crash because this code is only used to
analyze files within the front end and kernel, which don't use the new
constructor syntax yet. But it blocks us from being able to migrate
the front end and kernel to use the new constructor syntax.

This CL fixes the problem, unblocking the migration.

Change-Id: Ibf78b77d736ab2ec812945401ffacf3f6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507261
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2026-06-01 07:13:26 -07:00
Johnni Winther 5059d9e842 [cfe][InternalNodes] Add AuxiliaryPattern
This allows for creating internal pattern nodes in the CFE.

Change-Id: Ifad3c29eb7dd329ecd902c7b43fcff58ad862bcc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/508000
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2026-06-01 05:17:24 -07:00
Jonas Finnemann Jensen a185d6355b Use only -O2 for dart2wasm when compiling dartpad_worker
Because -O4 might not have correct semantics.

Change-Id: Icaa3ccd1bd219e0c94e7217086c923924061fe9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507420
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Commit-Queue: Jonas Jensen <jonasfj@google.com>
2026-06-01 02:02:26 -07:00
Johnni Winther 0eb19fdba1 [cfe][PrimaryConstructors] Process parameter annotations
This CL ensures the processing of parameter annotations on primary constructors.

Since primary constructors with constructor body declarations are built in two parts, the constructor is not finished when the primary constructor is built, but instead delayed to when the primary constructor body declaration is built. This conditional code path accidentally left parameter annotations unprocessed.

Fixes b/517220569

Change-Id: I8ec82283dc60a743c22cb03c041d2975e95941bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507980
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2026-06-01 01:57:46 -07:00
Loïc Sharma 283b44e9ce Add missing space in help text for --print-dtd
Closes https://github.com/dart-lang/sdk/pull/63487

GitOrigin-RevId: c42190fcef7ca7712f35698836ecf8ed41840fa7
Change-Id: If355719e9741383666c6d046b392e2c2b4b75b96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507820
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-06-01 01:03:15 -07:00
Alexander Aprelev 0894f4d219 [gardening] Fix dartpad build rules so they work in flutter repo.
Fixes broken dart->flutter roll https://github.com/flutter/flutter/pull/187339

TEST=flutter ci

Change-Id: If6d19ef4b52f859a67178b6ae7c903b21c9106b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507860
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2026-05-31 06:40:23 -07:00
Brian Wilkerson 4af407d11e Fixes the handling of linked edit groups in ChangeBuilder
NOTE: Amost all of this code was written by AI, but has all been
reviewed by me. I did a tiny amount of cleanup that was faster to do
myself than to ask the agent to do it. That doesn't mean that I've
caught all of the AI's bugs, but I did try to ensure that test coverage
was complete enough to also catch problems.

This fixes a bug in the way the `ChangeBuilder` handled linked edit
groups. The bug resulted from the fact that the offsets of the linked
edit groups was adjusted at the time each edit location was added.
Doing that meant that they weren't re-adjusted when new non-group edits
were added at a lower offset, making it possible for the edits to have
the wrong offsets when they were sent to the client.

The solution is to not adjust them when they are created, but to
adjust them during `finalize` when other offsets are adjusted. At that
point we have full knowledge of all of the edits so we can get it right.

Doing that required adding a reference to the each edit in the file
edit builder (because only the edits in the same file can require that
an adjustment be made).

My hope is that with this change in place I can complete the arc of
work to update all of our refactors to use the `ChangeBuilder` APIs to
build the edits.

Change-Id: I59ddb0dee1f9dbb15bdcc38a84ddc07acefe6262
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507622
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-05-29 17:04:24 -07:00
Brian Wilkerson 8a5987013f Add a new fix for representationFieldModifier
This add a fix to add a type annotation in place of the `var` keyword.

The assist to add a type annotation was already being offered, but it
didn't understand that it needed to also remove the keyword. The added
fix will do both, and, by being a fix, will appear higher in the list
of code actions that users see, along side the fix to remove the
keyword without adding a type annotation.

The fix to remove the keyword can be bulk applied, so I couldn't make
the new one also be bulk applicable. We might consider reversing the
status so that the default bulk fix behavior includes adding a type
annotation, but this CL doesn't do that.

Change-Id: I122221ef1e5119a76e1157a9a15cf1193135fc59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507161
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-05-29 17:02:11 -07:00
Ben Konyi ad5133b373 [DDS] Fix server_connection_vm_service_test timeouts
In `server_connection_common.dart`, the `server removes clients that
disconnect from the API` test spawned its own Chrome instance using
`package:devtools_shared`'s `Chrome` class without isolated profiles or
essential headless flags.

This caused the test to hang or fail flakily in container environments
(like LUCI bots) and local environments: 1. Without
`--use-mock-keychain`, headless Chrome on macOS blocks on system
credential dialogs. 2. Without `--no-sandbox`, Chrome renderer processes
can crash in restricted container environments. 3. Without
`--user-data-dir`, Chrome uses the default system profile, which can
cause it to attach to an existing open Chrome instance instead of
starting a new one, meaning the process exits immediately and the test
cannot terminate it.

Fixed by directly using `package:browser_launcher`'s `Chrome` class in
the test and passing:
* `--user-data-dir` pointing to a unique temporary directory.
* `--no-first-run` and `--no-default-browser-check` to bypass welcome prompts.
* `--no-sandbox` and `--use-mock-keychain` where appropriate.

Also wrapped the test in `try-finally` to guarantee cleanup of the
temporary profile directory.

Change-Id: I6fbe5a280524b57c635ab11ef54fa07dba2794cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507600
Reviewed-by: Alexander Aprelev <aam@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-05-29 13:48:45 -07:00
Konstantin Shcheglov a3b11266ed Augment. Enable a few hierarchy tests, add more.
Change-Id: I24df92334408ee04f4fe638200561c63b4fd4ce7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507266
Reviewed-by: Paul Berry <paulberry@google.com>
2026-05-29 13:21:52 -07:00
Ben Konyi fa9895bdf6 [VM Service] Add service info file dumping and bind address support
Adds support for writing the active VM service connection URI to the file
specified by `--write-service-info-to-file` and updates native bindings
with the web server address on startups.

TAG=agy
CONV=ae3a29f5-e2c8-499c-b221-ff61e40f5f1f

Change-Id: Ice85fda098031ef4ba1cd1120a917137aae97105
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505163
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2026-05-29 13:19:00 -07:00
Ben Konyi ad7c6453a6 [VM Service] Fix DevFS stream PUT requests
Resolves issues in DevFS handling where individual stream file PUT
requests could result in flaky test failures on Windows.

TAG=agy
CONV=ae3a29f5-e2c8-499c-b221-ff61e40f5f1f

Change-Id: I55d12cc55f35d1d1ed36742d442a3d4bebad53bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505162
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-05-29 13:18:35 -07:00
Ben Konyi 85da4dfd46 [VM Service] Fix Windows expression evaluation type crash in experimental service
Correctly define `kRootLibraryUri` constant and forward `rootLibraryUri`
to the resident frontend compiler.

TAG=agy
CONV=ae3a29f5-e2c8-499c-b221-ff61e40f5f1f

Change-Id: Ie4c87857744d9b32165ea7d0f8004d6d6c337886
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505161
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-05-29 13:18:35 -07:00
Paul Berry d6889ba492 Migrate pkg/build_integration to new constructor decl syntax.
(Part of https://github.com/dart-lang/sdk/issues/63288)

This change migrates `pkg/build_integration` to use the new
constructor declaration syntax, described in
https://github.com/dart-lang/language/blob/main/accepted/future-releases/primary-constructors/feature-specification.md#abbreviations-of-in-body-constructor-declarations.

This change was performed in an automated fashion, by (a) bumping the
packages' SDK constraints to `3.13.0-0`, (b) enabling the lints
`unnecessary_type_name_in_constructor` and
`unnecessary_const_in_enum_constructor`, (c) fixing the resulting lint
failures using `dart fix`, and then (d) reformatting the affected
files.

To ease code review, I've reverted unrelated formatting changes.

Since this change requires bumping SDK constaints to `3.13.0-0`, it
was only performed on packages that are *not* published on
pub. (Packages that *are* published on pub should remain on lower
language versions until at least after the stable version of 3.13 is
released, so that we don't block users on the stable channel from
receiving updates to those packages.)

Change-Id: Ifb2c4ca31f14c3e94f7b756969e730bf6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506023
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2026-05-29 13:06:59 -07:00
Paul Berry f6cfbde274 Reformat some files in pkg/build_integration.
This will avoid some merge conflicts in a follow-up CL I'm working on
that will enable the lints `unnecessary_type_name_in_constructor` and
`unnecessary_const_in_enum_constructor` (and will fix declarations
accordingly).

Change-Id: I26d8b58ac8f299dd08539b91d7b2bc786a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506022
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2026-05-29 13:05:27 -07:00
Paul Berry faacc331de Make pkg/analysis_server/tool/spec/generate_files work on Linux
We have comments in some generated files suggesting that the user use
this script to regenerate them, but the script previously only worked
on Macs. This CL fixes the script so that it work with Linux too.

Change-Id: I4b42b843513247b16bbbcd0b7c85f82d6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507540
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-05-29 13:04:18 -07:00
Brian Wilkerson e13ffe9aff Fix a bug in the member sorter
Because of the reversed condition, the priority for primary constructor
bodies wasn't being added when the lint was disabled, causing it to not
be moved, resulting in seemingly inconsistent results.

Change-Id: I5110e39e066414e04bb69f61b3aa7189875469f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507460
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-05-29 12:57:43 -07:00
Konstantin Shcheglov 0e976d5ab1 Augment. Report recursiveInterfaceInheritance on the clause, if self-reference.
Report direct recursive interface inheritance diagnostics on the
inheritance clause that introduces the cycle, rather than on the class
or mixin name. This gives a more precise target for self-references in
extends, implements, on, and with clauses.

Track recursive inheritance reporting per interface element across
fragments so that augmentation clauses can produce the specific
diagnostic when they introduce the cycle. Defer the generic cycle
diagnostic while earlier fragments still have later augmentations to
inspect, and use the element target as the fallback location for
indirect cycles.

Update diagnostic expectations to match the new locations and cover
augmentation and part-file cases for recursive extends, implements, on,
and with clauses.

Change-Id: I480a56e4b766d704c290d67d9ca4f6a73a2f655b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507300
Reviewed-by: Paul Berry <paulberry@google.com>
2026-05-29 12:57:07 -07:00
Brian Wilkerson fe4d5ec163 Add initial documentation for sort members
Change-Id: I2f097d0f9eab08679dfa7660a698ea8dc1775cf4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507461
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-05-29 12:56:59 -07:00
Ben Konyi 5b01408585 [VM Service] Fix Windows hot reload timeout when using experimental service
Forward the `pause` parameter to the C++ runtime in reloadSources, and use
the path resolver helper to properly resolve raw Windows file paths during
hot reload compilation.

TAG=agy
CONV=ae3a29f5-e2c8-499c-b221-ff61e40f5f1f

Change-Id: Iab29cb94b390144d17f1c014ec2e9acd1ab1e11e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505160
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2026-05-29 12:50:53 -07:00
Paul Berry 406f493bcf Sort linter rules in developer experience analysis_options.yaml files.
https://dart-review.googlesource.com/c/sdk/+/505046 was created by an
automated script that didn't respect the ordering of lint entries in
`analysis_options.yaml` files. We usually try to keep them sorted, so
this CL re-sorts them.

Change-Id: I1a7d007af34b6db2f8e4f02b8cc71d2c6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-05-29 12:39:54 -07:00
Daco Harkes 1cdc6b3f84 [dartdev] dart build cli non-bin entry point and package config
Closes: https://github.com/dart-lang/sdk/issues/63432

This is needed for being able to make `package:test` being able to
compile (individual) tests with build and link hooks.

Change-Id: Icb9c576376fd04ff0518f686c00153581067b080
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/+/506242
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2026-05-29 12:11:50 -07:00
Paul Berry de28cc3a7f Fix some code generated files to point to the correct generation script.
These files had comments indicating that running
`pkg/analysis_server/tool/spec/generate_files` would regenerate them,
but that was not the case.

Change-Id: I6ceb6352edf6eab5e746276a0a2f33b16a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507521
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-05-29 11:15:46 -07:00
Alexander Aprelev 5b0285866d Revert "Reland "[vm] Recognize int.trailingZeroBitCount/oneBitCount as graph-inlinable""
This reverts commit 415b040d6f.

Reason for revert: breaks riscv https://github.com/dart-lang/sdk/issues/63479

Original change's description:
> Reland "[vm] Recognize int.trailingZeroBitCount/oneBitCount as graph-inlinable"
>
> The previous attempt was reverted because it broke unoptimized JIT
> on ARM 32. This reland force-optimizes the two getters.
>
> Stacks on top of the int.{trailingZeroBitCount,oneBitCount} API CL
> (commit 754239b077). Both getters route through OTHER_RECOGNIZED_LIST
> when a hardware fast path is available; otherwise the newly added
> Dart bodies inline at call sites via vm:prefer-inline. The C++
> natives are removed.
>
> Backend codegen
> ---------------
> ARM64:     NEON CNT + UADDLV (popcount); RBIT + CLZ (ctz).
> ARM:       NEON CNT + VPADDL chain (popcount); RBIT + CLZ on the
>            register pair (ctz).
> x64:       popcntq when TargetCPUFeatures::popcnt_supported();
>            LoadImmediate(64) + rep_bsfq for ctz (decodes as tzcnt
>            on BMI1+, preserves dest on zero otherwise).
> RISC-V 64: cpop / ctz when RV_baseline includes Zbb.
>
> Per-arch availability is encapsulated in
> UnaryInt64OpInstr::IsSupported(Token::Kind).
>
> Apple M-series ARM64, AOT (us/iter, lower is better):
>   cardinality.swar              371
>   cardinality.accelerated       154    (2.4x)
>   forEachSetBit.swar          19031
>   forEachSetBit.accelerated    4988    (3.8x)
>   select.swar                   199
>   select.accelerated             77    (2.6x)
>   complementCardinality.swar    399
>   complementCardinality.accel   152    (2.6x)
>
> Work towards https://github.com/dart-lang/sdk/issues/6486 (popcount
> and ctz intrinsification).
>
> Work towards https://github.com/dart-lang/sdk/issues/1053 (efficient
> BitSet implementation).
>
> Fixes https://github.com/dart-lang/sdk/issues/52673
> Fixes https://github.com/dart-lang/sdk/issues/38346
> Fixes https://github.com/dart-lang/sdk/issues/63436
> Issue https://github.com/dart-lang/sdk/issues/10212
> Issue https://github.com/dart-lang/sdk/issues/5798
> TEST=tests/corelib/int_bit_count_test
>
> Cq-Include-Trybots: luci.dart.try:vm-linux-release-simarm-try,vm-ffi-qemu-linux-release-arm-try,vm-aot-linux-release-simarm_x64-try,vm-aot-linux-debug-simarm_x64-try,dart-sdk-linux-riscv64-try
> Change-Id: Ib812cbaec6e371b9720df7a543411f78e524cac1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506060
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Auto-Submit: Modestas Valauskas <valauskasmodestas@gmail.com>
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Martin Kustermann <kustermann@google.com>

Cq-Include-Trybots: luci.dart.try:vm-linux-release-simarm-try,vm-ffi-qemu-linux-release-arm-try,vm-aot-linux-release-simarm_x64-try,vm-aot-linux-debug-simarm_x64-try,dart-sdk-linux-riscv64-try
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: Iaf11d03d394fa615098bed8fcdea38ba40c7e45f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507520
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2026-05-29 10:29:33 -07:00
Ben Konyi 8d41c9b677 [dartdev] Synchronize environment variable modifications to fix getenv crash
Avoid a race condition between async setenv/unsetenv calls on the VM thread and concurrent getenv/environ reads on the main thread.

In glibc, setenv and getenv are not thread-safe against each other. VmInteropHandler.setEnvironmentVariable previously sent a message to the VM thread to call setenv/unsetenv asynchronously, while the main thread immediately proceeded to access Platform.environment or Platform.localeName (which calls getenv). This could cause a crash (SIGSEGV) in getenv.

This CL makes VmInteropHandler.setEnvironmentVariable synchronous by awaiting a reply from the VM thread before returning.

TEST=pkg/dartdev/test/environment_test.dart

Fixes https://github.com/dart-lang/sdk/issues/63460

Change-Id: Ic8211897ce26ffbdc142fa594cd397189a61f061
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506800
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2026-05-29 10:26:54 -07:00
Konstantin Shcheglov 53f3ecc74d Augment. Report inconsistentInheritanceGetterAndMethod and inconsistentInheritance only on the introductory declaration.
Change-Id: I6f03031e2540b7d65995eba9608cdaf9651204e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507263
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-05-29 09:48:16 -07:00
Konstantin Shcheglov 67cada59b7 Augment. Don't report extra diagnostics when the executable element isAugmentationWithoutAugmentedDeclaration.
Change-Id: Ibe7c65e4ea53babfe8a308d6af310e053fe98ce2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507260
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-05-29 09:47:33 -07:00
Konstantin Shcheglov 88fa507348 CQ. Migrate index tests for name references to text expectations.
Change-Id: Ib5820e5e49242a29899d70b80f6aec90a5679be9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507141
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-05-29 08:47:12 -07:00
Yash(VictoWolf) 16441c6025 Clarify WebSocket.addError behavior
Document that WebSocket.addError does not transmit an error event to the
remote peer and only reports the error locally.

Changes:
* sdk/lib/_http/websocket.dart

Bug: dart-lang/sdk#45733
Change-Id: I8913ac4fb466e9d613b3f0c5f0727640c9d9a913
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/502500
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2026-05-29 08:23:06 -07:00
Alexander Aprelev 02b30d5275 [vm/shared] Implement Isolate pinToCurrentThread, isPinnedToCurrentThread.
TEST=threading_pinning_test

Change-Id: I9a80543a06dbf51c070fed5c0e64eeba247497de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497126
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2026-05-29 07:58:23 -07:00
Brian Wilkerson 3b81982dec Fix a false positive in avoidUnusedConstructorParameters
Primary constructor parameters can be referenced in field initializers,
and the lint was failing to account for that.

Change-Id: Ib68d4a923cdbd7568be6b463d8f9f6ff1b0b682e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507201
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-05-29 07:41:59 -07:00
Brian Wilkerson eb5a805486 Fix a false positive for unusedElement
Constructor parameters that were only referenced by a `super` parameter
in a primary constructor were being flagged as being unused because the
`super` parameter wasn't being visited. This CL causes all `super`
parameters to be visited.

Change-Id: Iad6eee87b3b74a387d86e783e3bb35300a801c12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507262
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
2026-05-29 07:31:29 -07:00
Sergey G. Grekhov 43caa20715 [co19] Roll co19 to 4d2914a4cbb97eeb67ebcc6618bead6a584beb1e
2026-05-29 sgrekhov22@gmail.com Fixes dart-lang/co19#3830. Update expected errors locations in static_errors_A05_t04.dart (dart-lang/co19#3831)
2026-05-29 sgrekhov22@gmail.com Fixes dart-lang/co19#3825. Don't try to extend `String` (dart-lang/co19#3829)
2026-05-29 sgrekhov22@gmail.com Fixes dart-lang/co19#3821. Make augmenting variable abstract (dart-lang/co19#3826)
2026-05-29 sgrekhov22@gmail.com Fixes dart-lang/co19#3824. Fix typos in applying_augmentations_A04_t*.dart (dart-lang/co19#3828)
2026-05-29 sgrekhov22@gmail.com Fixes dart-lang/co19#3823. Update expected errors positions (dart-lang/co19#3827)
2026-05-28 sgrekhov22@gmail.com Fixes dart-lang/co19#3817. Replace specific error messages by 'unspecified'. Part 2. (dart-lang/co19#3820)
2026-05-28 sgrekhov22@gmail.com dart-lang/co19#3817. Replace specific error messages by 'unspecified'. Part 1. (dart-lang/co19#3819)
2026-05-27 sgrekhov22@gmail.com dart-lang/co19#2145. Add more tests for evaluation of implicit variable getters (dart-lang/co19#3816)
2026-05-26 sgrekhov22@gmail.com dart-lang/co19#2145. Add more tests for variables (dart-lang/co19#3815)
2026-05-26 sgrekhov22@gmail.com Fixes dart-lang/co19#3798. Add tests for `bitwiseOrExpression` in `guardedPattern` (dart-lang/co19#3800)
2026-05-26 sgrekhov22@gmail.com dart-lang/co19#3812. Add missing tests for ByteData (dart-lang/co19#3813)
2026-05-26 sgrekhov22@gmail.com dart-lang/co19#2145. Add/update tests for variables (dart-lang/co19#3814)

R=athom@google.com, eernst@google.com

Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try,dart2js-minified-linux-d8-try
Change-Id: I2920cd82340a0b68a67a95f5aad6966c03f934e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507360
Auto-Submit: Sergey Grekhov <sgrekhov22@gmail.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2026-05-29 06:53:55 -07:00