From 56f7ec415870eee0ebaf1a6ef1a96c6bebb99211 Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Fri, 13 Aug 2021 15:17:43 +0000 Subject: [PATCH 1/5] Build dart:zircon and dart:zircon_ffi --- 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 +++++++ 4 files changed, 31 insertions(+) create mode 100644 shell/platform/fuchsia/dart-pkg/BUILD.gn diff --git a/shell/platform/fuchsia/BUILD.gn b/shell/platform/fuchsia/BUILD.gn index cf4493e51797d..6469b19938e6c 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 0000000000000..e26997f2abf1b --- /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 eedfe3495e8a1..74355e8e0f582 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 f791c8f37070b..13ccb8ccf4d1e 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" ] +} From 0a0743a108dc9a2d244456bd1604164c67facb49 Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Fri, 13 Aug 2021 19:09:58 +0000 Subject: [PATCH 2/5] Update buildroot and use vpython --- tools/fuchsia/.vpython | 4 ++++ tools/fuchsia/.vpython3 | 5 +++++ tools/fuchsia/dart/gen_dart_package_config.py | 2 +- tools/fuchsia/sdk/find_dart_libraries.py | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 tools/fuchsia/.vpython create mode 100644 tools/fuchsia/.vpython3 diff --git a/tools/fuchsia/.vpython b/tools/fuchsia/.vpython new file mode 100644 index 0000000000000..988c133bfe2b9 --- /dev/null +++ b/tools/fuchsia/.vpython @@ -0,0 +1,4 @@ +wheel: < + name: "infra/python/wheels/pyyaml/${vpython_platform}" + version: "version:3.12" +> diff --git a/tools/fuchsia/.vpython3 b/tools/fuchsia/.vpython3 new file mode 100644 index 0000000000000..6de7914a1661c --- /dev/null +++ b/tools/fuchsia/.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/gen_dart_package_config.py b/tools/fuchsia/dart/gen_dart_package_config.py index 4eaa22dc6eede..68e6851bb1525 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 1d3c0b29188ef..a25376f1f85b2 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 From 8a32e0509dfbb1ffaf5ccd6f9bc8c9d578764310 Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Fri, 13 Aug 2021 19:33:17 +0000 Subject: [PATCH 3/5] Make python action use vpython3 --- tools/{fuchsia => }/.vpython | 0 tools/{fuchsia => }/.vpython3 | 0 tools/python/run_python3_action.py | 6 +++--- 3 files changed, 3 insertions(+), 3 deletions(-) rename tools/{fuchsia => }/.vpython (100%) rename tools/{fuchsia => }/.vpython3 (100%) diff --git a/tools/fuchsia/.vpython b/tools/.vpython similarity index 100% rename from tools/fuchsia/.vpython rename to tools/.vpython diff --git a/tools/fuchsia/.vpython3 b/tools/.vpython3 similarity index 100% rename from tools/fuchsia/.vpython3 rename to tools/.vpython3 diff --git a/tools/python/run_python3_action.py b/tools/python/run_python3_action.py index 11ba1d83816f0..e0b2d7bc4ad53 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:]) From 4fba10b3de012d7b5b5a3483a7a9827b22fe84ab Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Mon, 16 Aug 2021 16:57:13 +0000 Subject: [PATCH 4/5] change from python_binary to action --- tools/fuchsia/dart/dart_package_config.gni | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/fuchsia/dart/dart_package_config.gni b/tools/fuchsia/dart/dart_package_config.gni index 6072c61de4972..3b2b8e56815e9 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 ] From 70d53baab6ff30c85f7e6a103f76299ac77b16f6 Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Mon, 16 Aug 2021 17:02:10 +0000 Subject: [PATCH 5/5] use vpython3 --- tools/gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gn b/tools/gn index 214cc8d02bb6d..b4b2e9e667188 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.