Repository navigation
Move NetBSD to oshi-common; wire NetBSD into FFM SystemInfo - #3360
Conversation
…temInfo NetBSD's implementation has no native dependencies (only command-line parsing and file reads), so the classes belong next to the other "no JNA / no FFM" platform code in oshi-common rather than oshi-core. Mirrors the abstract-base/POJO split convention already used by oshi-common's freebsd, openbsd, solaris, and aix packages. - All 25 NetBSD classes (8 software/os, 13 hardware, 2 util, 2 package-info) move from oshi-core/.../netbsd/ to oshi-common/.../common/.../netbsd/. The classes themselves stay concrete with no JNA or FFM subclass — for the now-supported FFM path, oshi-core-ffm SystemInfo instantiates the same shared classes. - FFM SystemInfo gains a NETBSD case in createOperatingSystem() and createHardware(), and NETBSD is added to SUPPORTED_PLATFORMS. JDK 25 on NetBSD is currently aspirational (no community port yet), but when one lands FFM mode will work without code changes. Issues #3347 (restore JNA-with-fallback for NetBSD) and #3348 (FFM-native bindings for NetBSD) remain open as future performance improvements. - Replaces the CupsPrinterJNA call in NetBsdHardwareAbstractionLayer with a new LpstatPrinter (oshi-common) concrete CupsPrinter subclass that uses lpstat shell output only. NetBSD's printer enumeration is unchanged in behavior, just no longer coupled to oshi-core. - FstatUtilTest switches from SystemInfo to ManagementFactory for the live-NetBSD PID, mirroring the FreeBSD ProcstatUtilTest pattern, so the test can live in oshi-common without depending on oshi-core. - Docs (README matrix, FAQ FFM platform list, FFM module-info, JNA-SystemInfo javadoc) updated to reflect NetBSD in the FFM supported set and AIX in the FFM list it had been missing. Tested with \`./mvnw clean install\` from root (all 788 tests pass).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
📝 WalkthroughWalkthroughThis PR consolidates NetBSD platform support by migrating all NetBSD-specific implementations from ChangesNetBSD FFM Support and Common Module Migration
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3360 +/- ##
============================================
- Coverage 75.02% 75.02% -0.01%
Complexity 76 76
============================================
Files 551 552 +1
Lines 22750 22755 +5
Branches 3759 3759
============================================
+ Hits 17068 17071 +3
+ Misses 3579 3578 -1
- Partials 2103 2106 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- oshi-common/module-info: add `requires java.management;` since NetBsdOperatingSystem.getProcessId() reads RuntimeMXBean. NetBSD VM test surfaced this — the class moved modules but its module-graph dependency didn't follow. - oshi-core/module-info: drop the now-unused `requires java.management;` line. Nothing in oshi-core references java.lang.management anymore after the NetBSD move. - FstatUtilTest: spotless re-ordered ManagementFactory into the java.* import block. - CHANGELOG: shorten the NetBSD entry to match the AIX one-liner format and add the PR number (#3360).
Summary
NetBSD's implementation has no native dependencies — it's all command-line parsing and file reads — so its platform classes belong next to oshi-common's other "no JNA / no FFM" code (FreeBSD bases, OpenBSD bases, Solaris bases, AIX bases) rather than over in oshi-core. This move + a small wiring change lets
oshi-core-ffmcover NetBSD too, closing the only remaining FFM platform gap that wasn't a JDK-25-availability problem.Companion to #3357 / #3359 — once this lands, the only platform
oshi-core-ffmdoesn't claim is DragonFly BSD (tracked separately by #3346, which adds a real FFM port mirroring the FreeBSD pattern).What changed
oshi.{software,hardware,util}.common.{os,platform}.unix.netbsdpackages. Mirrors the layout already used for the other Unix platforms. Renames preserve git history.oshi-core-ffm/SystemInfo.javagainscase NETBSD:entries increateOperatingSystem()andcreateHardware()(instantiating the shared oshi-common classes), andNETBSDis added toSUPPORTED_PLATFORMS. JDK 25 on NetBSD is currently aspirational (no community port yet), but when one lands FFM mode just works.LpstatPrinterclass in oshi-common (oshi.hardware.common.platform.unix.LpstatPrinter) — a concreteCupsPrintersubclass that useslpstatshell output only, no libcups via JNA.NetBsdHardwareAbstractionLayernow callsLpstatPrinter.getPrinters()instead ofCupsPrinterJNA.getPrinters(). Printer enumeration behavior on NetBSD is functionally unchanged; it's just no longer coupled tooshi-core.FstatUtilTestswitches fromoshi.SystemInfotoManagementFactory.getRuntimeMXBean().getName()for the live-NetBSD PID, mirroring the FreeBSDProcstatUtilTestpattern, so the test can live inoshi-commonwithout depending onoshi-core.README.mdselection-matrix: NetBSD removed from the "unsupported platform" row; added to the FFM-supported rows.FAQ.mdFFM platform list: NetBSD and AIX added (AIX had been missing since the AIX-FFM port landed in 7.3.1-rc).oshi-core-ffm/module-info.java: same list update.oshi-core/SystemInfo.javajavadoc: same list update.CHANGELOG.mdentry under 7.3.1 New Features.module-info.test(oshi-common): adds--add-openslines for the three new NetBSD packages so JUnit Jupiter can reflectively access the test class.Issues
Test plan
./mvnw clean installfrom repo root passes (all 788 tests).oshi-common,oshi-core,oshi-core-ffm.oshi-coreSystemInfo against the moved classes (the actual functional regression check).Summary by CodeRabbit
New Features
Chores