[AI Generated] BugFix: ensure tar package is installed before use#4441
Open
[AI Generated] BugFix: ensure tar package is installed before use#4441
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes tool bootstrapping on POSIX distros that don’t ship tar by default by making Tar correctly detect the binary and install the required package when missing, preventing downstream failures (e.g., Texinfo._install_from_src calling tar.extract()).
Changes:
- Implement real existence probing for
tarviacommand_exists()(instead of returningTrueunconditionally). - Implement
_install()to install thetarpackage via the POSIX package manager. - Enable framework-driven installation by setting
can_install = True.
✅ AI Test Selection — PASSED1 test case(s) selected (view run) Marketplace image: suse sles-15-sp6 gen2 latest
Test case details
|
On distro images that do not ship the GNU tar binary by default (e.g. Oracle Linux 10), the Tar tool's _check_exists() returned True unconditionally and _install() was not implemented, so any caller (such as Texinfo._install_from_src) hit "tar: command not found" (exit 127) when invoking tar.extract(). This change implements proper installation: - _check_exists() now actually probes for the tar binary via command_exists() instead of always returning True. - _install() installs the "tar" package via the Posix OS package manager. - can_install is set to True so the framework will trigger _install when the binary is missing.
eb193dd to
9e0b251
Compare
✅ AI Test Selection — PASSED1 test case(s) selected (view run) Marketplace image: suse sles-15-sp6 gen2 latest
Test case details
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On distro images that do not ship the GNU
tarbinary by default (e.g. Oracle Linux 10), theTartool's_check_exists()returnedTrueunconditionally and_install()was not implemented. Any caller (such asTexinfo._install_from_src) hittar: command not found(exit 127) when invokingtar.extract(), surfacing as:Fix
lisa/tools/tar.py:_check_exists()now actually probes for thetarbinary viacommand_exists()instead of always returningTrue._install()installs thetarpackage via the Posix OS package manager.can_installis set toTrueso the framework triggers_installwhen the binary is missing.The existing Suse-specific
bzip2dependency check is preserved.Validation
NetworkPerformace.perf_tcp_max_pps_syntheticoracle oracle-linux ol10-lvm-gen2 10.0.1Standard_D2ds_v5westus3Texinfo._install_from_src→tar.extract)black✓flake8✓pylint10/10 ✓