From 50e81da786de727203074a059346ac49bd0fd0ce Mon Sep 17 00:00:00 2001 From: Shreenidhi Shedi Date: Tue, 20 Sep 2022 21:34:02 +0530 Subject: [PATCH] build.py: build vixdiskutil only when required vixdiskutil is incompatible with openssl-3.x currently. So, build it only when required. Change-Id: Ibd95ecf5c5078146faaa870e2e15dda1a05461e7 Signed-off-by: Shreenidhi Shedi Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/17909 --- build.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/build.py b/build.py index d83ac8daf9..04768e0f7b 100755 --- a/build.py +++ b/build.py @@ -118,6 +118,14 @@ photonDir = os.path.dirname(os.path.realpath(__file__)) +def build_vixdiskutil(): + if not os.path.exists(f"{photonDir}/tools/bin"): + cmdUtils.runShellCmd(f"mkdir -p {photonDir}/tools/bin") + + if not os.path.exists(f"{photonDir}/tools/bin/vixdiskutil"): + runShellCmd(f"make -C {photonDir}/tools/src/vixDiskUtil") + + class Build_Config: buildThreads = 1 stagePath = "" @@ -817,6 +825,8 @@ def distributed_build(): # TODO: should be moved to top import DistributedBuilder + build_vixdiskutil() + print("Distributed Building using kubernetes ...") with open(Build_Config.distributedBuildFile, "r") as configFile: distributedBuildConfig = json.load(configFile) @@ -892,7 +902,6 @@ def check_pre_reqs(): CheckTools.create_ph_builder_img() CheckTools.check_photon_installer() CheckTools.check_contain() - CheckTools.check_vixdiskutil() check_prerequesite["check-pre-reqs"] = True def create_ph_builder_img(): @@ -906,15 +915,6 @@ def create_ph_builder_img(): cmd = f"{cmd} {ph_docker_img} {ph_builder_tag}" runShellCmd(cmd) - def check_vixdiskutil(): - local_build = not configdict["photon-build-param"]["start-scheduler-server"] - if constants.buildArch == "x86_64" and local_build: - if not os.path.exists(f"{photonDir}/tools/bin"): - cmdUtils.runShellCmd(f"mkdir -p {photonDir}/tools/bin") - - if not os.path.exists(f"{photonDir}/tools/bin/vixdiskutil"): - runShellCmd(f"make -C {photonDir}/tools/src/vixDiskUtil") - def check_contain(): if not os.path.exists(f"{photonDir}/tools/bin"): cmdUtils.runShellCmd(f"mkdir -p {photonDir}/tools/bin") @@ -1116,6 +1116,9 @@ def build_image(self): BuildEnvironmentSetup.photon_stage() local_build = not configdict["photon-build-param"]["start-scheduler-server"] + if constants.buildArch == "x86_64" and local_build: + build_vixdiskutil() + if local_build: RpmBuildTarget.ostree_repo() print(f"Building {self.img_name} image")