mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 22:35:24 +00:00
IoUring: fix an issue in tests where InvalidVersion might get thrown by skipKernelLessThan, due to some kernel versions not being SemVer compliant.
This commit is contained in:
parent
a9a88aa428
commit
901f344be2
@ -3886,7 +3886,13 @@ inline fn skipKernelLessThan(required: std.SemanticVersion) !void {
|
||||
}
|
||||
|
||||
const release = mem.sliceTo(&uts.release, 0);
|
||||
var current = try std.SemanticVersion.parse(release);
|
||||
// Strips potential extra, as kernel version might not be semver compliant, example "6.8.9-300.fc40.x86_64"
|
||||
const extra_index = std.mem.indexOfAny(u8, release, "-+");
|
||||
const stripped = release[0..(extra_index orelse release.len)];
|
||||
// Make sure the input don't rely on the extra we just stripped
|
||||
try testing.expect(required.pre == null and required.build == null);
|
||||
|
||||
var current = try std.SemanticVersion.parse(stripped);
|
||||
current.pre = null; // don't check pre field
|
||||
if (required.order(current) == .gt) return error.SkipZigTest;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user