Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/integration_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ jobs:
goarch: amd64
- goos: illumos
goarch: amd64
- goos: plan9
goarch: amd64
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

- Release artifacts and cross-compile CI now include `arm` and `arm64` for
FreeBSD, OpenBSD, and NetBSD.
- Added native-gated Plan 9 (`plan9/amd64`) fact support for canonical
OS/kernel identity, hostname, architecture/hardware, memory total, processor
count/ISA/models, basic IPv4 networking, uptime, timezone, path, schema docs,
a native `rc` release gate, and CI cross-compile coverage. Plan 9 release
artifacts remain a separate promotion decision.

### Fixed

Expand Down
23 changes: 18 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@ tools).

## Platform scope

Release targets: **Linux, macOS/Darwin, Windows, FreeBSD, OpenBSD, and
NetBSD**. Solaris, AIX, DragonFly, and generic BSD-family paths are out of
scope — do not start work for them until a repeatable validation target
exists, and do not treat their gaps as blockers.
Release targets: **Linux, macOS/Darwin, Windows, FreeBSD, OpenBSD, NetBSD,
DragonFly BSD, and illumos**. Plan 9 has lab-validated fact support for
`plan9/amd64`, but it is not a published release artifact target until the
release matrix explicitly promotes it. Solaris, AIX,
generic BSD-family paths, and unvalidated Plan 9 tuples are out of scope — do
not start work for them until a repeatable validation target exists, and do not
treat their gaps as blockers.

## Benchmark discipline

Expand Down Expand Up @@ -98,6 +101,14 @@ the pipeline (`.github/workflows/unit_tests.yaml`):
`tools/illumos-release-gate.sh`. Local, untracked SSH wrappers can run the
same checks for `dragonfly/amd64` and `illumos/amd64`; Oracle Solaris is not
covered by the illumos gate.
- **Plan 9**: `plan9/amd64` facts are validated through the facts-lab Plan 9
guest and `tools/plan9-release-gate.rc`. The local flow is:
build `CGO_ENABLED=0 GOOS=plan9 GOARCH=amd64 go build ./cmd/facts`, copy the
binary and gate script through your configured facts-lab transport, then run
the gate with `facts-lab ssh plan9` (or a local untracked wrapper). Keep lab
hostnames, keys, guest addresses, and generated credentials out of tracked
files. Any Plan 9 release-gate fact must have a matching
`docs/schema/facts.yaml` entry and regenerated `docs/supported-facts/plan9.md`.

Local equivalents: `make lima-freebsd-smoke`, `make lima-linux-flavor-smoke`,
`make local-bsd-smoke`, `make local-amd64-bsd-smoke`,
Expand All @@ -110,7 +121,9 @@ The amd64 lab smoke targets are configured only through wrapper variables:
`LOCAL_NETBSD_AMD64_SSH`, `LOCAL_DRAGONFLY_AMD64_SSH`, and
`LOCAL_ILLUMOS_AMD64_SSH`. OpenBSD, NetBSD, and DragonFly wrappers must allow
`sudo -n` because their release gates read privileged disk labels. Real
`.local` wrapper scripts stay untracked.
`.local` wrapper scripts stay untracked. Plan 9 wrappers must invoke the
tracked `tools/plan9-release-gate.rc` and must not add private lab details to
the repository.

## The change workflow

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ LIMA_FREEBSD_FLAGS ?= --mount-none --cpus 2 --memory 4 --disk 40
LIMA_GO_CONTAINER_IMAGES ?= golang:1.26-bookworm golang:1.26-alpine
LIMA_DISTRO_IMAGES ?= debian:12-slim ubuntu:24.04 archlinux:latest oraclelinux:9
LIMA_LINUX_FLAVORS ?= ubuntu-lts debian fedora opensuse oraclelinux rocky almalinux alpine archlinux
LIMA_CROSS_TARGETS ?= linux/amd64 linux/arm64 windows/amd64 windows/arm64 darwin/amd64 darwin/arm64 freebsd/amd64 freebsd/arm freebsd/arm64 openbsd/amd64 openbsd/arm openbsd/arm64 netbsd/amd64 netbsd/arm netbsd/arm64 dragonfly/amd64 illumos/amd64
CROSS_TARGETS ?= linux/amd64 linux/arm64 windows/amd64 windows/arm64 darwin/amd64 darwin/arm64 freebsd/amd64 freebsd/arm freebsd/arm64 openbsd/amd64 openbsd/arm openbsd/arm64 netbsd/amd64 netbsd/arm netbsd/arm64 dragonfly/amd64 illumos/amd64 plan9/amd64

LIMA_LINUX_BINARY ?= dist/facts-linux-$(LIMA_GOARCH)
LIMA_FREEBSD_BINARY ?= dist/facts-freebsd-$(LIMA_GOARCH)
Expand Down Expand Up @@ -211,7 +211,7 @@ lima-build-linux-binary: lima-dev-bootstrap
CGO_ENABLED=0 GOOS=linux GOARCH=$(LIMA_GOARCH) go build -o "$(LIMA_LINUX_BINARY)" ./cmd/facts'

lima-cross-compile: lima-dev-bootstrap
@for target in $(LIMA_CROSS_TARGETS); do \
@for target in $(CROSS_TARGETS); do \
goos=$${target%/*}; \
goarch=$${target#*/}; \
echo "==> cross compile $$goos/$$goarch"; \
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ make build # builds ./facts from the project root
## Tested where it ships.

Every release target is a blocking CI gate — unit tests, the race detector over the engine, a built-binary smoke, and per-platform release-gate fact checks.
Plan 9 has lab-validated fact support for `plan9/amd64`; it is not listed as a
published release artifact target until that tuple is promoted in the release
matrix.

| Platform | Architectures | Gate | Supported facts |
| --- | --- | --- | --- |
Expand All @@ -131,6 +134,7 @@ Every release target is a blocking CI gate — unit tests, the race detector ove
| NetBSD | amd64, arm, arm64 | VM job + release-gate fact set | [NetBSD facts](docs/supported-facts/netbsd.md) |
| DragonFly BSD | amd64 | VM job + release-gate fact set | [DragonFly BSD facts](docs/supported-facts/dragonfly.md) |
| illumos | amd64 | VM job + release-gate fact set | [illumos facts](docs/supported-facts/illumos.md) |
| Plan 9 | amd64 | facts-lab release gate | [Plan 9 facts](docs/supported-facts/plan9.md) |

Requires Go 1.26+.

Expand Down
83 changes: 49 additions & 34 deletions docs/schema/facts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# type: string | integer | double | boolean | map | array
# description: what the fact means, one line
# platforms: the platforms that can emit it (linux, darwin, windows,
# freebsd, openbsd, netbsd, dragonfly, illumos)
# freebsd, openbsd, netbsd, dragonfly, illumos, plan9)
# conditional: true when presence depends on host state (cloud instances,
# swap, DMI visibility, installed tools); such entries may be
# absent from a discovery without it being a bug
Expand Down Expand Up @@ -168,7 +168,7 @@ ec2_userdata:
facterversion:
type: string
description: The Facter compatibility version of the Facts engine.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]

filesystems:
type: array
Expand Down Expand Up @@ -325,8 +325,8 @@ is_virtual:

kernel.name:
type: string
description: The kernel name, such as Linux, Darwin, windows, or FreeBSD.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
description: The kernel name, such as Linux, Darwin, windows, FreeBSD, or Plan 9.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
kernel.release.full:
type: string
description: The full kernel release reported by the system.
Expand Down Expand Up @@ -417,11 +417,13 @@ memory.system.capacity:
memory.system.total:
type: string
description: The display amount of total physical memory, such as 16.00 GiB.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
conditional: true
memory.system.total_bytes:
type: integer
description: The total physical memory, in bytes.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
conditional: true
memory.system.used:
type: string
description: The display amount of physical memory in use, such as 1.00 GiB.
Expand Down Expand Up @@ -493,16 +495,17 @@ networking.fqdn:
networking.hostname:
type: string
description: The short host name of the machine.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
conditional: true
networking.interfaces.*:
type: map
description: A network interface, keyed by interface name.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
conditional: true
networking.interfaces.*.bindings:
type: array
description: The IPv4 bindings of the interface (address, netmask, network).
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
conditional: true
networking.interfaces.*.bindings6:
type: array
Expand All @@ -527,7 +530,7 @@ networking.interfaces.*.duplex:
networking.interfaces.*.ip:
type: string
description: The first IPv4 address bound to the interface.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
conditional: true
networking.interfaces.*.ip6:
type: string
Expand All @@ -537,7 +540,7 @@ networking.interfaces.*.ip6:
networking.interfaces.*.mac:
type: string
description: The MAC address of the interface.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
conditional: true
networking.interfaces.*.mtu:
type: integer
Expand All @@ -547,7 +550,7 @@ networking.interfaces.*.mtu:
networking.interfaces.*.netmask:
type: string
description: The IPv4 netmask of the interface's first binding.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
conditional: true
networking.interfaces.*.netmask6:
type: string
Expand All @@ -557,7 +560,7 @@ networking.interfaces.*.netmask6:
networking.interfaces.*.network:
type: string
description: The IPv4 network of the interface's first binding.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
conditional: true
networking.interfaces.*.network6:
type: string
Expand Down Expand Up @@ -586,7 +589,8 @@ networking.interfaces.*.speed:
networking.ip:
type: string
description: The IPv4 address of the primary interface.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
conditional: true
networking.ip6:
type: string
description: The IPv6 address of the primary interface.
Expand All @@ -595,7 +599,8 @@ networking.ip6:
networking.mac:
type: string
description: The MAC address of the primary interface.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
conditional: true
networking.mtu:
type: integer
description: The maximum transmission unit of the primary interface.
Expand All @@ -604,7 +609,8 @@ networking.mtu:
networking.netmask:
type: string
description: The IPv4 netmask of the primary interface.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
conditional: true
networking.netmask6:
type: string
description: The IPv6 netmask of the primary interface.
Expand All @@ -613,7 +619,8 @@ networking.netmask6:
networking.network:
type: string
description: The IPv4 network of the primary interface.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
conditional: true
networking.network6:
type: string
description: The IPv6 network of the primary interface.
Expand All @@ -622,7 +629,8 @@ networking.network6:
networking.primary:
type: string
description: The name of the primary interface.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
conditional: true
networking.scope6:
type: string
description: The IPv6 scope of the primary interface, such as global or link.
Expand All @@ -632,7 +640,7 @@ networking.scope6:
os.architecture:
type: string
description: The operating system's hardware architecture, such as x86_64 or arm64.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
os.distro.codename:
type: string
description: The codename of the distribution release, such as noble.
Expand Down Expand Up @@ -666,12 +674,12 @@ os.distro.specification:
conditional: true
os.family:
type: string
description: The operating system family, such as Debian, RedHat, Darwin, or windows.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
description: The operating system family, such as Debian, RedHat, Darwin, windows, or Plan 9.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
os.hardware:
type: string
description: The hardware model of the machine, such as x86_64.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
os.macosx.build:
type: string
description: The macOS build number, such as 24F74.
Expand Down Expand Up @@ -704,8 +712,8 @@ os.macosx.version.patch:
conditional: true
os.name:
type: string
description: The operating system name, such as Ubuntu, Darwin, or windows.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
description: The operating system name, such as Ubuntu, Darwin, windows, or Plan 9.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
os.release.branch:
type: string
description: The FreeBSD release branch, such as RELEASE-p5.
Expand Down Expand Up @@ -842,7 +850,7 @@ partitions.*.uuid:
path:
type: array
description: The PATH environment entries of the Facts process, in lookup order.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]

processors.cores:
type: integer
Expand All @@ -851,19 +859,22 @@ processors.cores:
processors.count:
type: integer
description: The number of logical processors.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
conditional: true
processors.extensions:
type: array
description: The instruction set architectures the processors support, including the base architecture and x86_64 microarchitecture levels.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
processors.isa:
type: string
description: The processor instruction set architecture, as reported by uname -p.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
description: The processor instruction set architecture, as reported by the platform.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
conditional: true
processors.models:
type: array
description: The processor model strings, one entry per logical processor.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
conditional: true
processors.physicalcount:
type: integer
description: The number of physical processor sockets.
Expand Down Expand Up @@ -912,24 +923,28 @@ system_profiler:
system_uptime.days:
type: integer
description: The whole days the system has been up.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
conditional: true
system_uptime.hours:
type: integer
description: The whole hours the system has been up.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
conditional: true
system_uptime.seconds:
type: integer
description: The seconds the system has been up.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
conditional: true
system_uptime.uptime:
type: string
description: The display form of the system uptime, such as 3 days.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]
conditional: true

timezone:
type: string
description: The abbreviated time zone name of the system, such as UTC.
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos]
platforms: [linux, darwin, windows, freebsd, openbsd, netbsd, dragonfly, illumos, plan9]

virtual:
type: string
Expand Down
1 change: 1 addition & 0 deletions docs/supported-facts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ These pages are generated from [`docs/schema/facts.yaml`](../schema/facts.yaml).
| [NetBSD](netbsd.md) | 117 |
| [DragonFly BSD](dragonfly.md) | 115 |
| [illumos](illumos.md) | 114 |
| [Plan 9](plan9.md) | 29 |
Loading
Loading