|
72 | 72 | import platform
|
73 | 73 | import shutil
|
74 | 74 | import subprocess
|
| 75 | +import sys |
75 | 76 |
|
76 | 77 | from absl import app
|
77 | 78 | from absl import flags
|
|
82 | 83 | from integration_testing import config_reader
|
83 | 84 | from integration_testing import test_validation
|
84 | 85 | from integration_testing import xcodebuild
|
| 86 | +import utils |
85 | 87 |
|
86 | 88 | # Environment variables
|
87 | 89 | _JAVA_HOME = "JAVA_HOME"
|
@@ -194,10 +196,14 @@ def main(argv):
|
194 | 196 | config = config_reader.read_config()
|
195 | 197 | cmake_flags = _get_desktop_compiler_flags(FLAGS.compiler, config.compilers)
|
196 | 198 | 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 | + )) |
201 | 207 |
|
202 | 208 | failures = []
|
203 | 209 | for testapp in testapps:
|
@@ -438,7 +444,7 @@ def _build_ios(
|
438 | 444 | podfile_tool_path = os.path.join(
|
439 | 445 | root_dir, "scripts", "gha", "integration_testing", "update_podfile.py")
|
440 | 446 | podfile_patcher_args = [
|
441 |
| - "python", podfile_tool_path, |
| 447 | + sys.executable, podfile_tool_path, |
442 | 448 | "--sdk_podfile", os.path.join(root_dir, "ios_pod", "Podfile"),
|
443 | 449 | "--app_podfile", os.path.join(project_dir, "Podfile")
|
444 | 450 | ]
|
@@ -491,7 +497,7 @@ def _run_setup_script(root_dir, testapp_dir):
|
491 | 497 | """Runs the setup_integration_tests.py script if needed."""
|
492 | 498 | script_path = os.path.join(root_dir, "setup_integration_tests.py")
|
493 | 499 | if os.path.isfile(script_path):
|
494 |
| - _run(["python", script_path, testapp_dir]) |
| 500 | + _run([sys.executable, script_path, testapp_dir]) |
495 | 501 | else:
|
496 | 502 | logging.info("setup_integration_tests.py not found")
|
497 | 503 |
|
@@ -524,55 +530,6 @@ def _fix_path(path):
|
524 | 530 | return os.path.abspath(os.path.expanduser(path))
|
525 | 531 |
|
526 | 532 |
|
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 |
| - |
576 | 533 | @attr.s(frozen=True, eq=False)
|
577 | 534 | class Failure(object):
|
578 | 535 | """Holds context for the failure of a testapp to build/run."""
|
|
0 commit comments