diff --git a/base/comps/rust-nix/fix-4part-kernel-version.patch b/base/comps/rust-nix/fix-4part-kernel-version.patch deleted file mode 100644 index c1d4e3eb32d..00000000000 --- a/base/comps/rust-nix/fix-4part-kernel-version.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/test/common/mod.rs b/test/common/mod.rs -index 7dbdfbf..027611a 100644 ---- a/test/common/mod.rs -+++ b/test/common/mod.rs -@@ -133,7 +133,16 @@ cfg_if! { - .replace("_", "-") - // Cirrus-CI reports version as 4.19.112+ . Remove the + - .replace("+", ""); -- let mut version = Version::parse(fixed_release).unwrap(); -+ // Some distros (e.g. Azure Linux) use 4-part kernel versions -+ // like 6.6.121.1-1.azl3. Semver only accepts 3 numeric -+ // components, so replace the dot after the 3rd component with -+ // a hyphen so the extra part becomes a pre-release suffix -+ // (which we clear below anyway). -+ let fixed_release = match fixed_release.match_indices('.').nth(2) { -+ Some((pos, _)) => fixed_release[..pos].to_string() + &fixed_release[pos..].replacen('.', "-", 1), -+ None => fixed_release.to_string(), -+ }; -+ let mut version = Version::parse(&fixed_release).unwrap(); - - //Keep only numeric parts - version.pre = semver::Prerelease::EMPTY; diff --git a/base/comps/rust-nix/rust-nix.comp.toml b/base/comps/rust-nix/rust-nix.comp.toml index 3c0a76673f8..6735c963b68 100644 --- a/base/comps/rust-nix/rust-nix.comp.toml +++ b/base/comps/rust-nix/rust-nix.comp.toml @@ -1,20 +1,5 @@ [components.rust-nix] -# Azure Linux kernels use 4-part versions (e.g. 6.6.121.1-1.azl3) which the -# semver crate in test helpers cannot parse. Patch the require_kernel_version! -# macro to handle this by truncating to 3 numeric components. -[[components.rust-nix.overlays]] -description = "Add patch file to handle 4-part kernel versions in the require_kernel_version test macro" -type = "file-add" -file = "fix-4part-kernel-version.patch" -source = "fix-4part-kernel-version.patch" - -[[components.rust-nix.overlays]] -description = "Register the 4-part kernel version fix patch in the spec" -type = "spec-insert-tag" -tag = "Patch9999" -value = "fix-4part-kernel-version.patch" - # inotify tests fail with ENOSPC in containerized/mock build environments due # to exhausted inotify instance limits. [[components.rust-nix.overlays]]