Skip to content

Commit

Permalink
Reverts "[Fuchsia] Use more high level fuchsia-gn-sdk templates (flut…
Browse files Browse the repository at this point in the history
…ter#55445)" (flutter#55834)

Reverts: flutter#55445
Initiated by: zijiehe-google-com
Reason for reverting: This change would break the build_fuchsia_artifacts.py without https://github.com/flutter/engine/pull/55832/files. I'd merge two into one.
Original PR Author: zijiehe-google-com

Reviewed By: {jrwang}

This change reverts the following previous change:
This change removes the in-house built pm-based build rules in favor of the high level fuchsia_component / fuchsia_package in the gn-sdk.

The build_fuchsia_artifacts.py is still using pm, and it will be handled in a following change.

Bug: http://b/353729557, http://b/368608542

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
  • Loading branch information
auto-submit[bot] authored Oct 11, 2024
1 parent 5be462d commit bc3b180
Show file tree
Hide file tree
Showing 5 changed files with 348 additions and 99 deletions.
6 changes: 6 additions & 0 deletions shell/platform/fuchsia/dart_runner/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ template("aot_runner_package") {
"//flutter/shell/platform/fuchsia/runtime/dart/profiler_symbols:dart_aot_runner",
"target_gen_dir") + "/dart_aot_runner.dartprofilersymbols")

inputs = [
vmservice_snapshot,
observatory_archive_file,
dart_profiler_symbols,
]

resources += [
{
path = vmservice_snapshot
Expand Down
2 changes: 0 additions & 2 deletions tools/fuchsia/build_fuchsia_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ def CopyZirconFFILibIfExists(source, destination):
FindFileAndCopyTo('libzircon_ffi.so', source_root, destination_base)


# TODO(zijiehe): http://crbug.com/368608542, avoid using pm or building far
# packages here, packages should be built by ninja.
def CopyToBucketWithMode(source, destination, aot, product, runner_type, api_level):
mode = 'aot' if aot else 'jit'
product_suff = '_product' if product else ''
Expand Down
68 changes: 68 additions & 0 deletions tools/fuchsia/copy_path.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/usr/bin/env python3
#
# 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.

""" Copies paths, creates if they do not exist.
"""

import argparse
import errno
import json
import os
import platform
import shutil
import subprocess
import sys


def EnsureParentExists(path):
dir_name, _ = os.path.split(path)
if not os.path.exists(dir_name):
os.makedirs(dir_name)


def SameStat(s1, s2):
return s1.st_ino == s2.st_ino and s1.st_dev == s2.st_dev


def SameFile(f1, f2):
if not os.path.exists(f2):
return False
s1 = os.stat(f1)
s2 = os.stat(f2)
return SameStat(s1, s2)


def CopyPath(src, dst):
try:
EnsureParentExists(dst)
shutil.copytree(src, dst)
except OSError as exc:
if exc.errno == errno.ENOTDIR:
if not SameFile(src, dst):
shutil.copyfile(src, dst)
else:
raise


def main():
parser = argparse.ArgumentParser()

parser.add_argument('--file-list', dest='file_list', action='store', required=True)

args = parser.parse_args()

files = open(args.file_list, 'r')
files_to_copy = files.read().split()
num_files = len(files_to_copy) // 2

for i in range(num_files):
CopyPath(files_to_copy[i], files_to_copy[num_files + i])

return 0


if __name__ == '__main__':
sys.exit(main())
Loading

0 comments on commit bc3b180

Please sign in to comment.