Skip to content

Commit

Permalink
build.py: build vixdiskutil only when required
Browse files Browse the repository at this point in the history
vixdiskutil is incompatible with openssl-3.x currently.
So, build it only when required.

Change-Id: Ibd95ecf5c5078146faaa870e2e15dda1a05461e7
Signed-off-by: Shreenidhi Shedi <[email protected]>
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/17909
  • Loading branch information
sshedi committed Sep 20, 2022
1 parent da15136 commit 50e81da
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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():
Expand All @@ -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")
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 50e81da

Please sign in to comment.