From 70e328acf74159027e9a5255a240298e809d917d Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Mon, 30 Dec 2024 16:17:09 -0800 Subject: [PATCH 1/3] add xcodebuild env var name --- builder/actions/setup_cross_ci_crt_environment.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/builder/actions/setup_cross_ci_crt_environment.py b/builder/actions/setup_cross_ci_crt_environment.py index 5d6277698..96f95eff8 100644 --- a/builder/actions/setup_cross_ci_crt_environment.py +++ b/builder/actions/setup_cross_ci_crt_environment.py @@ -21,6 +21,8 @@ class SetupCrossCICrtEnvironment(Action): def _setenv(self, env, env_name, env_data, is_secret=False): + if self.is_xcodebuild: + env_name = "TEST_RUNNER_"+env_name # Kinda silly to have a function for this, but makes the API calls consistent and looks better # beside the other functions... env.shell.setenv(env_name, str(env_data), is_secret=is_secret) @@ -433,7 +435,7 @@ def _common_setup(self, env): pass - def run(self, env): + def run(self, is_xcodebuild=False, env): # A special environment variable indicating that we want to dump test environment variables to a specified file. env_dump_file = env.shell.getenv("AWS_SETUP_CRT_TEST_ENVIRONMENT_DUMP_FILE") @@ -461,6 +463,8 @@ def run(self, env): self.is_arm = False # Will be True if on Codebuild self.is_codebuild = False + # Will be True if is using xcodebuild + self.is_xcodebuild = is_xcodebuild # Any easier way to use in docker without having to always modify the builder action if (env.shell.getenv("SETUP_CROSSS_CRT_TEST_ENVIRONMENT_LOCAL", "0") == "1"): From 5f63f9bbd4594807992a228bcb32ed3bee057160 Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Mon, 30 Dec 2024 16:20:48 -0800 Subject: [PATCH 2/3] would this work?? --- builder/actions/setup_cross_ci_crt_environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/actions/setup_cross_ci_crt_environment.py b/builder/actions/setup_cross_ci_crt_environment.py index 96f95eff8..e42dc38db 100644 --- a/builder/actions/setup_cross_ci_crt_environment.py +++ b/builder/actions/setup_cross_ci_crt_environment.py @@ -435,7 +435,7 @@ def _common_setup(self, env): pass - def run(self, is_xcodebuild=False, env): + def run(self, env, is_xcodebuild=False): # A special environment variable indicating that we want to dump test environment variables to a specified file. env_dump_file = env.shell.getenv("AWS_SETUP_CRT_TEST_ENVIRONMENT_DUMP_FILE") From e540508106189397c86b2c3888e6a8e7f1945afe Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Mon, 30 Dec 2024 16:28:39 -0800 Subject: [PATCH 3/3] update SetupCrossCICrtEnvironment with use_xcodebuld --- builder/actions/setup_cross_ci_crt_environment.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/builder/actions/setup_cross_ci_crt_environment.py b/builder/actions/setup_cross_ci_crt_environment.py index e42dc38db..57894902e 100644 --- a/builder/actions/setup_cross_ci_crt_environment.py +++ b/builder/actions/setup_cross_ci_crt_environment.py @@ -19,9 +19,12 @@ class SetupCrossCICrtEnvironment(Action): + def __init__(self, use_xcodebuild=False): + # set to true if using Apple XCodebuild + self.use_xcodebuild = use_xcodebuild def _setenv(self, env, env_name, env_data, is_secret=False): - if self.is_xcodebuild: + if self.use_xcodebuild: env_name = "TEST_RUNNER_"+env_name # Kinda silly to have a function for this, but makes the API calls consistent and looks better # beside the other functions... @@ -463,8 +466,6 @@ def run(self, env, is_xcodebuild=False): self.is_arm = False # Will be True if on Codebuild self.is_codebuild = False - # Will be True if is using xcodebuild - self.is_xcodebuild = is_xcodebuild # Any easier way to use in docker without having to always modify the builder action if (env.shell.getenv("SETUP_CROSSS_CRT_TEST_ENVIRONMENT_LOCAL", "0") == "1"):