zig icon indicating copy to clipboard operation
zig copied to clipboard

IoUring: fix an issue in tests where InvalidVersion might get thrown

Open Jiboo opened this issue 1 year ago • 1 comments

InvalidVersion might get thrown by skipKernelLessThan, due to some kernel versions not being SemVer compliant.

Which result in a bunch of InvalidVersion errors during unit tests:

error: 'os.linux.IoUring.test.accept/connect/send_zc/recv' failed: /home/jiboo/Projects/zig-fork/lib/std/SemanticVersion.zig:117:73: 0x1be34e3 in parse (test)
            for (id) |c| if (!std.ascii.isAlphanumeric(c) and c != '-') return error.InvalidVersion;
                                                                        ^
/home/jiboo/Projects/zig-fork/lib/std/os/linux/IoUring.zig:3506:5: 0x2bc9aea in test.accept/connect/send_zc/recv (test)
    try skipKernelLessThan(.{ .major = 6, .minor = 0, .patch = 0 });
    ^

Here's the result of my uname -r: 6.8.9-300.fc40.x86_64 the underscore makes this non compliant, I'm don't believe I've changed anything and I'm on a vanilla Fedora 40 setup.

I've attempted to fix this by stripping any extra from the release string returned from the uname call, prior to passing it to SemanticVersion.parse.

Closes #21166

Jiboo avatar May 19 '24 13:05 Jiboo

Feel like this should not use SemanticVersion at all if the linux kernel is not using semantic version :thinking:

Cloudef avatar Jun 26 '24 07:06 Cloudef

Feel like this should not use SemanticVersion at all if the linux kernel is not using semantic version 🤔

I suspect Linux distros just put whatever they feel like here, so anything we do is going to be best-effort.

alexrp avatar Oct 10 '24 12:10 alexrp