Skip to content

Commit 43eec6d

Browse files
Merge branch 'feature/aks-vcpkg' into feature/aks-improve-logging
2 parents 1758e1a + a247075 commit 43eec6d

File tree

3 files changed

+12
-58
lines changed

3 files changed

+12
-58
lines changed

scripts/gha/build_testapps.py

Lines changed: 12 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
import platform
7373
import shutil
7474
import subprocess
75+
import sys
7576

7677
from absl import app
7778
from absl import flags
@@ -82,6 +83,7 @@
8283
from integration_testing import config_reader
8384
from integration_testing import test_validation
8485
from integration_testing import xcodebuild
86+
import utils
8587

8688
# Environment variables
8789
_JAVA_HOME = "JAVA_HOME"
@@ -194,10 +196,14 @@ def main(argv):
194196
config = config_reader.read_config()
195197
cmake_flags = _get_desktop_compiler_flags(FLAGS.compiler, config.compilers)
196198
if _DESKTOP in platforms and FLAGS.use_vcpkg:
197-
_run(["git", "submodule", "update", "--init"])
198-
vcpkg = Vcpkg.generate(os.path.join(sdk_dir, config.vcpkg_dir))
199-
vcpkg.install_and_run()
200-
cmake_flags.extend(vcpkg.cmake_flags)
199+
installer = os.path.join(sdk_dir, "scripts", "gha", "build_desktop.py")
200+
_run([sys.executable, installer, "--vcpkg_step_only"])
201+
toolchain_file = os.path.join(
202+
sdk_dir, "external", "vcpkg", "scripts", "buildsystems", "vcpkg.cmake")
203+
cmake_flags.extend((
204+
"-DCMAKE_TOOLCHAIN_FILE=%s" % toolchain_file,
205+
"-DVCPKG_TARGET_TRIPLET=%s" % utils.get_vcpkg_triplet(arch="x64")
206+
))
201207

202208
failures = []
203209
for testapp in testapps:
@@ -438,7 +444,7 @@ def _build_ios(
438444
podfile_tool_path = os.path.join(
439445
root_dir, "scripts", "gha", "integration_testing", "update_podfile.py")
440446
podfile_patcher_args = [
441-
"python", podfile_tool_path,
447+
sys.executable, podfile_tool_path,
442448
"--sdk_podfile", os.path.join(root_dir, "ios_pod", "Podfile"),
443449
"--app_podfile", os.path.join(project_dir, "Podfile")
444450
]
@@ -491,7 +497,7 @@ def _run_setup_script(root_dir, testapp_dir):
491497
"""Runs the setup_integration_tests.py script if needed."""
492498
script_path = os.path.join(root_dir, "setup_integration_tests.py")
493499
if os.path.isfile(script_path):
494-
_run(["python", script_path, testapp_dir])
500+
_run([sys.executable, script_path, testapp_dir])
495501
else:
496502
logging.info("setup_integration_tests.py not found")
497503

@@ -524,55 +530,6 @@ def _fix_path(path):
524530
return os.path.abspath(os.path.expanduser(path))
525531

526532

527-
@attr.s(frozen=True, eq=False)
528-
class Vcpkg(object):
529-
"""Holds data related to the vcpkg tool used for managing dependent tools."""
530-
installer = attr.ib()
531-
binary = attr.ib()
532-
triplet = attr.ib()
533-
response_file = attr.ib()
534-
toolchain_file = attr.ib()
535-
536-
@classmethod
537-
def generate(cls, vcpkg_dir):
538-
"""Generates the vcpkg data based on the given vcpkg submodule path."""
539-
installer = os.path.join(vcpkg_dir, "bootstrap-vcpkg")
540-
binary = os.path.join(vcpkg_dir, "vcpkg")
541-
response_file_fmt = vcpkg_dir + "_%s_response_file.txt"
542-
if platform.system() == "Windows":
543-
triplet = "x64-windows-static"
544-
installer += ".bat"
545-
binary += ".exe"
546-
elif platform.system() == "Darwin":
547-
triplet = "x64-osx"
548-
installer += ".sh"
549-
elif platform.system() == "Linux":
550-
triplet = "x64-linux"
551-
installer += ".sh"
552-
else:
553-
raise ValueError("Unrecognized system: %s" % platform.system())
554-
return cls(
555-
installer=installer,
556-
binary=binary,
557-
triplet=triplet,
558-
response_file=response_file_fmt % triplet,
559-
toolchain_file=os.path.join(
560-
vcpkg_dir, "scripts", "buildsystems", "vcpkg.cmake"))
561-
562-
def install_and_run(self):
563-
"""Installs vcpkg (if needed) and runs it to install dependencies."""
564-
if not os.path.exists(self.binary):
565-
_run([self.installer])
566-
_run([
567-
self.binary, "install", "@" + self.response_file, "--disable-metrics"])
568-
569-
@property
570-
def cmake_flags(self):
571-
return [
572-
"-DCMAKE_TOOLCHAIN_FILE=%s" % self.toolchain_file,
573-
"-DVCPKG_TARGET_TRIPLET=%s" % self.triplet]
574-
575-
576533
@attr.s(frozen=True, eq=False)
577534
class Failure(object):
578535
"""Holds context for the failure of a testapp to build/run."""

scripts/gha/integration_testing/build_testapps.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@
174174
"provision": "Google_Development.mobileprovision"
175175
}
176176
],
177-
"vcpkg_dir": "external/vcpkg",
178177
"apple_team_id": "REPLACE_ME_TEMP_INVALID_ID",
179178
"compiler_dict": {
180179
"gcc-4.8": [

scripts/gha/integration_testing/config_reader.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ def read_config(path=None):
9797
return Config(
9898
apis=api_configs,
9999
apple_team_id=config["apple_team_id"],
100-
vcpkg_dir=config["vcpkg_dir"],
101100
compilers=config["compiler_dict"])
102101
except (KeyError, TypeError, IndexError):
103102
# The error will be cryptic on its own, so we dump the JSON to
@@ -112,7 +111,6 @@ def read_config(path=None):
112111
class Config(object):
113112
apis = attr.ib() # Mapping of str: APIConfig
114113
apple_team_id = attr.ib()
115-
vcpkg_dir = attr.ib() # Relative location of the vcpkg submodule in the repo.
116114
compilers = attr.ib()
117115

118116
def get_api(self, api):

0 commit comments

Comments
 (0)