From 76f62a201c42d119eaccbdc8d4cd8dc4b1cf1663 Mon Sep 17 00:00:00 2001 From: Federico Iezzi Date: Mon, 18 Nov 2024 13:56:23 -0800 Subject: [PATCH] Ensure texinfo can be installed on rhel-based systems PiperOrigin-RevId: 697748020 --- .../linux_packages/build_tools.py | 2 +- perfkitbenchmarker/linux_packages/texinfo.py | 35 +++++++++++++++---- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/perfkitbenchmarker/linux_packages/build_tools.py b/perfkitbenchmarker/linux_packages/build_tools.py index 848f1fbbaf..18fcc698d2 100644 --- a/perfkitbenchmarker/linux_packages/build_tools.py +++ b/perfkitbenchmarker/linux_packages/build_tools.py @@ -82,7 +82,7 @@ def BuildGccFromSource(vm, gcc_version): gcc_components = gcc_version.split('.') major = int(gcc_components[0]) if major >= 13: - vm.InstallPackages('texinfo') + vm.Install('texinfo') # build GCC on scratch disks for speed if possible build_dir = vm.GetScratchDir() if vm.scratch_disks else '~/' diff --git a/perfkitbenchmarker/linux_packages/texinfo.py b/perfkitbenchmarker/linux_packages/texinfo.py index f5df0ea816..0941eac89f 100644 --- a/perfkitbenchmarker/linux_packages/texinfo.py +++ b/perfkitbenchmarker/linux_packages/texinfo.py @@ -1,4 +1,4 @@ -# Copyright 2014 PerfKitBenchmarker Authors. All rights reserved. +# Copyright 2024 PerfKitBenchmarker Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,14 +13,37 @@ # limitations under the License. -"""Module containing build tools installation and cleanup functions.""" +"""Module containing texinfo installation and cleanup functions.""" +from perfkitbenchmarker import os_types -def YumInstall(_): - """Installs build tools on the VM.""" - pass + +def YumInstall(vm): + """Installs the texinfo package on the VM.""" + if vm.OS_TYPE == os_types.ROCKY_LINUX8: + vm.RemoteCommand('sudo dnf config-manager --set-enabled powertools') + elif vm.OS_TYPE == os_types.ROCKY_LINUX9: + vm.RemoteCommand('sudo dnf config-manager --set-enabled crb') + elif vm.OS_TYPE == os_types.RHEL8: + vm.RemoteCommand( + 'sudo dnf config-manager --set-enabled' + ' rhui-codeready-builder-for-rhel-8-x86_64-rhui-rpms' + ) + elif vm.OS_TYPE == os_types.RHEL9: + if vm.is_aarch64: + vm.RemoteCommand( + 'sudo dnf config-manager --set-enabled' + ' rhui-codeready-builder-for-rhel-9-aarch64-rhui-rpms' + ) + else: + vm.RemoteCommand( + 'sudo dnf config-manager --set-enabled' + ' rhui-codeready-builder-for-rhel-9-x86_64-rhui-rpms' + ) + + vm.InstallPackages('texinfo') def AptInstall(vm): - """Installs build tools on the VM.""" + """Installs the texinfo package on the VM.""" vm.InstallPackages('texinfo')