Version 2.15.0-18.0.dev
Merge commit 'd2bd43f43e6636036a3d250eadcd429c444b7540' into 'dev'
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index ec4e5d2..6662d2e 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
@@ -10,11 +11,14 @@
import imp
import os
import os.path
+from typing import Callable
import scm
import subprocess
-import tempfile
import platform
+USE_PYTHON3 = True
+
+
def is_cpp_file(path):
return path.endswith('.cc') or path.endswith('.h')
@@ -68,7 +72,7 @@
identification,
extension,
windows,
- hasFormatErrors,
+ hasFormatErrors: Callable[[str, str], bool],
should_skip=lambda path: False):
local_root = input_api.change.RepositoryRoot()
upstream = input_api.change._upstream
@@ -105,7 +109,6 @@
def _CheckDartFormat(input_api, output_api):
local_root = input_api.change.RepositoryRoot()
- upstream = input_api.change._upstream
utils = imp.load_source('utils',
os.path.join(local_root, 'tools', 'utils.py'))
@@ -119,7 +122,7 @@
print('WARNING: dart not found: %s' % (dart))
return []
- def HasFormatErrors(filename=None, contents=None):
+ def HasFormatErrors(filename: str = None, contents: str = None):
# Don't look for formatting errors in multitests. Since those are very
# sensitive to whitespace, many cannot be formatted with dartfmt without
# breaking them.
@@ -135,11 +138,12 @@
'--set-exit-if-changed',
'--output=none',
'--summary=none',
- filename,
]
-
- process = subprocess.Popen(
- args, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
+ if contents:
+ process = subprocess.run(args, input=contents, text=True)
+ else:
+ args.append(filename)
+ process = subprocess.run(args)
# Check for exit code 1 explicitly to distinguish it from a syntax error
# in the file (exit code 65). The repo contains many Dart files that are
@@ -158,8 +162,8 @@
output_api.PresubmitError(
'File output does not match dartfmt.\n'
'Fix these issues with:\n'
- '%s -w%s%s' % (prebuilt_dartfmt, lineSep,
- lineSep.join(unformatted_files)))
+ '%s format %s%s' %
+ (dart, lineSep, lineSep.join(unformatted_files)))
]
return []
@@ -167,7 +171,6 @@
def _CheckStatusFiles(input_api, output_api):
local_root = input_api.change.RepositoryRoot()
- upstream = input_api.change._upstream
utils = imp.load_source('utils',
os.path.join(local_root, 'tools', 'utils.py'))
@@ -188,9 +191,7 @@
def HasFormatErrors(filename=None, contents=None):
args = [dart, lint] + (['-t'] if contents else [filename])
- process = subprocess.Popen(
- args, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
- process.communicate(input=contents)
+ process = subprocess.run(args, input=contents, text=True)
return process.returncode != 0
def should_skip(path):
@@ -230,12 +231,8 @@
dart = utils.CheckedInSdkExecutable()
generate = os.path.join(local_root, 'tools', 'generate_package_config.dart')
cmd = [dart, generate, '--check']
- pipe = subprocess.Popen(cmd,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- shell=utils.IsWindows())
- output = pipe.communicate()
- if pipe.returncode != 0:
+ result = subprocess.run(cmd, shell=utils.IsWindows())
+ if result.returncode != 0:
return [
output_api.PresubmitError(
'File .dart_tool/package_config.json is out of date.\n'
@@ -255,7 +252,7 @@
try:
input_api.subprocess.check_output(['gclient', 'verify'])
return []
- except input_api.subprocess.CalledProcessError, error:
+ except input_api.subprocess.CalledProcessError as error:
return [
output_api.PresubmitError(
'DEPS file must have only dependencies from allowed hosts.',
diff --git a/pkg/_fe_analyzer_shared/PRESUBMIT.py b/pkg/_fe_analyzer_shared/PRESUBMIT.py
index 1a4331d..7059280 100644
--- a/pkg/_fe_analyzer_shared/PRESUBMIT.py
+++ b/pkg/_fe_analyzer_shared/PRESUBMIT.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
@@ -11,6 +12,8 @@
import os.path
import subprocess
+USE_PYTHON3 = True
+
def runSmokeTest(input_api, output_api):
hasChangedFiles = False
diff --git a/pkg/front_end/PRESUBMIT.py b/pkg/front_end/PRESUBMIT.py
index 8f25cd2..0a04904 100644
--- a/pkg/front_end/PRESUBMIT.py
+++ b/pkg/front_end/PRESUBMIT.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
@@ -11,6 +12,8 @@
import os.path
import subprocess
+USE_PYTHON3 = True
+
def runSmokeTest(input_api, output_api):
hasChangedFiles = False
diff --git a/pkg/kernel/PRESUBMIT.py b/pkg/kernel/PRESUBMIT.py
index ee42fc8..8630f20 100644
--- a/pkg/kernel/PRESUBMIT.py
+++ b/pkg/kernel/PRESUBMIT.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
@@ -11,6 +12,8 @@
import os.path
import subprocess
+USE_PYTHON3 = True
+
def runSmokeTest(input_api, output_api):
hasChangedFiles = False
diff --git a/runtime/PRESUBMIT.py b/runtime/PRESUBMIT.py
index 210b951..2077f5a 100644
--- a/runtime/PRESUBMIT.py
+++ b/runtime/PRESUBMIT.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
@@ -5,8 +6,8 @@
import os
import cpplint
import re
-import StringIO
+USE_PYTHON3 = True
# memcpy does not handle overlapping memory regions. Even though this
# is well documented it seems to be used in error quite often. To avoid
diff --git a/tests/co19/co19-dart2js.status b/tests/co19/co19-dart2js.status
index 0097562..b16c875 100644
--- a/tests/co19/co19-dart2js.status
+++ b/tests/co19/co19-dart2js.status
@@ -59,22 +59,24 @@
LibTest/io/*: SkipByDesign # dart:io not supported.
LibTest/isolate/*: SkipByDesign # dart:isolate not supported.
LibTest/mirrors/*: SkipByDesign # dart:mirrors is not supported
-LibTest/typed_data/ByteBuffer/*: SkipByDesign # not supported on the web
-LibTest/typed_data/ByteData/getInt64_A01_t01: SkipByDesign # uses integer literal not representable as JavaScript number
-LibTest/typed_data/ByteData/getInt64_A02_t01: SkipByDesign # Int64 accessor not supported by dart2js
-LibTest/typed_data/ByteData/getInt64_A02_t02: SkipByDesign # Int64 accessor not supported by dart2js
-LibTest/typed_data/ByteData/getUint64_A01_t01: SkipByDesign # uses integer literal not representable as JavaScript number
-LibTest/typed_data/ByteData/getUint64_A02_t01: SkipByDesign # Int64 accessor not supported by dart2js
-LibTest/typed_data/ByteData/getUint64_A02_t02: SkipByDesign # Int64 accessor not supported by dart2js
-LibTest/typed_data/ByteData/setInt64_A01_t01: SkipByDesign # uses integer literal not representable as JavaScript number
-LibTest/typed_data/ByteData/setInt64_A02_t01: SkipByDesign # Int64 accessor not supported by dart2js
-LibTest/typed_data/ByteData/setInt64_A02_t02: SkipByDesign # Int64 accessor not supported by dart2js
-LibTest/typed_data/ByteData/setUint64_A01_t01: SkipByDesign # uses integer literal not representable as JavaScript number
-LibTest/typed_data/ByteData/setUint64_A02_t01: SkipByDesign # Uint64 accessor not supported by dart2js
-LibTest/typed_data/ByteData/setUint64_A02_t02: SkipByDesign # Uint64 accessor not supported by dart2js
-LibTest/typed_data/Int32x4/operator_OR_A01_t01: SkipByDesign # Bitwise operations in JS are unsigned.
-LibTest/typed_data/Int32x4List/join_A01_t01: SkipByDesign # Different string represrntation on VM and in JS
-LibTest/typed_data/Int32x4List/join_A01_t02: SkipByDesign # Different string represrntation on VM and in JS
+LibTest/typed_data/ByteBuffer/asInt64List_A01_t01: SkipByDesign # Int64List not supported on the web
+LibTest/typed_data/ByteBuffer/asInt64List_A02_t01: SkipByDesign # Int64List not supported on the web
+LibTest/typed_data/ByteBuffer/asInt64List_A03_t01: SkipByDesign # Int64List not supported on the web
+LibTest/typed_data/ByteBuffer/asUint64List_A01_t01: SkipByDesign # UInt64List not supported on the web
+LibTest/typed_data/ByteBuffer/asUint64List_A02_t01: SkipByDesign # UInt64List not supported on the web
+LibTest/typed_data/ByteBuffer/asUint64List_A03_t01: SkipByDesign # UInt64List not supported on the web
+LibTest/typed_data/ByteData/getInt64_A01_t01: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/getInt64_A02_t01: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/getInt64_A02_t02: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/getUint64_A01_t01: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/getUint64_A02_t01: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/getUint64_A02_t02: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/setInt64_A01_t01: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/setInt64_A02_t01: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/setInt64_A02_t02: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/setUint64_A01_t01: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/setUint64_A02_t01: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/setUint64_A02_t02: SkipByDesign # 64-bit int not supported on the web
LibTest/typed_data/Int64List/*: SkipByDesign # Int64List not supported on the web
LibTest/typed_data/Uint64List/*: SkipByDesign # Uint64List not supported on the web
diff --git a/tests/co19_2/co19_2-dart2js.status b/tests/co19_2/co19_2-dart2js.status
index 5c38055..177ae2a 100644
--- a/tests/co19_2/co19_2-dart2js.status
+++ b/tests/co19_2/co19_2-dart2js.status
@@ -14,6 +14,26 @@
Language/Metadata/before*: SkipByDesign # dart:mirrors not supported https://github.com/dart-lang/co19/issues/523.
LibTest/io/*: SkipByDesign # dart:io not supported.
LibTest/isolate/*: SkipByDesign # dart:isolate not supported.
+LibTest/typed_data/ByteBuffer/asInt64List_A01_t01: SkipByDesign # Int64List not supported on the web
+LibTest/typed_data/ByteBuffer/asInt64List_A02_t01: SkipByDesign # Int64List not supported on the web
+LibTest/typed_data/ByteBuffer/asInt64List_A03_t01: SkipByDesign # Int64List not supported on the web
+LibTest/typed_data/ByteBuffer/asUint64List_A01_t01: SkipByDesign # UInt64List not supported on the web
+LibTest/typed_data/ByteBuffer/asUint64List_A02_t01: SkipByDesign # UInt64List not supported on the web
+LibTest/typed_data/ByteBuffer/asUint64List_A03_t01: SkipByDesign # UInt64List not supported on the web
+LibTest/typed_data/ByteData/getInt64_A01_t01: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/getInt64_A02_t01: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/getInt64_A02_t02: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/getUint64_A01_t01: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/getUint64_A02_t01: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/getUint64_A02_t02: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/setInt64_A01_t01: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/setInt64_A02_t01: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/setInt64_A02_t02: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/setUint64_A01_t01: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/setUint64_A02_t01: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/ByteData/setUint64_A02_t02: SkipByDesign # 64-bit int not supported on the web
+LibTest/typed_data/Int64List/*: SkipByDesign # Int64List not supported on the web
+LibTest/typed_data/Uint64List/*: SkipByDesign # Uint64List not supported on the web
[ $compiler == dart2js && $runtime == d8 ]
LibTest/html/*: SkipByDesign # d8 is not a browser
diff --git a/tools/VERSION b/tools/VERSION
index 0aeed3a..f7e936c 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 15
PATCH 0
-PRERELEASE 17
+PRERELEASE 18
PRERELEASE_PATCH 0
\ No newline at end of file
diff --git a/tools/dom/PRESUBMIT.py b/tools/dom/PRESUBMIT.py
deleted file mode 100644
index f6a6439..0000000
--- a/tools/dom/PRESUBMIT.py
+++ /dev/null
@@ -1,59 +0,0 @@
-# Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-# for details. All rights reserved. Use of this source code is governed by a
-# BSD-style license that can be found in the LICENSE file.
-"""
-Presubmit tests for dom tools.
-
-This file is run by git_cl or gcl when an upload or submit happens with
-any files at this level or lower are in the change list.
-
-See: http://www.chromium.org/developers/how-tos/depottools/presubmit-scripts
-"""
-
-import os
-
-
-def _AnySdkFiles(input_api):
- """ Returns true if any of the changed files are in the sdk, meaning we should
- check that docs.dart was run.
- """
- for f in input_api.change.AffectedFiles():
- if f.LocalPath().find('sdk') > -1:
- return True
- return False
-
-
-def CheckChangeOnUpload(input_api, output_api):
- results = []
- # TODO(amouravski): uncomment this check once docs.dart is faster.
- # if _AnySdkFiles(input_api):
- # results.extend(CheckDocs(input_api, output_api))
- return results
-
-
-def CheckChangeOnCommit(input_api, output_api):
- results = []
- if _AnySdkFiles(input_api):
- results.extend(CheckDocs(input_api, output_api))
- return results
-
-
-def CheckDocs(input_api, output_api):
- """Ensure that documentation has been generated if it needs to be generated.
-
- Prompts with a warning if documentation needs to be generated.
- """
- results = []
-
- cmd = [os.path.join(input_api.PresubmitLocalPath(), 'dom.py'), 'test_docs']
-
- try:
- input_api.subprocess.check_output(
- cmd, stderr=input_api.subprocess.STDOUT)
- except (OSError, input_api.subprocess.CalledProcessError), e:
- results.append(
- output_api.PresubmitPromptWarning(
- ('Docs test failed!%s\nYou should run `dom.py docs`' %
- (e if input_api.verbose else ''))))
-
- return results