feat(system): detect ubuntu/debian derivative distros via id_like fallback#327
Open
s3bc40 wants to merge 2 commits intoCodSpeedHQ:mainfrom
Open
feat(system): detect ubuntu/debian derivative distros via id_like fallback#327s3bc40 wants to merge 2 commits intoCodSpeedHQ:mainfrom
s3bc40 wants to merge 2 commits intoCodSpeedHQ:mainfrom
Conversation
Required to access `System::distribution_id_like()`, which exposes the `ID_LIKE` field from `/etc/os-release` and enables detecting Ubuntu/Debian derivative distributions. `System::physical_core_count()` became an associated function in this version — adapted call site in `system/info.rs` accordingly.
…lback Add `from_id_like()` to fall back to the `ID_LIKE` parent chain when the primary distro ID is unrecognized. Fixes valgrind setup failing on Pop!_OS (`ID=pop`, `ID_LIKE="ubuntu debian"`). Tests also cover Ubuntu and CentOS.
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.
Closes #326
Summary
sysinfoto0.38.4to accessSystem::distribution_id_like()LinuxDistribution::from_id_like()which falls back to theID_LIKEparent chain when the primary distro ID is unrecognizedSystem::physical_core_count()call site insystem/info.rs(became an associated function in0.38)Test plan
pop_os_resolves_to_ubuntu_via_id_like— primary fix caseubuntu_resolves_directly_without_id_like— existing behavior unchangedcentos_with_unrecognized_parents_is_other— unrecognized lineage staysOtherofc if it does not comply with your needs, you can close the PR 👍