From 0d88c28882812542e6d07bedc867e15ab60efb7a Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 17 Mar 2023 10:15:00 -0400 Subject: [PATCH 1/6] Use efr32 sdk root if available for building efr examples --- scripts/build/builders/efr32.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/build/builders/efr32.py b/scripts/build/builders/efr32.py index f4aa05fc762842..e6762447c40dd0 100644 --- a/scripts/build/builders/efr32.py +++ b/scripts/build/builders/efr32.py @@ -218,6 +218,9 @@ def __init__(self, self.extra_gn_options.append( 'sl_matter_version_str="v1.0-%s-%s"' % (branchName, shortCommitSha)) + if "GSDK_ROOT" not in os.environ: + self.extra_gn_options['efr32_sdk_root'] = os.environ['GSDK_ROOT'] + def GnBuildArgs(self): return self.extra_gn_options From c4df3fe367281787e102061594be4c27d85357be Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 17 Mar 2023 10:15:55 -0400 Subject: [PATCH 2/6] Add a comment --- scripts/build/builders/efr32.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/build/builders/efr32.py b/scripts/build/builders/efr32.py index e6762447c40dd0..78125d718c3c0b 100644 --- a/scripts/build/builders/efr32.py +++ b/scripts/build/builders/efr32.py @@ -219,6 +219,8 @@ def __init__(self, 'sl_matter_version_str="v1.0-%s-%s"' % (branchName, shortCommitSha)) if "GSDK_ROOT" not in os.environ: + # EFR32 SDK is very large. If the SDK path is already known (the + # case for pre-installed images), use it directly. self.extra_gn_options['efr32_sdk_root'] = os.environ['GSDK_ROOT'] def GnBuildArgs(self): From 46ba14ea88c54e667fa978cbbe4bff0fb70d41c7 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 17 Mar 2023 10:18:21 -0400 Subject: [PATCH 3/6] Fix typo --- scripts/build/builders/efr32.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/builders/efr32.py b/scripts/build/builders/efr32.py index 78125d718c3c0b..977b4d8b15c950 100644 --- a/scripts/build/builders/efr32.py +++ b/scripts/build/builders/efr32.py @@ -218,7 +218,7 @@ def __init__(self, self.extra_gn_options.append( 'sl_matter_version_str="v1.0-%s-%s"' % (branchName, shortCommitSha)) - if "GSDK_ROOT" not in os.environ: + if "GSDK_ROOT" in os.environ: # EFR32 SDK is very large. If the SDK path is already known (the # case for pre-installed images), use it directly. self.extra_gn_options['efr32_sdk_root'] = os.environ['GSDK_ROOT'] From be660163f7e0f2fc500f2899b257357fc4a80ba2 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 17 Mar 2023 10:21:11 -0400 Subject: [PATCH 4/6] Add shell escape --- scripts/build/builders/efr32.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/builders/efr32.py b/scripts/build/builders/efr32.py index 977b4d8b15c950..5732d8fe0262c6 100644 --- a/scripts/build/builders/efr32.py +++ b/scripts/build/builders/efr32.py @@ -221,7 +221,7 @@ def __init__(self, if "GSDK_ROOT" in os.environ: # EFR32 SDK is very large. If the SDK path is already known (the # case for pre-installed images), use it directly. - self.extra_gn_options['efr32_sdk_root'] = os.environ['GSDK_ROOT'] + self.extra_gn_options.append(f"efr32_sdk_root=\"{os.environ['GSDK_ROOT']}\"") def GnBuildArgs(self): return self.extra_gn_options From 46867e0cfd40971d32d12f93f4436b8f645d73e2 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 17 Mar 2023 10:42:42 -0400 Subject: [PATCH 5/6] Use shell escape for the sdk root --- scripts/build/builders/efr32.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/build/builders/efr32.py b/scripts/build/builders/efr32.py index 5732d8fe0262c6..3aa9f66669ee8f 100644 --- a/scripts/build/builders/efr32.py +++ b/scripts/build/builders/efr32.py @@ -221,7 +221,8 @@ def __init__(self, if "GSDK_ROOT" in os.environ: # EFR32 SDK is very large. If the SDK path is already known (the # case for pre-installed images), use it directly. - self.extra_gn_options.append(f"efr32_sdk_root=\"{os.environ['GSDK_ROOT']}\"") + sdk_path=shlex.quote(os.environ['GSDK_ROOT']) + self.extra_gn_options.append(f"efr32_sdk_root=\"{sdk_path}\"") def GnBuildArgs(self): return self.extra_gn_options From 9d918234a145e309d5fb7b32051464b5e4a54062 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 17 Mar 2023 12:46:39 -0400 Subject: [PATCH 6/6] Restyle --- scripts/build/builders/efr32.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/builders/efr32.py b/scripts/build/builders/efr32.py index 3aa9f66669ee8f..d4eb7bfa0870d8 100644 --- a/scripts/build/builders/efr32.py +++ b/scripts/build/builders/efr32.py @@ -221,7 +221,7 @@ def __init__(self, if "GSDK_ROOT" in os.environ: # EFR32 SDK is very large. If the SDK path is already known (the # case for pre-installed images), use it directly. - sdk_path=shlex.quote(os.environ['GSDK_ROOT']) + sdk_path = shlex.quote(os.environ['GSDK_ROOT']) self.extra_gn_options.append(f"efr32_sdk_root=\"{sdk_path}\"") def GnBuildArgs(self):