From a9a0cf1d103231af169a679379bedfd080aa24af Mon Sep 17 00:00:00 2001 From: Hzj_jie Date: Fri, 23 Aug 2024 11:38:04 -0700 Subject: [PATCH 1/6] use api-level from gn-sdk --- build/config/fuchsia/gn_configs.gni | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build/config/fuchsia/gn_configs.gni b/build/config/fuchsia/gn_configs.gni index 7cf672c278640..ff981de991ccf 100644 --- a/build/config/fuchsia/gn_configs.gni +++ b/build/config/fuchsia/gn_configs.gni @@ -21,12 +21,6 @@ declare_args() { # TODO(zijiehe): Remove the override and move it into declare_args once the one # in //build/config/sdk.gni being removed. - b/40935282 -# The target API level for this repository. Embedders should override this -# value to specify the API level the packages produced from this repository -# should be targeting, e.g. in their top-level //.gn file. A value of -1 -# means that no API level will be passed to the tools that consumes it. -fuchsia_target_api_level = 22 - # The SDK manifest file. This is useful to include as a dependency # for some targets in order to cause a rebuild when the version of the # SDK is changed. From da3391ef23a18afe0fc9b3ef74b5af848b2fc11b Mon Sep 17 00:00:00 2001 From: Hzj_jie Date: Fri, 23 Aug 2024 12:12:11 -0700 Subject: [PATCH 2/6] test --- tools/fuchsia/build_fuchsia_artifacts.py | 4 ++-- tools/fuchsia/build_fuchsia_artifacts_test.py | 18 ------------------ 2 files changed, 2 insertions(+), 20 deletions(-) delete mode 100755 tools/fuchsia/build_fuchsia_artifacts_test.py diff --git a/tools/fuchsia/build_fuchsia_artifacts.py b/tools/fuchsia/build_fuchsia_artifacts.py index 3e25325308ad4..249b368cbf2a6 100755 --- a/tools/fuchsia/build_fuchsia_artifacts.py +++ b/tools/fuchsia/build_fuchsia_artifacts.py @@ -178,12 +178,12 @@ def CopyToBucket(src, dst, product=False): def ReadTargetAPILevel(): - filename = os.path.join(os.path.dirname(__file__), '../../build/config/fuchsia/gn_configs.gni') + filename = os.path.join(os.path.dirname(__file__), '../../tools/fuchsia/gn-sdk/src/gn_configs.gni') with open(filename) as f: for line in f: if line.startswith('fuchsia_target_api_level'): return line.split('=')[-1].strip() - assert False, 'No fuchsia_target_api_level found in //flutter/build/config/fuchsia/gn_configs.gni' + assert False, 'No fuchsia_target_api_level found in //flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni' def CopyVulkanDepsToBucket(src, dst, arch): diff --git a/tools/fuchsia/build_fuchsia_artifacts_test.py b/tools/fuchsia/build_fuchsia_artifacts_test.py deleted file mode 100755 index 9c536a6d15306..0000000000000 --- a/tools/fuchsia/build_fuchsia_artifacts_test.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env vpython3 - -import unittest - -import build_fuchsia_artifacts - - -class BuildFuchsiaArtifactsTest(unittest.TestCase): - - def test_read_fuchsia_target_api_level(self): - # It's expected to update this test each time the fuchsia_target_api_level - # in //flutter/build/config/fuchsia/gn_configs.gni is changed, so we don't - # accidentally publish the artifacts with an incorrect api level suffix. - self.assertEqual(build_fuchsia_artifacts.ReadTargetAPILevel(), '22') - - -if __name__ == '__main__': - unittest.main() From c504fe214c80cfa6a5c206cf15eb7248d236f1b2 Mon Sep 17 00:00:00 2001 From: Hzj_jie Date: Fri, 23 Aug 2024 12:14:47 -0700 Subject: [PATCH 3/6] filename --- tools/fuchsia/build_fuchsia_artifacts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/fuchsia/build_fuchsia_artifacts.py b/tools/fuchsia/build_fuchsia_artifacts.py index 249b368cbf2a6..4d11eea8794a5 100755 --- a/tools/fuchsia/build_fuchsia_artifacts.py +++ b/tools/fuchsia/build_fuchsia_artifacts.py @@ -178,12 +178,12 @@ def CopyToBucket(src, dst, product=False): def ReadTargetAPILevel(): - filename = os.path.join(os.path.dirname(__file__), '../../tools/fuchsia/gn-sdk/src/gn_configs.gni') + filename = os.path.join(os.path.dirname(__file__), 'gn-sdk/src/gn_configs.gni') with open(filename) as f: for line in f: if line.startswith('fuchsia_target_api_level'): return line.split('=')[-1].strip() - assert False, 'No fuchsia_target_api_level found in //flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni' + assert False, 'No fuchsia_target_api_level found in ' + filename def CopyVulkanDepsToBucket(src, dst, arch): From 0380698318adbcb3bf05e08e68bdec414ca1c55d Mon Sep 17 00:00:00 2001 From: Hzj_jie Date: Fri, 23 Aug 2024 13:37:30 -0700 Subject: [PATCH 4/6] remove --- ci/builders/linux_fuchsia_tests.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ci/builders/linux_fuchsia_tests.json b/ci/builders/linux_fuchsia_tests.json index 4acd01e972a0d..1e42ca647a857 100644 --- a/ci/builders/linux_fuchsia_tests.json +++ b/ci/builders/linux_fuchsia_tests.json @@ -269,10 +269,6 @@ "name": "run_tests test", "script": "flutter/testing/fuchsia/run_tests_test.py" }, - { - "name": "build_fuchsia_artifacts test", - "script": "flutter/tools/fuchsia/build_fuchsia_artifacts_test.py" - }, { "name": "x64 emulator based debug tests", "language": "python3", From dc86033563e7a21db3a1788127ad889ee3dc1803 Mon Sep 17 00:00:00 2001 From: Hzj_jie Date: Fri, 23 Aug 2024 14:06:53 -0700 Subject: [PATCH 5/6] typo --- ci/builders/linux_fuchsia_tests.json | 4 ++++ tools/fuchsia/build_fuchsia_artifacts.py | 3 ++- tools/fuchsia/build_fuchsia_artifacts_test.py | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100755 tools/fuchsia/build_fuchsia_artifacts_test.py diff --git a/ci/builders/linux_fuchsia_tests.json b/ci/builders/linux_fuchsia_tests.json index 1e42ca647a857..4acd01e972a0d 100644 --- a/ci/builders/linux_fuchsia_tests.json +++ b/ci/builders/linux_fuchsia_tests.json @@ -269,6 +269,10 @@ "name": "run_tests test", "script": "flutter/testing/fuchsia/run_tests_test.py" }, + { + "name": "build_fuchsia_artifacts test", + "script": "flutter/tools/fuchsia/build_fuchsia_artifacts_test.py" + }, { "name": "x64 emulator based debug tests", "language": "python3", diff --git a/tools/fuchsia/build_fuchsia_artifacts.py b/tools/fuchsia/build_fuchsia_artifacts.py index 4d11eea8794a5..f37c3bd6b9716 100755 --- a/tools/fuchsia/build_fuchsia_artifacts.py +++ b/tools/fuchsia/build_fuchsia_artifacts.py @@ -181,7 +181,8 @@ def ReadTargetAPILevel(): filename = os.path.join(os.path.dirname(__file__), 'gn-sdk/src/gn_configs.gni') with open(filename) as f: for line in f: - if line.startswith('fuchsia_target_api_level'): + line = line.strip() + if line.startswith('fuchsia_target_api_level='): return line.split('=')[-1].strip() assert False, 'No fuchsia_target_api_level found in ' + filename diff --git a/tools/fuchsia/build_fuchsia_artifacts_test.py b/tools/fuchsia/build_fuchsia_artifacts_test.py new file mode 100755 index 0000000000000..3ad93f21c66e9 --- /dev/null +++ b/tools/fuchsia/build_fuchsia_artifacts_test.py @@ -0,0 +1,15 @@ +#!/usr/bin/env vpython3 + +import unittest + +import build_fuchsia_artifacts + + +class BuildFuchsiaArtifactsTest(unittest.TestCase): + + def test_read_fuchsia_target_api_level(self): + self.assertGreater(int(build_fuchsia_artifacts.ReadTargetAPILevel()), 21) + + +if __name__ == '__main__': + unittest.main() From 1e8c8499295c50348883eb640051dff0e630f07e Mon Sep 17 00:00:00 2001 From: Hzj_jie Date: Fri, 23 Aug 2024 14:08:07 -0700 Subject: [PATCH 6/6] typo --- tools/fuchsia/build_fuchsia_artifacts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/fuchsia/build_fuchsia_artifacts.py b/tools/fuchsia/build_fuchsia_artifacts.py index f37c3bd6b9716..5258466145387 100755 --- a/tools/fuchsia/build_fuchsia_artifacts.py +++ b/tools/fuchsia/build_fuchsia_artifacts.py @@ -182,7 +182,7 @@ def ReadTargetAPILevel(): with open(filename) as f: for line in f: line = line.strip() - if line.startswith('fuchsia_target_api_level='): + if line.startswith('fuchsia_target_api_level'): return line.split('=')[-1].strip() assert False, 'No fuchsia_target_api_level found in ' + filename