Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Few improvements to source installer #3249

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
source installer: add build_deps field
Signed-off-by: Konstantin Olshanov <kolshanov@cloudlinux.com>
  • Loading branch information
Konstantin Olshanov committed Apr 4, 2024
commit b26411604cccca1eb6a77bbe3cd09ed0f1a7870b
13 changes: 8 additions & 5 deletions lisa/transformers/kernel_source_installer.py
Original file line number Diff line number Diff line change
@@ -93,6 +93,9 @@ class SourceInstallerSchema(BaseInstallerSchema):
),
)

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


class SourceInstaller(BaseInstaller):
_code_path: PurePath
@@ -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(
@@ -302,12 +305,12 @@ def _build_code(self, node: Node, code_path: PurePath, kconfig_file: str) -> Non
# set timeout to 2 hours
make.make(arguments="", cwd=code_path, timeout=60 * 60 * 2)

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(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)
@@ -336,7 +339,7 @@ def _install_build_tools(self, node: Node) -> None:
"libssl-dev",
"bc",
"ccache",
]
] + build_deps
)
elif isinstance(os, CBLMariner):
os.install_packages(
@@ -355,7 +358,7 @@ def _install_build_tools(self, node: Node) -> None:
"xz-libs",
"openssl-libs",
"openssl-devel",
]
] + build_deps
)
else:
raise LisaException(