This change further prepares for the removal of Observatory from the
shipped Dart SDK by creating a fork to be used by the remaining
Observatory users.
This is basically a straight copy of the contents from
runtime/observatory with the exception of two new scripts:
- `bin/observatory.dart`, a utility to launch Observatory
- `bin/activate.dart`, which globally activates `bin/observatory.dart`
as `observatory`
This change also updates the presubmits to ensure that
`runtime/observatory` is effectively placed in read-only mode to prevent
any divergences with the fork.
Work towards https://github.com/dart-lang/sdk/issues/50233
Change-Id: Iff3a7512058f36afa2a96d45d94a1dff424401d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429800
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
The `ffi_test_functions` shared library needs to access functions from
`dart_api.h` and `dart_native_api.h`, which are only available in
the Dart executable.
UNIX shared libraries can have undefined symbols, which are resolved at
runtime and can be found in the loading executable. Windows DLLs cannot
have undefined symbols, but they can be dynamically linked to an
executable (in this case `dart.exe`). This requires the DLL to be able
to find the executable at runtime.
A better solution is to include implementations for the Dart APIs in the
DLL itself, that use `GetModuleHandle(NULL)` to get a handle to the
executable and `GetProcAddress` to get the address of the function.
This is what `dart_api_win.c` does.
Fixes https://github.com/dart-lang/sdk/issues/40579
Fixes https://github.com/dart-lang/sdk/issues/59677
TEST=ci
Cq-Include-Trybots: luci.dart.try:vm-win-release-ia32-try,vm-win-debug-x64c-try,vm-win-debug-x64-try,vm-win-debug-arm64-try,vm-msvc-windows-try,vm-aot-win-debug-x64c-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-product-x64-try,vm-aot-win-release-x64-try,vm-aot-win-release-arm64-try,pkg-win-release-try,pkg-win-release-arm64-try,dart-sdk-win-try,dart-sdk-win-arm64-try
Change-Id: I7f971a8ce21e03d18ed2967e74998f925c9236b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400582
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
`--fix` is going away in the new formatter so this gets the presubmit
forward compatible with that.
(If we really care about this check, we could migrate it to a separate
`dart fix` check, but I don't think it's that important.)
Change-Id: I20c9a8d9c849d72b451d9d614d1c5e9c28ca43e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/390564
Reviewed-by: Devon Carew <devoncarew@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
The motivation behind this CL is performance: currently
PRESUBMIT.py checks for formatting errors a file at a time.
This can be very slow when a CL modifies a lot of files. For
reference, a command-line invocation of `dart format`
takes 2s to check 100 files at once, vs 70s if you run the
command one file at a time.
This change updates PRESUBMIT.py to run `dart format` first
on all the changed files in bulk to determine whether any
has formatting errors. If any formatting error is found, it
goes through the process of checking each file individually
again for formatting errors and compares the result against
the state before a CL's changes (same process as today).
However, if no errors are found, we bypass the slow check
entirely!
To validate the implementation I created a pretend CL with
100 modifications. I leveraged
`tests/language/function_type/test_generator.dart` to touch
100 test files easily. The results were as expected:
* if all files are formatted properly, the presubmit
completes now in 4s (was 76s).
* If all files have formatting errors, the presubmit
didn't regress beyond the usual observable performance
variances (150s in both cases).
Notes about the change itself:
* refactored to compute the set of affected files before
running the formatting checks
* refactored to provide some information as data (e.g.
`excluded_folders`) instead of lambdas (e.g.
`should_skip`) to support the first change
* added a bulk option to `HasFormatErrors` to take the
fast pass
Eventually we could take this a step further and improve the
performance of the failure case. That would require parsing
the output of the bulk run in order to avoid the individual
runs on all files, and only check for the previous version
of the files that indeed required formatting changes.
Fixes https://github.com/dart-lang/sdk/issues/54864
Change-Id: I0cfbd84f6c62eca48ac91449599ef9ac4c1800f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352740
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
* Force depot_tools to use python3 results (USE_PYTHON3=True).
* Fixes the dart format presubmit check.
* Remove broken DOM tools presubmit check.
TEST=Manually provoked errors and ran git cl presubmit -v -f.
Cq-Include-Trybots: luci.dart.try.shared:presubmit-try
Change-Id: I8ba46e2ae1640f1b2f82e18bc8024e0aa4838b2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210123
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: William Hesse <whesse@google.com>
This reverts commit a2ceec3e25.
Reason for revert: presubmit hooks are run very early (before CL description is edited), which breaks common workflows.
Original change's description:
> Require that all changes to VM have TEST line
>
> All changes touching one of the following directories will after this
> change be required to contain TEST= line.
>
> runtime/vm
> runtime/bin
> runtime/lib
> runtime/include
> runtime/observatory
> runtime/observatory_2
> runtime/platform
> sdk/lib/_internal/vm
> pkg/vm
>
> This line is supposed to describe in free form how change was validated,
> for example by listing existing or newly added tests.
>
> The goal behind this requirement is to remind both reviewer and change
> author that changes to the code base are in general expected to be
> covered by tests, especially when CL is addressing a regression which
> slipped through existing testing.
>
> Having TEST line in the description would allow both author and
> reviewer to take additional time to consider if validation was
> sufficient or additional test coverage is needed.
>
> The inspiration for this line comes from Chromium[1].
>
> [1] https://chromium.googlesource.com/chromiumos/docs/+/master/contributing.md#describe-testing-performed
>
> TEST=changed file in runtime/vm and run git cl presubmit
>
> Change-Id: Ie16cf7c14af18e3a22a17084c0aebb4d1dfd6d23
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169640
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
TBR=vegorov@google.com,kustermann@google.com,asiva@google.com
Change-Id: Ib2e198c322447e8d1166d5d05b2f3209d168f1e9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169887
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
All changes touching one of the following directories will after this
change be required to contain TEST= line.
runtime/vm
runtime/bin
runtime/lib
runtime/include
runtime/observatory
runtime/observatory_2
runtime/platform
sdk/lib/_internal/vm
pkg/vm
This line is supposed to describe in free form how change was validated,
for example by listing existing or newly added tests.
The goal behind this requirement is to remind both reviewer and change
author that changes to the code base are in general expected to be
covered by tests, especially when CL is addressing a regression which
slipped through existing testing.
Having TEST line in the description would allow both author and
reviewer to take additional time to consider if validation was
sufficient or additional test coverage is needed.
The inspiration for this line comes from Chromium[1].
[1] https://chromium.googlesource.com/chromiumos/docs/+/master/contributing.md#describe-testing-performed
TEST=changed file in runtime/vm and run git cl presubmit
Change-Id: Ie16cf7c14af18e3a22a17084c0aebb4d1dfd6d23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169640
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This CL ensures that the presubmit check will complain if newly added
tests were only added to NNBD suite but not to non-NNBD (or vice versa).
Also add ffi test suites to the list of checked directories.
Change-Id: I090064b99e5ca30444ab53edf1f262572f60beb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149426
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
I recently added this presubmit to verify changes get replicated
between versions of the SDK and the paths of the current SDK
didn't get created correctly causing it to warn even when you
correctly replicated the changes.
Change-Id: If69e0375dfe097e0210c4249d77b49f0c3537a2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143640
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This only validates that if a test and its fork exist that the CL
touches both. There are lots of other cases we could imagine checking
like if you *add* a new test on one side, you should one on the other.
But those are likely to have a lot of false positives now while the
migration is happening and new NNBD tests are being written.
So for now, this just tries to check that tests that have been forked
at least don't diverge. It's a start.
Change-Id: Id6a9c39699a510da1a4a4702879210f94cd69c26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131945
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
- Removes the load port functionality from the service isolate, this was
used to load sources in Dart 1 and is pretty much dead code in Dart 2
- Moves resolution of URIs and Package URI (based on package map) to the
individual isolates instead of sending a request to the service isolate
- Setups the package map lazily as it is needed only if resolveURI is
called in Dart code, it is not needed for loading/compiling sources
(this is now done in the front end).
- Removed Dart_ServiceWaitForLoadPort() methods from the Dart C API as
it is not used anywhere.
Change-Id: I6c3704bc431bdcd49bf074eb58bee1ed492ccccb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129742
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>