Skip to content

Commit

Permalink
source installer: add build_deps field
Browse files Browse the repository at this point in the history
Signed-off-by: Konstantin Olshanov <[email protected]>
  • Loading branch information
Konstantin Olshanov authored and paboldin committed Aug 10, 2024
1 parent 22acf02 commit 518ca35
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lisa/transformers/kernel_source_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ class SourceInstallerSchema(BaseInstallerSchema):
),
)

# Additional build dependencies
build_deps: List[str] = field(default_factory=list)


class SourceInstaller(BaseInstaller):
_code_path: PurePath
Expand Down Expand Up @@ -143,7 +146,7 @@ def install(self) -> str:
runbook: SourceInstallerSchema = self.runbook
assert runbook.location, "the repo must be defined."

self._install_build_tools(node)
self._install_build_tools(node, runbook.build_deps)

factory = subclasses.Factory[BaseLocation](BaseLocation)
source = factory.create_by_runbook(
Expand Down Expand Up @@ -309,14 +312,14 @@ def _fix_mirrorlist_to_vault(self, node: Node) -> None:
/^baseurl=/ s/mirror/vault/\
' /etc/yum.repos.d/CentOS-*.repo", shell=True, sudo=True)

def _install_build_tools(self, node: Node) -> None:
def _install_build_tools(self, node: Node, build_deps: list[str]) -> None:
os = node.os
self._log.info("installing build tools")
if isinstance(node.os, Redhat) and node.os.information.version < "8.0.0":
self._fix_mirrorlist_to_vault(node)
if isinstance(os, Redhat):
for package in list(
["elfutils-libelf-devel", "openssl-devel", "dwarves", "bc"]
["elfutils-libelf-devel", "openssl-devel", "dwarves", "bc"] + build_deps
):
if os.is_package_in_repo(package):
os.install_packages(package)
Expand Down Expand Up @@ -345,7 +348,7 @@ def _install_build_tools(self, node: Node) -> None:
"libssl-dev",
"bc",
"ccache",
]
] + build_deps
)
elif isinstance(os, CBLMariner):
os.install_packages(
Expand All @@ -364,7 +367,7 @@ def _install_build_tools(self, node: Node) -> None:
"xz-libs",
"openssl-libs",
"openssl-devel",
]
] + build_deps
)
else:
raise LisaException(
Expand Down

0 comments on commit 518ca35

Please sign in to comment.