Skip to content

FFM audit: cover NetBSD, and check the CUPS bindings on every Unix - #3746

Merged
dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:ffm-audit-netbsd-cups
Sep 20, 2026
Merged

dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:ffm-audit-netbsd-cups

Conversation

@dbwiddis

@dbwiddis dbwiddis commented Sep 20, 2026 •

Copy link
Copy Markdown
Member

Harness and CI only, so no CHANGELOG entry.

NetBSD job

The NetBSD FFM bindings merged in #3745 were not audited, because the signature audit had no NetBSD job. This adds one, with the per-platform includes/netbsd.txt and structs/netbsd.txt the other platforms have. lwp.h is in the include list for _lwp_self, and the two shared oshi.ffm.platform.unix layouts are mapped. Like the other Unix jobs it needs no JDK: the audit compiles assertions against the platform's headers using the base system's gcc, with python from pkgsrc.

CUPS bindings were silently unchecked

cups/cups.h was marked optional (?) in every Unix include list, so where the header was absent the audit skipped what depends on it. FreeBSD, OpenBSD and Solaris each reported the four CUPS bindings and the CUPS_DEST_T layout as "no SDK declaration" — which reads like a platform missing the symbol rather than a harness that could not see the header. Only Linux checked them, because the Ubuntu runner ships the headers already.

Each Unix job now installs the CUPS headers and sets CPATH to the ports or pkgsrc include directory, which neither compiler searches by default, and the ? comes off so a missing header fails the job instead of quietly reducing what is checked.

Before and after, from fork runs

Job Before After
FreeBSD 13 bindings checked, 4 undeclared 17 checked, 0 undeclared
OpenBSD 6 checked, 4 undeclared 10 checked, 0 undeclared
Solaris 14 checked, 4 undeclared 18 checked, 0 undeclared
NetBSD no job 10 checked, 0 undeclared

Struct coverage rises with it: FreeBSD 3 → 4 layouts, OpenBSD 2 → 3, Solaris 5 → 6, plus NetBSD's 2. All seven jobs report no signature or struct layout mismatches, so this adds checking without adding findings.

The remaining "no SDK declaration" entries on macOS and Windows are unrelated and unchanged: Objective-C runtime and Mach functions, the statfs64/getfsstat64 aliases, and the Windows battery IOCTL structures, none of which appear in a public header the harness can include.

Summary by CodeRabbit

  • Chores
    • Expanded platform compatibility validation to include NetBSD.
    • Improved verification across FreeBSD, OpenBSD, Solaris, and NetBSD environments.
    • Updated CUPS header handling so platform checks accurately reflect installed system libraries.
    • Added coverage for shared resource-limit and printing-related data layouts during platform audits.

The audit gains a NetBSD job, so the bindings added in #3745 are compared
against that platform's own headers rather than going unchecked. It runs on the
base system's gcc with pkgsrc python, and needs no JDK.

It also installs the CUPS headers on the Unix VMs and points the compiler at
them. cups/cups.h was marked optional in every Unix include list, so where it
was absent the audit silently skipped the four cupsFreeDests/cupsGetDefault/
cupsGetDests/cupsGetOption bindings and the CUPS_DEST_T layout: FreeBSD, OpenBSD
and Solaris each reported them as "no SDK declaration", which reads like a
platform that lacks the symbol rather than a harness that could not see it. With
the headers installed the `?` comes off, so a missing header now fails the job.

Verified on the fork: every Unix job reports 0 bindings with no SDK declaration
and no mismatches, where FreeBSD, OpenBSD and Solaris previously reported 4 each.
@coderabbitai

coderabbitai Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 08bb386b-c16b-4233-bef5-bb6d3e169be1

📥 Commits

Reviewing files that changed from the base of the PR and between 6c45ac1 and c935f70.

📒 Files selected for processing (6)
  • .github/ffm-audit/includes/freebsd.txt
  • .github/ffm-audit/includes/netbsd.txt
  • .github/ffm-audit/includes/openbsd.txt
  • .github/ffm-audit/includes/solaris.txt
  • .github/ffm-audit/structs/netbsd.txt
  • .github/workflows/ffm-audit.yaml

Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (7)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Test JDK 25, windows-latest
  • GitHub Check: Test JDK 25, macos-latest
  • GitHub Check: Lint (ForbiddenAPIs, Javadoc, SLF4J)
  • GitHub Check: Error Prone
  • GitHub Check: Lint (Spotless, Checkstyle)
  • GitHub Check: Analyze (java)
🧰 Additional context used
🪛 actionlint (1.7.12)
.github/workflows/ffm-audit.yaml

[error] 142-142: label "ubuntu-26.04" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2025-vs2026", "windows-2022", "windows-11-arm", "ubuntu-slim", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xlarge", "macos-latest-large", "macos-26-intel", "macos-26-xlarge", "macos-26-large", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xlarge", "macos-14-large", "macos-14", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)

🪛 zizmor (1.30.0)
.github/workflows/ffm-audit.yaml

[warning] 145-145: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🔇 Additional comments (6)
.github/ffm-audit/includes/freebsd.txt (1)

18-18: LGTM!

.github/ffm-audit/includes/openbsd.txt (1)

17-17: LGTM!

.github/ffm-audit/includes/solaris.txt (1)

24-24: LGTM!

.github/ffm-audit/includes/netbsd.txt (1)

1-17: LGTM!

.github/ffm-audit/structs/netbsd.txt (1)

9-10: LGTM!

.github/workflows/ffm-audit.yaml (1)

95-95: LGTM!

Also applies to: 97-98, 125-125, 127-128, 141-169, 185-185


📝 Walkthrough

Walkthrough

The audit configuration now requires CUPS headers on FreeBSD, OpenBSD, and Solaris, adds NetBSD header and layout mappings, and runs a new NetBSD 10.1 audit job.

Changes

FFM audit coverage

Layer / File(s) Summary
CUPS header audit inputs
.github/ffm-audit/includes/*
CUPS entries no longer use the leading ? marker. A NetBSD include list was added.
NetBSD layout mapping
.github/ffm-audit/structs/netbsd.txt
The audit maps RLIMIT_LAYOUT to struct rlimit and CUPS_DEST_T to cups_dest_t.
Platform audit workflow
.github/workflows/ffm-audit.yaml
FreeBSD, OpenBSD, and Solaris jobs install CUPS headers. A NetBSD 10.1 job runs the audit and uploads its artifact.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Workflow as ffm-audit workflow
  participant NetBSD as NetBSD 10.1 VM
  participant Audit as FFM signature audit
  participant Artifact as Workflow artifact store
  Workflow->>NetBSD: Install python313 and libcups
  Workflow->>NetBSD: Set CPATH=/usr/pkg/include
  NetBSD->>Audit: Run audit with python3.13 and gcc
  Audit->>Artifact: Upload ffm-audit-netbsd
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the two main changes: adding NetBSD coverage and extending CUPS binding checks across Unix platforms.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

❤️ Share

A rabbit checks the headers bright
NetBSD joins the audit flight
CUPS is found where paths now lead
Layout maps confirm each need
The workflow hops, then stores the light

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.21%. Comparing base (6c45ac1) to head (c935f70).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3746      +/-   ##
============================================
- Coverage     80.28%   80.21%   -0.08%     
  Complexity       94       94              
============================================
  Files           717      717              
  Lines         25662    25662              
  Branches       4335     4335              
============================================
- Hits          20604    20586      -18     
- Misses         2835     2849      +14     
- Partials       2223     2227       +4     
Flag Coverage Δ
linux 39.76% <ø> (+<0.01%) ⬆️
macos 40.59% <ø> (-0.05%) ⬇️
windows 46.89% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dbwiddis
dbwiddis merged commit 65816c7 into oshi:master Sep 20, 2026
20 checks passed
@dbwiddis
dbwiddis deleted the ffm-audit-netbsd-cups branch September 20, 2026 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant