From b2682fc05e64e1ecb6cb0987ae3b119c90d4416c Mon Sep 17 00:00:00 2001 From: Joe Lauer Date: Tue, 24 Oct 2023 14:15:46 -0400 Subject: [PATCH] Skip detecting ABI on anything other than linux --- src/main/java/com/fizzed/jne/PlatformInfo.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/com/fizzed/jne/PlatformInfo.java b/src/main/java/com/fizzed/jne/PlatformInfo.java index eeea44d..a19427b 100644 --- a/src/main/java/com/fizzed/jne/PlatformInfo.java +++ b/src/main/java/com/fizzed/jne/PlatformInfo.java @@ -285,6 +285,13 @@ public LinuxDetectedFilesResult init() { } static LinuxDetectedFilesResult doDetectLinuxLibFiles() { + // only do this on linux + final OperatingSystem os = detectOperatingSystem(); + if (os != OperatingSystem.LINUX) { + // skip doing this on anything other than linux + return null; + } + // issue: https://github.com/facebook/rocksdb/issues/9956 // some version of the kernel are missing mapped files, and its potentially slow as well final long now = System.currentTimeMillis(); @@ -344,6 +351,13 @@ public LinuxDetectedFilesResult init() { } static LinuxDetectedFilesResult doDetectLinuxMappedFiles() { + // only do this on linux + final OperatingSystem os = detectOperatingSystem(); + if (os != OperatingSystem.LINUX) { + // skip doing this on anything other than linux + return null; + } + // NOTE: this was only added in linux v3.3+, it will not work below that // https://github.com/dmlc/xgboost/issues/7915 // helpful technique discovered from https://github.com/xerial/sqlite-jdbc/blob/master/src/main/java/org/sqlite/util/OSInfo.java