Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ allowed_hosts = [
]

deps = {
'src': 'https://github.com/flutter/buildroot.git' + '@' + '0b267aac6794712a6d9d0f31dda3f844325d0258',
'src': 'https://github.com/flutter/buildroot.git' + '@' + '42be4395efc85e455bbdd555ef2791615338dbea',

# Fuchsia compatibility
#
Expand Down
9 changes: 9 additions & 0 deletions tools/fuchsia/fuchsia_archive.gni
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/fuchsia/config.gni")
import("//flutter/tools/fuchsia/fuchsia_debug_symbols.gni")
import("//flutter/tools/fuchsia/fuchsia_libs.gni")

Expand Down Expand Up @@ -149,6 +150,14 @@ template("_fuchsia_archive") {
"--manifest-json-file",
rebase_path(manifest_json_file, root_build_dir),
]

if (fuchsia_target_api_level != -1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, I'm still struggling with GN :( where does this variable come from? Do all gn_args[] get put into the namespace as variables automatically?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It comes from the import above where we import //build/fuchsia/config.gni. This is a gn thing, when you put a variable in a declare_args it makes it available as a global after an import.

args += [
"--api-level",
"${fuchsia_target_api_level}",
]
}

outputs = [
manifest_json_file,
"${far_base_dir}.manifest",
Expand Down
14 changes: 12 additions & 2 deletions tools/fuchsia/gen_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def main():
'--manifest-json-file', dest='manifest_json_file', action='store', required=True)
parser.add_argument(
'--far-name', dest='far_name', action='store', required=False)
parser.add_argument(
'--api-level', dest='api_level', action='store', required=False)

args = parser.parse_args()

Expand Down Expand Up @@ -98,10 +100,18 @@ def main():
# Use check_output so if anything goes wrong we get the output.
try:

build_command = ['build', '--output-package-manifest', args.manifest_json_file]

if args.api_level is not None:
build_command = ['--api-level', args.api_level] + build_command

archive_command = ['archive', '--output='+ os.path.join(os.path.dirname(output_dir), args.far_name + "-0")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you file a bug to get rid of the -0? It complicates people's workflows because the fars aren't named that everywhere, only in our repo. It's also useless since it's just an arbitrary thing we hardcore here


pm_commands = [
['build', '--output-package-manifest', args.manifest_json_file],
['archive', '--output='+ os.path.join(os.path.dirname(output_dir), args.far_name + "-0")],
build_command,
archive_command
]

for pm_command in pm_commands:
subprocess.check_output(pm_command_base + pm_command)
except subprocess.CalledProcessError as e:
Expand Down
5 changes: 5 additions & 0 deletions tools/gn
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@ def to_gn_args(args):
if args.target_os in ['android'] and gn_args['target_cpu'] in ['x64' , 'arm64']:
gn_args['dart_use_compressed_pointers'] = True

if args.fuchsia_target_api_level is not None:
gn_args['fuchsia_target_api_level'] = args.fuchsia_target_api_level

return gn_args

def parse_args(args):
Expand Down Expand Up @@ -509,6 +512,8 @@ def parse_args(args):
'true and is enabled on CI.')
parser.add_argument('--no-prebuilt-dart-sdk', dest='prebuilt_dart_sdk', action='store_false')

parser.add_argument('--fuchsia-target-api-level', dest='fuchsia_target_api_level')

# Sanitizers.
parser.add_argument('--asan', default=False, action='store_true')
parser.add_argument('--lsan', default=False, action='store_true')
Expand Down