From fa053625ac59f8ade72c7b18aca613d599f758ab Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Mon, 16 Aug 2021 14:17:02 -0400 Subject: [PATCH] Build dart:zircon and dart:zircon_ffi (#28071) --- shell/platform/fuchsia/BUILD.gn | 1 + shell/platform/fuchsia/dart-pkg/BUILD.gn | 7 +++++++ shell/platform/fuchsia/dart-pkg/zircon/BUILD.gn | 16 ++++++++++++++++ .../fuchsia/dart-pkg/zircon_ffi/BUILD.gn | 7 +++++++ tools/.vpython | 4 ++++ tools/.vpython3 | 5 +++++ tools/fuchsia/dart/dart_package_config.gni | 4 +--- tools/fuchsia/dart/gen_dart_package_config.py | 2 +- tools/fuchsia/sdk/find_dart_libraries.py | 2 +- tools/gn | 2 +- tools/python/run_python3_action.py | 6 +++--- 11 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 shell/platform/fuchsia/dart-pkg/BUILD.gn create mode 100644 tools/.vpython create mode 100644 tools/.vpython3 diff --git a/shell/platform/fuchsia/BUILD.gn b/shell/platform/fuchsia/BUILD.gn index cf4493e517..6469b19938 100644 --- a/shell/platform/fuchsia/BUILD.gn +++ b/shell/platform/fuchsia/BUILD.gn @@ -77,6 +77,7 @@ group("fuchsia") { deps = [ ":dart_binaries", ":flutter_binaries", + "dart-pkg", "dart_runner:dart_aot_${product_suffix}runner", "dart_runner:dart_jit_${product_suffix}runner", "flutter:flutter_aot_${product_suffix}runner", diff --git a/shell/platform/fuchsia/dart-pkg/BUILD.gn b/shell/platform/fuchsia/dart-pkg/BUILD.gn new file mode 100644 index 0000000000..e26997f2ab --- /dev/null +++ b/shell/platform/fuchsia/dart-pkg/BUILD.gn @@ -0,0 +1,7 @@ +# Copyright 2013 The Flutter Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +group("dart-pkg") { + deps = [ "zircon:dart_zircon" ] +} diff --git a/shell/platform/fuchsia/dart-pkg/zircon/BUILD.gn b/shell/platform/fuchsia/dart-pkg/zircon/BUILD.gn index eedfe3495e..74355e8e0f 100644 --- a/shell/platform/fuchsia/dart-pkg/zircon/BUILD.gn +++ b/shell/platform/fuchsia/dart-pkg/zircon/BUILD.gn @@ -3,6 +3,7 @@ # found in the LICENSE file. import("//build/fuchsia/sdk.gni") +import("//flutter/tools/fuchsia/dart/dart_library.gni") config("zircon_config") { include_dirs = [ "." ] @@ -35,3 +36,18 @@ source_set("zircon") { "//flutter/third_party/tonic", ] } + +dart_library("dart_zircon") { + package_name = "zircon" + + sources = [ + "src/handle.dart", + "src/handle_disposition.dart", + "src/handle_waiter.dart", + "src/init.dart", + "src/system.dart", + "zircon.dart", + ] + + deps = [ "../zircon_ffi:dart_zircon_ffi" ] +} diff --git a/shell/platform/fuchsia/dart-pkg/zircon_ffi/BUILD.gn b/shell/platform/fuchsia/dart-pkg/zircon_ffi/BUILD.gn index f791c8f370..13ccb8ccf4 100644 --- a/shell/platform/fuchsia/dart-pkg/zircon_ffi/BUILD.gn +++ b/shell/platform/fuchsia/dart-pkg/zircon_ffi/BUILD.gn @@ -3,6 +3,7 @@ # found in the LICENSE file. import("//build/fuchsia/sdk.gni") +import("//flutter/tools/fuchsia/dart/dart_library.gni") config("zircon_ffi_config") { include_dirs = [ "." ] @@ -21,3 +22,9 @@ shared_library("zircon_ffi") { "//third_party/dart/runtime:dart_api", ] } + +dart_library("dart_zircon_ffi") { + package_name = "zircon_ffi" + + sources = [ "zircon_ffi.dart" ] +} diff --git a/tools/.vpython b/tools/.vpython new file mode 100644 index 0000000000..988c133bfe --- /dev/null +++ b/tools/.vpython @@ -0,0 +1,4 @@ +wheel: < + name: "infra/python/wheels/pyyaml/${vpython_platform}" + version: "version:3.12" +> diff --git a/tools/.vpython3 b/tools/.vpython3 new file mode 100644 index 0000000000..6de7914a16 --- /dev/null +++ b/tools/.vpython3 @@ -0,0 +1,5 @@ +python_version: "3.8" +wheel: < + name: "infra/python/wheels/pyyaml-py3" + version: "version:5.3.1" +> diff --git a/tools/fuchsia/dart/dart_package_config.gni b/tools/fuchsia/dart/dart_package_config.gni index 6072c61de4..3b2b8e5681 100644 --- a/tools/fuchsia/dart/dart_package_config.gni +++ b/tools/fuchsia/dart/dart_package_config.gni @@ -77,9 +77,7 @@ template("dart_package_config") { "visibility", ]) - script = - get_label_info("//flutter/tools/fuchsia/dart:gen_dart_package_config", - "target_out_dir") + "/gen_dart_package_config.pyz" + script = "//flutter/tools/fuchsia/dart/gen_dart_package_config.py" inputs = [ intermediate_file ] outputs = [ package_config_file ] diff --git a/tools/fuchsia/dart/gen_dart_package_config.py b/tools/fuchsia/dart/gen_dart_package_config.py index 4eaa22dc6e..68e6851bb1 100755 --- a/tools/fuchsia/dart/gen_dart_package_config.py +++ b/tools/fuchsia/dart/gen_dart_package_config.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.8 +#!/usr/bin/env vpython3 # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/tools/fuchsia/sdk/find_dart_libraries.py b/tools/fuchsia/sdk/find_dart_libraries.py index 1d3c0b2918..a25376f1f8 100755 --- a/tools/fuchsia/sdk/find_dart_libraries.py +++ b/tools/fuchsia/sdk/find_dart_libraries.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env vpython3 # # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be diff --git a/tools/gn b/tools/gn index 214cc8d02b..b4b2e9e667 100755 --- a/tools/gn +++ b/tools/gn @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env vpython3 # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/tools/python/run_python3_action.py b/tools/python/run_python3_action.py index 11ba1d8381..e0b2d7bc4a 100644 --- a/tools/python/run_python3_action.py +++ b/tools/python/run_python3_action.py @@ -1,10 +1,10 @@ -#!/usr/bin/env python +#!/usr/bin/env vpython3 # # Copyright 2021 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import os import sys +import subprocess -os.execv('/usr/bin/python3', ['python3'] + sys.argv[1:]) +subprocess.run(['vpython3'] + sys.argv[1:]) -- GitLab