|
69 | 69 | import datetime
|
70 | 70 | from distutils import dir_util
|
71 | 71 | import os
|
72 |
| -import pathlib |
73 | 72 | import platform
|
74 | 73 | import shutil
|
75 | 74 | import subprocess
|
| 75 | +import sys |
76 | 76 |
|
77 | 77 | from absl import app
|
78 | 78 | from absl import flags
|
|
81 | 81 | import attr
|
82 | 82 |
|
83 | 83 | from integration_testing import config_reader
|
84 |
| -from integration_testing import provisioning |
85 | 84 | from integration_testing import xcodebuild
|
| 85 | +import utils |
86 | 86 |
|
87 | 87 | # Environment variables
|
88 | 88 | _JAVA_HOME = "JAVA_HOME"
|
@@ -199,10 +199,14 @@ def main(argv):
|
199 | 199 | config = config_reader.read_config()
|
200 | 200 | cmake_flags = _get_desktop_compiler_flags(FLAGS.compiler, config.compilers)
|
201 | 201 | if _DESKTOP in platforms and FLAGS.use_vcpkg:
|
202 |
| - _run(["git", "submodule", "update", "--init"]) |
203 |
| - vcpkg = Vcpkg.generate(os.path.join(sdk_dir, config.vcpkg_dir)) |
204 |
| - vcpkg.install_and_run() |
205 |
| - cmake_flags.extend(vcpkg.cmake_flags) |
| 202 | + installer = os.path.join(sdk_dir, "scripts", "gha", "build_desktop.py") |
| 203 | + _run([sys.executable, installer, "--vcpkg_step_only"]) |
| 204 | + toolchain_file = os.path.join( |
| 205 | + sdk_dir, "external", "vcpkg", "scripts", "buildsystems", "vcpkg.cmake") |
| 206 | + cmake_flags.extend(( |
| 207 | + "-DCMAKE_TOOLCHAIN_FILE=%s" % toolchain_file, |
| 208 | + "-DVCPKG_TARGET_TRIPLET=%s" % utils.get_vcpkg_triplet(arch="x64") |
| 209 | + )) |
206 | 210 |
|
207 | 211 | failures = []
|
208 | 212 | for testapp in testapps:
|
@@ -462,7 +466,7 @@ def _build_ios(
|
462 | 466 | app_podfile_path = os.path.join(
|
463 | 467 | project_dir, "Podfile")
|
464 | 468 | podfile_patcher_args = [
|
465 |
| - "python", podfile_tool_path, |
| 469 | + sys.executable, podfile_tool_path, |
466 | 470 | "--sdk_podfile", sdk_podfile_path,
|
467 | 471 | "--app_podfile", app_podfile_path
|
468 | 472 | ]
|
@@ -515,7 +519,7 @@ def _run_setup_script(root_dir, testapp_dir):
|
515 | 519 | """Runs the setup_integration_tests.py script if needed."""
|
516 | 520 | script_path = os.path.join(root_dir, "setup_integration_tests.py")
|
517 | 521 | if os.path.isfile(script_path):
|
518 |
| - _run(["python", script_path, testapp_dir]) |
| 522 | + _run([sys.executable, script_path, testapp_dir]) |
519 | 523 | else:
|
520 | 524 | logging.info("setup_integration_tests.py not found")
|
521 | 525 |
|
@@ -548,55 +552,6 @@ def _fix_path(path):
|
548 | 552 | return os.path.abspath(os.path.expanduser(path))
|
549 | 553 |
|
550 | 554 |
|
551 |
| -@attr.s(frozen=True, eq=False) |
552 |
| -class Vcpkg(object): |
553 |
| - """Holds data related to the vcpkg tool used for managing dependent tools.""" |
554 |
| - installer = attr.ib() |
555 |
| - binary = attr.ib() |
556 |
| - triplet = attr.ib() |
557 |
| - response_file = attr.ib() |
558 |
| - toolchain_file = attr.ib() |
559 |
| - |
560 |
| - @classmethod |
561 |
| - def generate(cls, vcpkg_dir): |
562 |
| - """Generates the vcpkg data based on the given vcpkg submodule path.""" |
563 |
| - installer = os.path.join(vcpkg_dir, "bootstrap-vcpkg") |
564 |
| - binary = os.path.join(vcpkg_dir, "vcpkg") |
565 |
| - response_file_fmt = vcpkg_dir + "_%s_response_file.txt" |
566 |
| - if platform.system() == "Windows": |
567 |
| - triplet = "x64-windows-static" |
568 |
| - installer += ".bat" |
569 |
| - binary += ".exe" |
570 |
| - elif platform.system() == "Darwin": |
571 |
| - triplet = "x64-osx" |
572 |
| - installer += ".sh" |
573 |
| - elif platform.system() == "Linux": |
574 |
| - triplet = "x64-linux" |
575 |
| - installer += ".sh" |
576 |
| - else: |
577 |
| - raise ValueError("Unrecognized system: %s" % platform.system()) |
578 |
| - return cls( |
579 |
| - installer=installer, |
580 |
| - binary=binary, |
581 |
| - triplet=triplet, |
582 |
| - response_file=response_file_fmt % triplet, |
583 |
| - toolchain_file=os.path.join( |
584 |
| - vcpkg_dir, "scripts", "buildsystems", "vcpkg.cmake")) |
585 |
| - |
586 |
| - def install_and_run(self): |
587 |
| - """Installs vcpkg (if needed) and runs it to install dependencies.""" |
588 |
| - if not os.path.exists(self.binary): |
589 |
| - _run([self.installer]) |
590 |
| - _run([ |
591 |
| - self.binary, "install", "@" + self.response_file, "--disable-metrics"]) |
592 |
| - |
593 |
| - @property |
594 |
| - def cmake_flags(self): |
595 |
| - return [ |
596 |
| - "-DCMAKE_TOOLCHAIN_FILE=%s" % self.toolchain_file, |
597 |
| - "-DVCPKG_TARGET_TRIPLET=%s" % self.triplet] |
598 |
| - |
599 |
| - |
600 | 555 | @attr.s(frozen=True, eq=False)
|
601 | 556 | class Failure(object):
|
602 | 557 | """Holds context for the failure of a testapp to build/run."""
|
|
0 commit comments