Commit graph

32 commits

Author SHA1 Message Date
Ryan Macnak d89e42bef5 [vm] Rename clustered_snapshot.h/cc to app_snapshot.h/cc.
Since bbefc05748, both serialization formats in the VM are based on clustering. The distinguishing feature of the older clustered serializer is that it represents apps/programs rather than messages.

TEST=ci
Change-Id: If3185c21c6aadeec61a940b12ba23d17f2752761
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211501
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-09-16 00:13:34 +00:00
Ryan Macnak bbefc05748 [vm] Rewrite isolate message serialization.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/25559
Bug: https://github.com/dart-lang/sdk/issues/27285
Bug: https://github.com/flutter/flutter/issues/84691
Change-Id: I04608c5d337144195748d5f3509a29eb3116585d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207865
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-07-29 16:55:55 +00:00
Alexander Thomas b5c63ce757 [infra] Migrate scripts to python3
* Migrate to python3; drop python support.
* Update Windows toolchain support.
* Remove some unused methods.
* Python 2.7 is still needed on Windows.
* Update gsutil to a version that supports python3.

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

TEST=Manually tested common user journeys.

Change-Id: I663a22b237a548bb82dc2e601e399e3bc3649211
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192182
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-04-15 10:10:20 +00:00
Vyacheslav Egorov 566fd8af36 [vm] Tweak version.cc generation
Actuallly generate null SDK hash in version.cc when verify_sdk_hash
is set to false. Previously it also required setting dart_version_git_info
to false.

R=cskau@google.com

Change-Id: Ib81757c898507029c499c7c3fa17a86b3375d25b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161701
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2020-09-03 10:00:24 +00:00
asiva 930e50964d [SDK] - Remove support for option '--custom-for-pub' in make_version.py
Bug:42820
Change-Id: I773c09790cdb97edbd4b5ebc75c1746d50d80d2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155681
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-08-26 03:46:33 +00:00
Liam Appelbe 79cec0e864 [vm] Delete ABI infrastructure
Change-Id: I26d455d96c87010293a6dcb9f6c0eecfcaf3c816
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157102
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-08-06 19:55:12 +00:00
Clement Skau 0ce83987d6 Reland "[SDK] Adds an SDK hash to kernels and the VM."
Note: This is a reland of https://dart-review.googlesource.com/c/sdk/+/150343

Adds a new SDK hash to kernels and the VM which is optionally checked
to verify kernels are built for the same SDK as the VM.
This helps catch incompatibilities that are currently causing
subtle bugs and (not so subtle) crashes.

The SDK hash is encoded in kernels as a new field in components.
The hash is derived from the 10 byte git short hash.

This new check can be disabled via:
  tools/gn.py ... --no-verify-sdk-hash

This CL bumps the min. (and max.) supported kernel format version,
making the VM backwards incompatible from this point back.

This also bumps the min. and current ABI version.

Bug: https://github.com/dart-lang/sdk/issues/41802
Change-Id: I2f85945045a603eb9dcfd1f2c0d0d024bd84a956
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152802
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-07-07 06:08:20 +00:00
asiva bb8d145616 Revert "[SDK] Adds an SDK hash to kernels and the VM."
This reverts commit edde575dcd.

Reason for revert: Breaks the Dart to Flutter roll and golem

Original change's description:
> [SDK] Adds an SDK hash to kernels and the VM.
>
> Adds a new SDK hash to kernels and the VM which is optionally checked
> to verify kernels are built for the same SDK as the VM.
> This helps catch incompatibilities that are currently causing
> subtle bugs and (not so subtle) crashes.
>
> The SDK hash is encoded in kernels as a new field in components.
> The hash is derived from the 10 byte git short hash.
>
> This new check can be disabled via:
>   tools/gn.py ... --no-verify-sdk-hash
>
> This CL bumps the min. (and max.) supported kernel format version,
> making the VM backwards incompatible from this point back.
>
> Bug: https://github.com/dart-lang/sdk/issues/41802
> Change-Id: I3cbb2d481239ee64dafdaa0e4aac36c80281931b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150343
> Commit-Queue: Clement Skau <cskau@google.com>
> Reviewed-by: Jens Johansen <jensj@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=kustermann@google.com,jensj@google.com,cskau@google.com

Change-Id: I34cc7d378e2babdaaca4d932d19c19d0f35422fc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/41802
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152703
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-06-26 18:54:17 +00:00
Clement Skau edde575dcd [SDK] Adds an SDK hash to kernels and the VM.
Adds a new SDK hash to kernels and the VM which is optionally checked
to verify kernels are built for the same SDK as the VM.
This helps catch incompatibilities that are currently causing
subtle bugs and (not so subtle) crashes.

The SDK hash is encoded in kernels as a new field in components.
The hash is derived from the 10 byte git short hash.

This new check can be disabled via:
  tools/gn.py ... --no-verify-sdk-hash

This CL bumps the min. (and max.) supported kernel format version,
making the VM backwards incompatible from this point back.

Bug: https://github.com/dart-lang/sdk/issues/41802
Change-Id: I3cbb2d481239ee64dafdaa0e4aac36c80281931b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150343
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-06-26 13:35:42 +00:00
Alexander Thomas 8350f423ee [vm] Add the channel name to the VM/dart:io version string
Dev and beta version strings will look very look very similar, so adding
the channel name will make it easy for users to see if they are on be,
dev, beta, or stable. This will change both the output of
`dart --version` as well as the value of `Platform.version`.

This also removes the Flutter stable release version hack.

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

Change-Id: Iceb8e84a9cf4d0bfb7659669878e42d0a59febc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140287
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2020-03-23 10:00:03 +00:00
Alexander Thomas 1392d61c9b [infra] Modify 2.7.0 make_version hack so that it also works on other branches
The logic only worked on the 'be' branch but if Flutter uses a dev branch hash
they would get a dev release version rather than the hardcoded 2.7.0 version.

Change-Id: I6be3b3a115a10dfb6e2a6d1407d27f96c6d88396
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126823
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-12-02 18:56:41 +00:00
Wink Saville bbdb7860f6 [build]: Build on Arch Linux with python 2.7-3.8
This change allow builds to succeed on Arch Linux with python 2.7, 3.7.4
and 3.8. Otherwise it fails with python 3.7.4 and 3.8.

- bin_to_assembly.py

  Using ord(byte) here is an error on python 3.x use a conditional
  expression instead.

- create_archive.py

  Using ord(byte) here is an error on python 3.x use a conditional
  expression instead.

  Use `as inst` syntax which is required by 3.x

- create_string_literal.py
- gen_library_src_paths.py

  Use `as inst` syntax which is required by 3.x

- make_version.py

  print >> sys.stderr syntax is not supported by 3.x use file=sys.stderr
  and add `from __future__ import print_function`

  vmhash.update requires a string use encode('utf-8')

  versopm+cc+text.replace requires a str so use `decode`.

Test: No added tests as there are no behavioral changes.
Change-Id: Id9b0a3187d06ad2b2dce3cf2244144393caddc9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124211
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2019-11-10 21:09:58 +00:00
Alexander Thomas d2bd6df607 [infra] Update make_version.py hack for Flutter for 2.7.0
This prolongs the make_version.py hack for Flutter for the 2.7.0 Dart
release.

Change-Id: Ic8324461b195be65a7c3afd3bb34c7f186b29657
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122501
Reviewed-by: Siva Annamalai <asiva@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2019-11-04 11:33:43 +00:00
Alexander Thomas e2fdff1009 [infra] Add hack to hardcode version to 2.5.0 for Flutter 1.9
This adds a temporary hack causing make_version.py to report 2.5.0 if
the VERSION file's major.minor.patch = 2.5.0 and the channel is be and
--custom_for_pub = flutter. As soon as the VERSION file is bumped on
master, the hack will become a no-op and can be removed.

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

Change-Id: Icaff27e35686dfe4c69c17f7edbcf57b6fdf6ae2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113187
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-08-16 23:10:20 +00:00
Nate Bosch 55f81f2210 Mass format python with yapf
- Add `.style.yapf` with configuration to use Google style.
- Run `yapf` on all `.py` files in this repo.
- Manually fix one trailing space in a doc string.
- Run `git cl format runtime` to satisfy presubmit.

Change-Id: I7e6bd11e91f07926b9188362599af398551eed79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111600
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2019-08-05 20:34:31 +00:00
Alexander Thomas 73e2f469f8 [infra] Always produce a proper Dart version string on release channels
Previously, if --custom_for_pub was used we used the latest dev tag.
This "best effort" for Dart rolls from bleeding edge, but doesn't make
sense when rolling from other channels that have a proper version in the
VERSION file.

Change-Id: Icaf6c26858d9fd2132d26b7d64da21b3a05f0092
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105763
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-06-12 18:24:03 +00:00
Keerti Parthasarathy d9dccc3b0f Pass in no_git_hash option to utils.py when computing version
Change-Id: I744aa2475572cd76c2567fd7ecddaffc727c0a98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103941
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2019-05-28 22:27:47 +00:00
Keerti Parthasarathy b378eef54a Add a option to pass in version file to tools
Change-Id: I3b7224b108cdb8693d17da90d499c0648f140bc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100721
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2019-04-29 16:40:50 +00:00
Joseph Richey 86fe7ca75c Fix build when python=python3
Right now most of the dart SDK's python is compatible with python2
or python3. This change fixes a few of the build scripts to make
that completely true (at least when building the standard build on
Linux). There are only four types of changes:
  - Bare `print` statements now use the `print ()` function
  - `commands.getoutput` becomes `subprocess.check_output` with `shell=True`
  - `xrange` becomes `range`
  - `print >> sys.stderr` becomes `sys.stderr.write`

Starts work on addressing (but does not completely fix):
https://github.com/dart-lang/sdk/issues/28793

See related issue:
https://fuchsia-review.googlesource.com/c/fuchsia/+/272925

This change applys to both the `dev` and `master` branches.

Change-Id: Ibd3eb9b1f57520d2d745f05c2ac430b1d20943da

Closes #36662
https://github.com/dart-lang/sdk/pull/36662

GitOrigin-RevId: beab165294982a7e369daf6d61aea63efcab1b9b
Change-Id: I6d240749a9ba0889b5a45a08f3c4c2c20291f484
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99707
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2019-04-23 07:48:15 +00:00
Liam Appelbe cc455ecc1d Add use_abi_version flag, and plumb ABI version to version.h
Bug: https://github.com/dart-lang/sdk/issues/36047
Change-Id: Ie810cbd5079e1939bf190e06f6c2494bb4ab0805
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95282
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-03-05 17:16:11 +00:00
Zach Anderson 7d7e39a952 [build] Move dart2js run for Observatory from python to GN
Change-Id: Ief90d6125e30c6bed808bacce521fc84957fddb9
Reviewed-on: https://dart-review.googlesource.com/63662
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-07-03 22:50:16 +00:00
Zach Anderson 0b4f01f759 [infra] Fixes to custom version string
related https://github.com/flutter/flutter/issues/14751

Change-Id: Id11048777e9e27fc63b94bc49c45e575b4333d24
Reviewed-on: https://dart-review.googlesource.com/42460
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-02-20 17:53:06 +00:00
Zach Anderson 0d5cf900b0 [infra,flutter] Adds semantically meaningful custom version strings
See https://github.com/flutter/flutter/issues/14751

Change-Id: I3b35c2a32c0dd1301e92abe23b1c6fe2c2e04a6c
Reviewed-on: https://dart-review.googlesource.com/42026
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-02-16 20:44:48 +00:00
Zachary Anderson f4758727dc [infra] Add a GN flag to omit git information
After Clang 6.0, changing the value of a single string can change the
order of symbols in the .rodata section. This confuses Golem's
checks for the equivalence of two binaries.

This change adds a GN flag to omit the git hash and commit time from
the Dart VM's version string to avoid re-running Golem benchmarks on
commits where the only VM change is in the version string.

To use it, pass --gn-args="dart_version_git_info=false" to gn.py

Change-Id: I8134714d50e3c9b6dae750a515dc3c2228d76b53
Reviewed-on: https://dart-review.googlesource.com/33000
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-01-08 18:29:44 +00:00
Ryan Macnak d366f9619a [vm] Toward deterministic builds.
- Remove random build-id.
 - Replace build time in embedded version string with commit time.
 - Remove timestamps from Observatory tarball.
 - Zero-initialize skipped bytes in snapshot streams.
 - Fix uninitialized fields in PatchClass, Script and Library.
 - Disable (under flag) random identity hashes and concurrent GC.

Bug: https://github.com/dart-lang/sdk/issues/31427
Change-Id: I3e95de679c8372841cd27ca60df78d9b00ffbfe1
Reviewed-on: https://dart-review.googlesource.com/22901
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-11-23 00:07:56 +00:00
Ryan Macnak f58c5bb78a [vm] Make the snapshot hash depend on the cluster and image snapshot sources.
Change-Id: I0f743fe82e2f47e9cccfabfe2a68ee4651ae6156
Reviewed-on: https://dart-review.googlesource.com/19801
Reviewed-by: Zach Anderson <zra@google.com>
2017-11-10 00:13:30 +00:00
Zachary Anderson 87e1fc7859 Add #! lines and +x scripts run by the build system
Landing https://codereview.chromium.org/2151053002/ for jamesr.

Review URL: https://codereview.chromium.org/2152913002 .
2016-07-14 12:46:57 -07:00
ricow@google.com 77982f1fa9 Add support for ignoring the svn revision when getting the version, use this for gn build
R=zra@google.com
BUG=

Review URL: https://codereview.chromium.org//884523003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43297 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-29 16:55:08 +00:00
zra@google.com fe36ebadab Disables printing a version string to the console for GN build.
R=ricow@google.com

Review URL: https://codereview.chromium.org//850053005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43041 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-21 15:18:23 +00:00
zra@google.com 3dfb90f59f Checks snapshot validity using a hash of source file instead of a version string.
R=asiva@google.com, iposva@google.com

Review URL: https://codereview.chromium.org//558503002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40009 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-09 01:44:48 +00:00
whesse@google.com c7d5711688 Build Tools Cleanup
Cleans up Python Code in Build Tools

TEST: build everything and run tests
BUG: https://code.google.com/p/dart/issues/detail?id=19592

R=ricow@google.com

Review URL: https://codereview.chromium.org//350483003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38573 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-25 11:47:59 +00:00
kustermann@google.com 42813dffe6 Move runtime/tools/make_version.py to tools/ and use GetVersion from utils.py
Currently runtime/tools/make_version.py creates the version string itself.
Since this is already done in tools/release/version.dart, we should use
that. tools/utils.py provides a python wrapper around it with GetVersion().

Review URL: https://codereview.chromium.org//11440010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15769 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-06 08:52:32 +00:00