Skip to content

Commit

Permalink
Version 3.4.0-218.0.dev
Browse files Browse the repository at this point in the history
Merge f7c2ef5 into dev
  • Loading branch information
Dart CI committed Mar 9, 2024
2 parents 6f18b20 + f7c2ef5 commit b52b754
Show file tree
Hide file tree
Showing 40 changed files with 3,248 additions and 2,328 deletions.
26 changes: 3 additions & 23 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ vars = {
"json_rpc_2_rev": "639857be892050159f5164c749d7947694976a4a",
"leak_tracker_rev": "f5620600a5ce1c44f65ddaa02001e200b096e14c", #
"lints_rev": "ead770872e272e25a64315c120950ea8ad5b2509",
"logging_rev": "cbaf4ee2e59c318d7519edb5381f5fe2a7f69587",
"logging_rev": "7a7bd5e31ddfe23e34d37ded82d6d0cd5706862c",
"markdown_rev": "1ca51664e7b1b7fe789f6be2668c909ce3aea342",
"matcher_rev": "d954c8d979579b4b46427b0ea1d9c721117c191e",
"material_color_utilities_rev": "799b6ba2f3f1c28c67cc7e0b4f18e0c7d7f3c03e",
Expand Down Expand Up @@ -700,7 +700,7 @@ Var("dart_root") + "/third_party/pkg/tar":
"packages": [
{
"package": "chromium/fuchsia/test-scripts",
"version": "EAdD2YcYwVrhF2q_zR6xUvPkcKlPb1tJyM_6_oOc84kC",
"version": "version:2@49064713a73ae92d8c28164938b97869afd336aa",
}
],
"condition": 'download_fuchsia_deps',
Expand All @@ -711,7 +711,7 @@ Var("dart_root") + "/third_party/pkg/tar":
"packages": [
{
"package": "chromium/fuchsia/gn-sdk",
"version": "RgErspyYHapUO2SpcW-vo2p8yaRUMUrq0eWjRVPfQjoC",
"version": "version:2@7f1f23fce153ca079a77492d9d47d803d60b774e",
}
],
"condition": 'download_fuchsia_deps',
Expand Down Expand Up @@ -836,16 +836,6 @@ hooks = [
Var('emsdk_ver')],
'condition': 'download_emscripten'
},
{
'name': 'Erase arch/ from fuchsia sdk',
'pattern': '.',
'action': [
'rm',
'-rf',
'sdk/third_party/fuchsia/sdk/linux/arch',
],
'condition': 'download_fuchsia_deps'
},
{
'name': 'Download Fuchsia system images',
'pattern': '.',
Expand All @@ -857,14 +847,4 @@ hooks = [
],
'condition': 'download_fuchsia_deps'
},
{
'name': 'Generate Fuchsia GN build rules',
'pattern': '.',
'action': [
'python3',
'sdk/build/fuchsia/with_envs.py',
'sdk/third_party/fuchsia/test_scripts/gen_build_defs.py',
],
'condition': 'download_fuchsia_deps'
},
]
10 changes: 6 additions & 4 deletions build/config/BUILDCONFIG.gn
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ if (is_win) {
"//build/config/win:winver",
]
if (is_clang) {
_native_compiler_configs += [ "//build/config/win:relative_paths" ]
_native_compiler_configs += [
"//build/config/win:relative_paths",
]
}
}
if (is_posix) {
Expand All @@ -268,8 +270,8 @@ if (is_posix) {
}
if (is_fuchsia) {
_native_compiler_configs += [
"//third_party/fuchsia/gn-sdk/src/config:compiler",
"//third_party/fuchsia/gn-sdk/src/config:runtime_library",
"//build/config/fuchsia:compiler",
"//build/config/fuchsia:runtime_library",
]
}

Expand Down Expand Up @@ -448,8 +450,8 @@ foreach(_target_type,
}
if (is_fuchsia) {
deps += [
"//build/config/fuchsia:runtime_library_group",
"//build/fuchsia/config/clang:c++-runtime-deps",
"//third_party/fuchsia/gn-sdk/src/config:runtime_library_group",
]
}
}
Expand Down
89 changes: 89 additions & 0 deletions build/config/fuchsia/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Copyright 2019 The Fuchsia 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("//build/config/fuchsia/gn_configs.gni")

config("compiler") {
sdk_version = "${fuchsia_sdk_id}"
defines = [
# To force full builds after SDK updates in case of ABI changes.
"FUCHSIA_SDK_VERSION=$sdk_version",
]
cflags = []
ldflags = []
if (current_cpu == "arm64") {
cflags += [ "--target=aarch64-fuchsia" ]
} else if (current_cpu == "x64") {
cflags += [ "--target=x86_64-fuchsia" ]
} else {
assert(false, "Unsupported architecture")
}

# Pass the target API level to the compiler if specified.
if (fuchsia_target_api_level != -1) {
cflags += [ "-ffuchsia-api-level=${fuchsia_target_api_level}" ]
}

# Add libfdio by default. This may change in future versions
# in order to move away from POSIX applications and towards
# the Fuchsia programming model.
ldflags += [
# We always want fdio or else e.g. stdio wouldn't be initialized if fdio
# happens to not be directly referenced. The common POSIX-y compiler setup
# uses -Wl,--as-needed which drops it if it's simply "-lfdio" from a libs
# setting. Disable --as-needed, add fdio, and then set back to --as-needed.
"-Wl,--no-as-needed",
"-lfdio",
"-Wl,--as-needed",
]

lib_dirs = [ "${fuchsia_sdk}/arch/${current_cpu}/lib" ]

libs = [ "zircon" ]

ldflags += cflags
asmflags = cflags
}

# This should be applied to all targets.
config("runtime_library") {
asmflags = []
cflags = []
cflags_c = []
cflags_cc = []
cflags_objc = []
cflags_objcc = []
defines = []
ldflags = []

sysroot = "${fuchsia_sdk}/arch/$current_cpu/sysroot"

# Pass the sysroot to all C compiler variants, the assembler, and linker.
cflags = [ "--sysroot=" + rebase_path(sysroot, root_build_dir) ]
ldflags = cflags
asmflags = cflags
}

# Copy the loader to place it at the expected path in the final package.
copy("sysroot_dist_libs") {
sources = [ "${fuchsia_sdk}/arch/${target_cpu}/sysroot/dist/lib/ld.so.1" ]
outputs = [ "${root_out_dir}/lib/{{source_file_part}}" ]
}

# This adds the runtime deps for //build/config/compiler:runtime_library
# as that is a config target and thus cannot include data_deps.
group("runtime_library_group") {
data_deps = [
":sysroot_dist_libs",

# This is used directly from //build/config/fuchsia:compiler and thus
# also needs to be included by default.
# "${fuchsia_sdk}/pkg/fdio",
]
}

config("sdk_lib_dirs_config") {
visibility = [ "${fuchsia_sdk}/*" ]
lib_dirs = [ "arch/${target_cpu}/lib" ]
}
11 changes: 11 additions & 0 deletions build/fuchsia/fidl/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 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.

assert(is_fuchsia)
import("//build/fuchsia/sdk.gni")

fuchsia_sdk("fidl") {
meta = "$fuchsia_sdk_path/meta/manifest.json"
enabled_parts = [ "fidl_library" ]
}
99 changes: 99 additions & 0 deletions build/fuchsia/fidl_gen_cpp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#!/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.

""" Generate C/C++ headers and source files from the set of FIDL files specified
in the meta.json manifest.
"""


import argparse
import collections
import json
import os
import subprocess
import sys

def GetFIDLFilesRecursive(libraries, sdk_base, path):
with open(path) as json_file:
parsed = json.load(json_file)
result = []
deps = parsed['deps']
for dep in deps:
dep_meta_json = os.path.abspath('%s/fidl/%s/meta.json' % (sdk_base, dep))
GetFIDLFilesRecursive(libraries, sdk_base, dep_meta_json)
libraries[parsed['name']] = result + parsed['sources']

def GetFIDLFilesByLibraryName(sdk_base, root):
libraries = collections.OrderedDict()
GetFIDLFilesRecursive(libraries, sdk_base, root)
return libraries

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

parser.add_argument('--fidlc-bin', dest='fidlc_bin', action='store', required=True)
parser.add_argument('--fidlgen-bin', dest='fidlgen_bin', action='append', required=False)

parser.add_argument('--sdk-base', dest='sdk_base', action='store', required=True)
parser.add_argument('--root', dest='root', action='store', required=True)
parser.add_argument('--json', dest='json', action='store', required=True)
parser.add_argument('--fidlgen-output-root', dest='fidlgen_output_root', action='store', required=False)
parser.add_argument('--target-api-level', dest='target_api_level', action='store', required=False)

args = parser.parse_args()

assert os.path.exists(args.fidlc_bin)

fidl_files_by_name = GetFIDLFilesByLibraryName(args.sdk_base, args.root)

fidlc_command = [
args.fidlc_bin,
'--json',
args.json
]

if args.target_api_level:
fidlc_command += [
'--available',
'fuchsia:{api_level}'.format(api_level=args.target_api_level),
]

# Create an iterator that works on both python3 and python2
try:
fidl_files_by_name_iter = list(fidl_files_by_name.items())
except AttributeError:
fidl_files_by_name_iter = iter(fidl_files_by_name.items())

for _, fidl_files in fidl_files_by_name_iter:
fidlc_command.append('--files')
for fidl_file in fidl_files:
fidl_abspath = os.path.abspath('%s/%s' % (args.sdk_base, fidl_file))
fidlc_command.append(fidl_abspath)

subprocess.check_call(fidlc_command)

if args.fidlgen_output_root:
assert os.path.exists(args.json)
for fidlgen_bin in args.fidlgen_bin:
assert os.path.exists(fidlgen_bin)

fidlgen_command = [
fidlgen_bin,
'-json',
args.json,
'-root',
args.fidlgen_output_root
]

subprocess.check_call(fidlgen_command)
else:
# --fidlgen-bin and --fidlgen-output-root should be passed in together.
assert not args.fidlgen_bin

return 0

if __name__ == '__main__':
sys.exit(main())
14 changes: 14 additions & 0 deletions build/fuchsia/pkg/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 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.

assert(is_fuchsia)
import("//build/fuchsia/sdk.gni")

fuchsia_sdk("pkg") {
meta = "$fuchsia_sdk_path/meta/manifest.json"
enabled_parts = [
"cc_source_library",
"cc_prebuilt_library",
]
}
Loading

0 comments on commit b52b754

Please sign in to comment.