Skip to content

Commit

Permalink
Version 3.4.0-122.0.dev
Browse files Browse the repository at this point in the history
Merge 5a70848 into dev
  • Loading branch information
Dart CI committed Feb 8, 2024
2 parents fef9948 + 5a70848 commit f6adbbd
Show file tree
Hide file tree
Showing 167 changed files with 1,470 additions and 1,220 deletions.
21 changes: 21 additions & 0 deletions PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,26 @@ def _CheckCopyrightYear(input_api, output_api):
]


def _CheckNoNewObservatoryServiceTests(input_api, output_api):
"""Ensures that no new tests are added to the Observatory test suite."""
files = []

for f in input_api.AffectedFiles(include_deletes=False):
path = f.LocalPath()
if is_dart_file(path) and path.startswith(
"runtime/observatory/tests/service/") and f.Action(
) == 'A' and os.path.isfile(path):
files.append(path)

if not files:
return []

return [
output_api.PresubmitError(
'New VM service tests should be added to pkg/vm_service/test, ' +
'not runtime/observatory/tests/service:\n' + '\n'.join(files))
]

def _CommonChecks(input_api, output_api):
results = []
results.extend(_CheckValidHostsInDEPS(input_api, output_api))
Expand All @@ -420,6 +440,7 @@ def _CommonChecks(input_api, output_api):
input_api.canned_checks.CheckPatchFormatted(input_api, output_api))
results.extend(_CheckCopyrightYear(input_api, output_api))
results.extend(_CheckAnalyzerFiles(input_api, output_api))
results.extend(_CheckNoNewObservatoryServiceTests(input_api, output_api))
return results


Expand Down
155 changes: 74 additions & 81 deletions build/find_depot_tools.py
Original file line number Diff line number Diff line change
@@ -1,81 +1,74 @@
#!/usr/bin/env python3
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# For Dart/Flutter developers:
# This file is copied from Chromium:
# https://cs.chromium.org/chromium/src/build/find_depot_tools.py
# When updating replace reference to python on the first line with python3.
#
"""Small utility function to find depot_tools and add it to the python path.
Will throw an ImportError exception if depot_tools can't be found since it
imports breakpad.
This can also be used as a standalone script to print out the depot_tools
directory location.
"""

from __future__ import print_function

import os
import sys


# Path to //src
SRC = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))


def IsRealDepotTools(path):
expanded_path = os.path.expanduser(path)
return os.path.isfile(os.path.join(expanded_path, 'gclient.py'))


def add_depot_tools_to_path():
"""Search for depot_tools and add it to sys.path."""
# First, check if we have a DEPS'd in "depot_tools".
deps_depot_tools = os.path.join(SRC, 'third_party', 'depot_tools')
if IsRealDepotTools(deps_depot_tools):
# Put the pinned version at the start of the sys.path, in case there
# are other non-pinned versions already on the sys.path.
sys.path.insert(0, deps_depot_tools)
return deps_depot_tools

# Then look if depot_tools is already in PYTHONPATH.
for i in sys.path:
if i.rstrip(os.sep).endswith('depot_tools') and IsRealDepotTools(i):
return i
# Then look if depot_tools is in PATH, common case.
for i in os.environ['PATH'].split(os.pathsep):
if IsRealDepotTools(i):
sys.path.append(i.rstrip(os.sep))
return i
# Rare case, it's not even in PATH, look upward up to root.
root_dir = os.path.dirname(os.path.abspath(__file__))
previous_dir = os.path.abspath(__file__)
while root_dir and root_dir != previous_dir:
i = os.path.join(root_dir, 'depot_tools')
if IsRealDepotTools(i):
sys.path.append(i)
return i
previous_dir = root_dir
root_dir = os.path.dirname(root_dir)
print('Failed to find depot_tools', file=sys.stderr)
return None

DEPOT_TOOLS_PATH = add_depot_tools_to_path()

# pylint: disable=W0611
import breakpad


def main():
if DEPOT_TOOLS_PATH is None:
return 1
print(DEPOT_TOOLS_PATH)
return 0


if __name__ == '__main__':
sys.exit(main())
#!/usr/bin/env python3
# Copyright 2011 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Small utility function to find depot_tools and add it to the python path.
Will throw an ImportError exception if depot_tools can't be found since it
imports breakpad.
This can also be used as a standalone script to print out the depot_tools
directory location.
"""


import os
import sys


# Path to //src
SRC = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))


def IsRealDepotTools(path):
expanded_path = os.path.expanduser(path)
return os.path.isfile(os.path.join(expanded_path, 'gclient.py'))


def add_depot_tools_to_path():
"""Search for depot_tools and add it to sys.path."""
# First, check if we have a DEPS'd in "depot_tools".
deps_depot_tools = os.path.join(SRC, 'third_party', 'depot_tools')
if IsRealDepotTools(deps_depot_tools):
# Put the pinned version at the start of the sys.path, in case there
# are other non-pinned versions already on the sys.path.
sys.path.insert(0, deps_depot_tools)
return deps_depot_tools

# Then look if depot_tools is already in PYTHONPATH.
for i in sys.path:
if i.rstrip(os.sep).endswith('depot_tools') and IsRealDepotTools(i):
return i
# Then look if depot_tools is in PATH, common case.
for i in os.environ['PATH'].split(os.pathsep):
if IsRealDepotTools(i):
sys.path.append(i.rstrip(os.sep))
return i
# Rare case, it's not even in PATH, look upward up to root.
root_dir = os.path.dirname(os.path.abspath(__file__))
previous_dir = os.path.abspath(__file__)
while root_dir and root_dir != previous_dir:
i = os.path.join(root_dir, 'depot_tools')
if IsRealDepotTools(i):
sys.path.append(i)
return i
previous_dir = root_dir
root_dir = os.path.dirname(root_dir)
print('Failed to find depot_tools', file=sys.stderr)
return None

DEPOT_TOOLS_PATH = add_depot_tools_to_path()

# pylint: disable=W0611
import breakpad


def main():
if DEPOT_TOOLS_PATH is None:
return 1
print(DEPOT_TOOLS_PATH)
return 0


if __name__ == '__main__':
sys.exit(main())
43 changes: 28 additions & 15 deletions build/toolchain/win/setup_toolchain.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Copyright 2013 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
Expand All @@ -10,7 +10,6 @@
# win tool. The script assumes that the root build directory is the current dir
# and the files will be written to the current directory.

from __future__ import print_function

import errno
import json
Expand All @@ -23,6 +22,8 @@
import gn_helpers

SCRIPT_DIR = os.path.dirname(__file__)
SDK_VERSION = '10.0.22621.0'


def _ExtractImportantEnvironment(output_of_set):
"""Extracts environment variables required for the toolchain to run from
Expand Down Expand Up @@ -184,7 +185,7 @@ def _LoadToolchainEnv(cpu, toolchain_root, sdk_dir, target_store):
# Explicitly specifying the SDK version to build with to avoid accidentally
# building with a new and untested SDK. This should stay in sync with the
# packaged toolchain in build/vs_toolchain.py.
args.append('10.0.20348.0')
args.append(SDK_VERSION)
variables = _LoadEnvFromBat(args)
return _ExtractImportantEnvironment(variables)

Expand Down Expand Up @@ -283,32 +284,44 @@ def q(s): # Quote s if it contains spaces or other weird characters.
lib = [p.replace('"', r'\"') for p in env['LIB'].split(';') if p]
lib = list(map(relflag, lib))

include_I = ' '.join([q('/I' + i) for i in include])
include_imsvc = ' '.join([q('-imsvc' + i) for i in include])
libpath_flags = ' '.join([q('-libpath:' + i) for i in lib])
include_I = ['/I' + i for i in include]
include_imsvc = ['-imsvc' + i for i in include]
libpath_flags = ['-libpath:' + i for i in lib]

if (environment_block_name != ''):
env_block = _FormatAsEnvironmentBlock(env)
with open(environment_block_name, 'w') as f:
with open(environment_block_name, 'w', encoding='utf8') as f:
f.write(env_block)

def ListToArgString(x):
return gn_helpers.ToGNString(' '.join(q(i) for i in x))

def ListToArgList(x):
return f'[{", ".join(gn_helpers.ToGNString(i) for i in x)}]'

print('vc_bin_dir = ' + gn_helpers.ToGNString(vc_bin_dir))
assert include_I
print('include_flags_I = ' + gn_helpers.ToGNString(include_I))
print(f'include_flags_I = {ListToArgString(include_I)}')
print(f'include_flags_I_list = {ListToArgList(include_I)}')
assert include_imsvc
if bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', 1))) and win_sdk_path:
print('include_flags_imsvc = ' +
gn_helpers.ToGNString(q('/winsysroot' + relflag(toolchain_root))))
flags = ['/winsysroot' + relflag(toolchain_root)]
print(f'include_flags_imsvc = {ListToArgString(flags)}')
print(f'include_flags_imsvc_list = {ListToArgList(flags)}')
else:
print('include_flags_imsvc = ' + gn_helpers.ToGNString(include_imsvc))
print(f'include_flags_imsvc = {ListToArgString(include_imsvc)}')
print(f'include_flags_imsvc_list = {ListToArgList(include_imsvc)}')
print('paths = ' + gn_helpers.ToGNString(env['PATH']))
assert libpath_flags
print('libpath_flags = ' + gn_helpers.ToGNString(libpath_flags))
print(f'libpath_flags = {ListToArgString(libpath_flags)}')
print(f'libpath_flags_list = {ListToArgList(libpath_flags)}')
if bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', 1))) and win_sdk_path:
print('libpath_lldlink_flags = ' +
gn_helpers.ToGNString(q('/winsysroot:' + relflag(toolchain_root))))
flags = ['/winsysroot:' + relflag(toolchain_root)]
print(f'libpath_lldlink_flags = {ListToArgString(flags)}')
print(f'libpath_lldlink_flags_list = {ListToArgList(flags)}')
else:
print('libpath_lldlink_flags = ' + gn_helpers.ToGNString(libpath_flags))
print(f'libpath_lldlink_flags = {ListToArgString(libpath_flags)}')
print(f'libpath_lldlink_flags_list = {ListToArgList(libpath_flags)}')


if __name__ == '__main__':
Expand Down
Loading

0 comments on commit f6adbbd

Please sign in to comment.