未验证 提交 bdc71369 编写于 作者: K Kaushik Iska 提交者: GitHub

[fuchsia] Add sysroot and clang libs to package (#10082)

* [fuchsia] Add sysroot deps

* bundle in clang stuff too

* fix host_os
上级 72f747ae
...@@ -6,6 +6,7 @@ assert(is_fuchsia) ...@@ -6,6 +6,7 @@ assert(is_fuchsia)
import("//build/fuchsia/sdk.gni") import("//build/fuchsia/sdk.gni")
import("$flutter_root/shell/gpu/gpu.gni") import("$flutter_root/shell/gpu/gpu.gni")
import("$flutter_root/tools/fuchsia/clang.gni")
import("$flutter_root/tools/fuchsia/package_dir.gni") import("$flutter_root/tools/fuchsia/package_dir.gni")
shell_gpu_configuration("fuchsia_gpu_configuration") { shell_gpu_configuration("fuchsia_gpu_configuration") {
...@@ -193,7 +194,9 @@ template("jit_runner") { ...@@ -193,7 +194,9 @@ template("jit_runner") {
}, },
] ]
fuchsia_sdk_lib = "//fuchsia/sdk/$host_os/arch/$host_cpu/lib" fuchsia_sdk_base = "//fuchsia/sdk/$host_os/arch/$host_cpu"
fuchsia_sdk_lib = "$fuchsia_sdk_base/lib"
sysroot_lib = "$fuchsia_sdk_base/sysroot/lib"
libraries = [ libraries = [
{ {
...@@ -220,6 +223,27 @@ template("jit_runner") { ...@@ -220,6 +223,27 @@ template("jit_runner") {
name = "libvulkan.so" name = "libvulkan.so"
path = rebase_path("$fuchsia_sdk_lib") path = rebase_path("$fuchsia_sdk_lib")
}, },
{
name = "libzircon.so"
path = rebase_path("$sysroot_lib")
},
{
name = "libc.so"
path = rebase_path("$sysroot_lib")
},
# Note, we use the md5 hashes here because of gn limitations of json parsing.
# This is a hack, and we can migrate to a better way soon.
{
name = "libc++.so.2"
path = rebase_path(
"$clang_base/${clang_manifest_json.md5_33bfe15b05ada4ed326fbc33adb39b95}")
},
{
name = "libc++abi.so.1"
path = rebase_path(
"$clang_base/${clang_manifest_json.md5_916c01a85e3353f124776599819ecb1c}")
},
] ]
meta = [ meta = [
......
# 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.
declare_args() {
# The default clang toolchain provided by the prebuilt. This variable is
# additionally consumed by the Go toolchain.
clang_base = rebase_path("//fuchsia/toolchain/$host_os/lib")
}
if (current_cpu == "arm64") {
clang_cpu = "aarch64"
} else if (current_cpu == "x64") {
clang_cpu = "x86_64"
} else {
assert(false, "CPU not supported")
}
if (is_fuchsia) {
clang_target = "${clang_cpu}-fuchsia"
} else if (is_linux) {
clang_target = "${clang_cpu}-linux-gnu"
} else if (is_mac) {
clang_target = "${clang_cpu}-apple-darwin"
} else {
assert(false, "OS not supported")
}
clang_manifest = rebase_path("$clang_base/${clang_target}.manifest")
clang_manifest_json =
exec_script("$flutter_root/tools/fuchsia/parse_manifest.py",
[ "--input=${clang_manifest}" ],
"json")
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# Copyright 2013 The Flutter Authors. All rights reserved. # Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
""" Gather all the fuchsia artifacts to a destination directory. """ Copies paths, creates if they do not exist.
""" """
import argparse import argparse
...@@ -41,7 +41,7 @@ def CopyPath(src, dst): ...@@ -41,7 +41,7 @@ def CopyPath(src, dst):
except OSError as exc: except OSError as exc:
if exc.errno == errno.ENOTDIR: if exc.errno == errno.ENOTDIR:
if not SameFile(src, dst): if not SameFile(src, dst):
shutil.copy(src, dst) shutil.copyfile(src, dst)
else: else:
raise raise
......
#!/usr/bin/env python
#
# 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.
""" Parses manifest file and dumps it to json.
"""
import argparse
import json
import os
import sys
import hashlib
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
'--input', dest='file_path', action='store', required=True)
args = parser.parse_args()
files = open(args.file_path, 'r')
lines = files.read().split()
output = {}
for line in lines:
key, val = line.strip().split('=')
md5 = hashlib.md5(key.encode()).hexdigest()
hash_key = 'md5_%s' % md5
output[hash_key] = os.path.dirname(val)
print(json.dumps(output))
return 0
if __name__ == '__main__':
sys.exit(main())
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册