Skip to content

Commit c51f63a

Browse files
bors[bot]ritzk
andauthored
Merge #1316
1316: update require_kernel_version string to handle "_" in version string r=asomers a=ritzk test code breaks on fc333 ``` $ cargo test failures: ---- sys::test_socket::recvfrom::udp_offload::gro stdout ---- thread 'sys::test_socket::recvfrom::udp_offload::gro' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError("Extra junk after valid version: _64")', test/sys/test_socket.rs:292:13 ``` this is due underscore in release string( arch/x86_64), which is not supported by semver. ``` $ uname -r 5.8.14-300.fc33.x86_64 ``` Co-authored-by: Ritesh Khadgaray <[email protected]>
2 parents 07f8d12 + 853603a commit c51f63a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/test.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ cfg_if! {
9595

9696
let uname = nix::sys::utsname::uname();
9797

98-
let mut version = Version::parse(uname.release()).unwrap();
98+
// Linux may report version as 4.18.el8_2.x86_64 or 5.18.200-fc33.x86_64
99+
// semver sematics does not support underscore. Replace this with hypen.
100+
let mut version = Version::parse(
101+
&uname.release().to_string().replace("_", "-")
102+
).unwrap();
99103

100104
//Keep only numeric parts
101105
version.pre.clear();

0 commit comments

Comments
 (0)