This removes all implicit casts and many implicit uses of dynamic. It
adds a gratuitous number of explicit "as" casts and arguably makes the
code worse.
This is an interim step towards replacing the big configuration map
with an actual typed object. These "as" casts should help catch places
where the configuration object is being used and where the code will
need to be changed to use a new object.
R=sigmund@google.com
Review-Url: https://codereview.chromium.org/2903703002 .
This doesn’t touch the resulting configuration map, which is what this
is leading up to, but it cleans up the specification and parsing of the
options and removes a lot of redundancy.
Behavior should be the same as it was before, except that all options
now allow both their underscore-separated and hyphen-separated names.
So this is now valid:
test.py --hot_reload --append-logs
Where before, you use to have to do --hot-reload (OK) and
--append_logs (bad, since almost all other options expect hyphens).
R=sigmund@google.com
Review-Url: https://codereview.chromium.org/2902023002 .
This reverts commit f62a2a9562.
Commit above [expectedly] broke runtime/vm tests since it uses DFE
instead of vm parser, but I didn't realize we actually test -cdartk
configuration. This has to be resubmitted with status file update to
mark 235 vm tests failing with DFE.
TBR=siva
BUG=
Review-Url: https://codereview.chromium.org/2901733002 .
This has a few advantages:
- We can track dependencies more precisely
- ninja can assemble things in parallel as they're ready rather than
sequentially all at once.
- It is easier to customize SDKs depending on target platform, e.g.
Fuchsia.
This CL also has a number of cleanups:
- Defining is_fuchsia and is_fuchsia host so we don't always have to check
- Piping through toolchain overrides in more places
- Fixing bugs in copy_tree.py, not using list_files.py, which is broken on Windows
related #29558R=whesse@google.com
Review-Url: https://codereview.chromium.org/2848943003 .
- Separate out parsing a status file from applying the environment to
determine which sections are active. This makes it possible to, for
example, generate expectation sets for multiple environments without
having to reparse each time.
- Simplify expression parsing. Remove set expressions since they weren't
used for anything useful. A test's expectations are a simple
comma-separated list and don't need anything beyond that. Merge
Scanner and Tokenizer since the latter was a glorified function.
- Make more names private so that it's clearer what's used outside of
various libraries.
- Generally modernize the style.
- Add *lots* of documentation.
Again, there should be no behavioral changes. I ran:
./tools/test.py -m release,debug -c none,dart2js,dart2analyzer -r none,vm,d8 corelib
Before and after the change and verified that the output was the same
(aside from timing).
R=sigmund@google.com
Review-Url: https://codereview.chromium.org/2891753003 .
- Make the parser less error tolerant. The expression parser used to
ignore any unrecognized tokens, which means a status like
"RuntimeError CompileError" (not the missing comma) was parsed as
simply "RuntimeError", which seems bad. Now it reports an error.
Fixed a couple of status files that thought they were setting statuses
that they weren't (!).
- Separate out parsing a status file from applying the environment to
determine which sections are active. This makes it possible to, for
example, generate expectation sets for multiple environments without
having to reparse each time.
- Simplify expression parsing. Remove set expressions since they weren't
used for anything useful. A test's expectations are a simple
comma-separated list and don't need anything beyond that. Merge
Scanner and Tokenizer since the latter was a glorified function.
- Make more names private so that it's clearer what's used outside of
various libraries.
- Generally modernize the style.
- Add *lots* of documentation.
Again, there should be no behavioral changes. I ran:
./tools/test.py -m release,debug -c none,dart2js,dart2analyzer -r none,vm,d8 corelib
Before and after the change and verified that the output was the same
(aside from timing).
BUG=
R=whesse@google.com
Review-Url: https://codereview.chromium.org/2875203005 .
This doesn't get rid of all implicit dynamic and casts, but it covers
many of them.
Also did some minor modernization when I noticed it:
- Using "var" for local variables where inference does the right thing.
- camelCase for variable names.
- More collection literals.
There are (or should be!) zero behavioral changes.
R=whesse@google.com
Review-Url: https://codereview.chromium.org/2863253002 .
We can't have the [data] and [source] getters typed as Object.
This causes it to appear that all DOM types are instantiated.
I have modelled the annotations after the same getters from
MessageEvent.
TBR=jacobr@google.com
BUG=
Review-Url: https://codereview.chromium.org/2879763002 .
This fixes two warnings in analyze_api_test:
R=jacobr@google.com
sdk/lib/html/dart2js/html_dart2js.dart:41478:31:
Warning: The getter '_namespaceUri' is not defined for the class 'Node'.
bool _matches(Node node) => node._namespaceUri == null;
^^^^^^^^^^^^^^^^^^
sdk/lib/html/dart2js/html_dart2js.dart:41514:31:
Warning: The getter '_namespaceUri' is not defined for the class 'Node'.
bool _matches(Node node) => node._namespaceUri == _namespace;
^^^^^^^^^^^^^^^^^^
Review-Url: https://codereview.chromium.org/2875183002 .
This CL computes the correct input and output in the copy_tree GN template by
modifying tools/copy_tree.py to perform a dry-run that lists the files to be copied.
Also, shutil.copytree uses shutil.copy2 to copy files and their metadata, but copying
the metadata appears to confuse ninja dependency tracking.
To do the dry run and to use shutil.copy instead of shutil.copy2, copy_tree.py now
uses its own CopyTree function instead of shutil.copytree.
R=whesse@google.com
Review-Url: https://codereview.chromium.org/2875893002 .
Instead of maintaining two very similar python scripts, this change
copies the binaries they were forwarding to to the location expected
by git cl format and depot_tools.
R=aam@google.com
Review-Url: https://codereview.chromium.org/2871673003 .
Remove hack in bin/snapshot_utils.cc that avoided building a true app-jit snapshot for ARM, ARM64 and MIPS because of the multiple invocations above.
Add GN flags to choose to build script snapshots instead of app-jit snapshots, avoiding a slow training run inside a simulator.
Fixes#29580.
R=zra@google.com
Review-Url: https://codereview.chromium.org/2871713002 .
Make GN run for Android configurations on supported host platforms
on a gclient runhooks. This should fix the vm-precomp-android-* bots
Review-Url: https://codereview.chromium.org/2861363002 .
Flutter uses the same clang toolchain as Fuchsia. This CL puts Dart
on that toolchain, as well. This roll should entail no changes to
glibc version requirements on Linux.
The Fuchsia buildtools distribute clang-format with the toolchain
rather than separately, so this CL introduces forwarding scripts
that are copied to the right place under //buildtools.
This CL sets the default for the number of workers in //tools/gn.py
to 1, as the newer GN version fails occasionally when run
concurrently with other invocations.
As Flutter does, this CL uses the clang toolchain to build for
Android. Thus, it is now possible to build for Android on MacOS.
This change is a prerequisite for assembling the SDK in GN
rather than with a python script:
https://codereview.chromium.org/2848943003/
and will be nicer for making prebuilt SDKs for Fuchsia.
Resubmitting this with the following fixes:
1. Rolls further forward to get past a GN bug
2. Fixes the Android build.
3. Style cleanups in gn.py
Review-Url: https://codereview.chromium.org/2858873005 .
Stuff like:
- Use core lib methods like padLeft() now that they exist.
- Use collection literals (!).
- Use getters where appropriate.
- Make Formatter enum-like since it has no interesting instance state.
R=whesse@google.com
Review-Url: https://codereview.chromium.org/2855073002 .
This reverts commit 6bf2c800fd.
There is still some strangeness with the new GN binary not wanting
to do an incremental build on top of a build that used an old GN
binary.
Review-Url: https://codereview.chromium.org/2861903002 .
Flutter uses the same clang toolchain as Fuchsia. This CL puts Dart
on that toolchain, as well. This roll should entail no changes to
glibc version requirements on Linux.
The Fuchsia buildtools distribute clang-format with the toolchain
rather than separately, so this CL introduces forwarding scripts
that are copied to the right place under //buildtools.
This CL sets the default for the number of workers in //tools/gn.py
to 1, as the newer GN version fails occasionally when run
concurrently with other invocations.
As Flutter does, this CL uses the clang toolchain to build for
Android. Thus, it is now possible to build for Android on MacOS.
This change is a prerequisite for assembling the SDK in GN
rather than with a python script:
https://codereview.chromium.org/2848943003/
and will be nicer for making prebuilt SDKs for Fuchsia.
Review-Url: https://codereview.chromium.org/2855283002 .
This reverts commit cc968ca45b.
This CL will have to be relanded in two pieces so that the
update to tools/gn.py lands before the unmodified version
can invoke the updated GN binary.
Review-Url: https://codereview.chromium.org/2855973006 .
Flutter uses the same clang toolchain as Fuchsia. This CL puts Dart
on that toolchain, as well. This roll should entail no changes to
glibc version requirements on Linux.
The Fuchsia buildtools distribute clang-format with the toolchain
rather than separately, so this CL introduces forwarding scripts
that are copied to the right place under //buildtools.
This CL sets the default for the number of workers in //tools/gn.py
to 1, as the newer GN version fails occasionally when run
concurrently with other invocations.
As Flutter does, this CL uses the clang toolchain to build for
Android. Thus, it is now possible to build for Android on MacOS.
This change is a prerequisite for assembling the SDK in GN
rather than with a python script:
https://codereview.chromium.org/2848943003/
and will be nicer for making prebuilt SDKs for Fuchsia.
R=whesse@google.com
Review-Url: https://codereview.chromium.org/2854583002 .
This is mainly so that all of the code relating to test.dart is in one
directory tree so things like "Find All Usages" work a little better.
It felt weird to me to have a .dart file two directories up importing a
bunch of stuff within "testing/dart/".
Also cleaned up the affected code since it could use a little love. I'm
working on getting test.dart running DDC tests, but from poking around,
it seems like it could use some housekeeping as well.
R=vsm@google.com, whesse@google.com
Review-Url: https://codereview.chromium.org/2848103002 .
- defines a .gn target for patched_dart2js_sdk
- changes patch_sdk.dart to handle a dart2js target
- adds support in fasta to understand the `native` clause still used by dart2js
- add option to fasta to know whether it is generating kernel for the vm or dart2js
I'm not excited about how I added the target distinction in fasta, the reason I
did so is that it affects the behavior in several ways: in how we handle
`native`, in the libraries that are included by default in the platform.dill file,
and in the transformations that need to be done. I'm happy to change the
approach.
BUG=
R=ahe@google.com, vegorov@google.com, zra@google.com
Committed: 714523b103
Review-Url: https://codereview.chromium.org/2832353002 .
- defines a .gn target for patched_dart2js_sdk
- changes patch_sdk.dart to handle a dart2js target
- adds support in fasta to understand the `native` clause still used by dart2js
- add option to fasta to know whether it is generating kernel for the vm or dart2js
I'm not excited about how I added the target distinction in fasta, the reason I
did so is that it affects the behavior in several ways: in how we handle
`native`, in the libraries that are included by default in the platform.dill file,
and in the transformations that need to be done. I'm happy to change the
approach.
BUG=
R=ahe@google.com, vegorov@google.com
Review-Url: https://codereview.chromium.org/2832353002 .
"bin" is part of the public API of a package, private tools can go under the
`tool` folder. This allows us to use a dev_dependency on analyzer without
exposing a broken import publicly.
I've only moved `dartk` so far (which I expect will be removed once we have a
better API for front_end.
R=asgerf@google.com, kmillikin@google.com
Review-Url: https://codereview.chromium.org/2842643002 .
1. A --platform flag is added to dart to give a path to a Kernel
binary for the platform libraries (as produced by building the
runtime_kernel target).
2. This binary is used for bootstrapping. Since it contains libraries
other then the VM's bootstrap libraries, they are also loaded.
3. The frontend does not send any library with a dart: import URI
scheme. Note that it does not (yet) prune the canonical name
table, which will contain a lot of unnecessary names used for
internal linkages in the platform libraries.
4. There is a single dependency in the platform libraries on the
script: _getMainClosure in dart:_builtin. This is patched after
the script is loaded.
BUG=
R=ahe@google.com, kustermann@google.com, vegorov@google.com
Review-Url: https://codereview.chromium.org/2786083002 .
toolchain_prefix was not correctly propagated everywhere it needed to
go. This CL also adds an error to build.py if someone tries to use
--toolchain as it is not supported there.
R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2797303005 .
Instructs the linker not to attempt generating _eh_frame from the DWARF info, avoiding warnings like
R=vegorov@google.com
ld: warning: could not create compact unwind for _kDartVmSnapshotInstructions: register saved more than once (might be shrink wrap)
Review-Url: https://codereview.chromium.org/2784253003 .
Update all tests
Support //# multitests for better dartfmt compatibility and fewer multitest false positives
All files under tests were manually updated with
find . -iregex '.*\.dart$' -print0 | xargs -0 perl -pi -e 's/(\S\s+)\/\/\/ /$1\/\/# /'
For now both old and new styles are allowed to accommodate CO19 tests.
R=efortuna@google.com
BUG=
Review-Url: https://codereview.chromium.org/2765693002 .
Review-Url: https://codereview.chromium.org/2765893003 .
Support //# multitests for better dartfmt compatibility and fewer multitest false positives
All files under tests were manually updated with
find . -iregex '.*\.dart$' -print0 | xargs -0 perl -pi -e 's/(\S\s+)\/\/\/ /$1\/\/# /'
For now both old and new styles are allowed to accommodate CO19 tests.
R=efortuna@google.com
Review-Url: https://codereview.chromium.org/2765693002 .
Helping to solve a silly little problem that I've experienced many
times: If you learn that there is a problem with a buildbot shard like
'dart2js-linux-drt-2-2-be' it may not be obvious that it should be
found on the buildbot status page (go/darto) in the group 'chrome'.
I didn't really know any other way than hovering the mouse over a few
dozen areas on that web page, hoping that one of them showed that
shard name as a tool tip.
This CL adds a small script, 'bin/shard2group.dart' to the 'gardening'
package, which will find the group from any given (partial) shard
name. For instance:
> dart bin/shard2group.dart noopt [16:00]
vm-precomp(1): vm-noopt-simarm64-mac-be
vm-precomp-dev(1): vm-noopt-simarm64-mac-dev
vm-precomp-stable(1): vm-noopt-simarm64-mac-stable
The number indicates the placement of this shard in the group.
The script 'bin/create_shard_groups.dart' transforms the source code
for the buildbot web page to the source code for a Dart part file
which provides 'bin/shard2group.dart' with the concrete data on the
build bots and their shards.
R=johnniwinther@google.com
Review-Url: https://codereview.chromium.org/2756193002 .
* basic cleanup to home-brew script
* avoid global variables
* Up a more typical package layout
* add generate binary – make it easy to test the output without dealing with git
* Update output to pass brew audit `brew audit --strict --online dart.rb`
In Debug mode we have assertions checking that we don't attempt OSR when
FLAG_use_osr is disabled - however app-jit snapshots are compiled with OSR
enabled and still contain countining and OSR attempting code, which causes
assertions to fail.
Refactor how getters for isolate flags are defined, consolidate all flags into
a single list.
Update test expectations and switch -c dartk configuration to use app-jit snapshot.
BUG=
R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2728163002 .
This CL adds a script tools/ninja.py that runs Goma enabled builds
in parallel. Non-goma builds are run serially, as before.
Conflating this feature with gyp support in tools/build.py
got to be a bit of a mess, which is why this is split off as a
separate script. This script can replace build.py after gyp support
is removed.
With a warm goma:
$ time ./tools/build.py -m debug,release -a x64,ia32 runtime runtime_precompiled
...
real 4m25.627s
user 3m30.740s
sys 1m3.873s
$ ./tools/ninja.py -m debug,release -a x64,ia32 runtime runtime_precompiled
...
The build took 108.900 seconds
R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2712743009 .