As usual golang and ABI changes never work out, even years after.
This time it is a handmade copy of struct clockinfo that did not make it
over the bump in January 2021.
So add a patch to node_exporter to not use the hand made copy but instead
depend on x/sys/unix for the definition. Now x/sys/unix is a dumpster fire
but at least this way only one dumpster is burning and not all dumpsters in
the wrold.
This is something that should probably be fixed in -stable as well.
--
:wq Claudio
Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/node_exporter/Makefile,v
retrieving revision 1.16
diff -u -p -r1.16 Makefile
--- Makefile 19 Mar 2023 17:17:05 -0000 1.16
+++ Makefile 20 Apr 2023 10:13:56 -0000
@@ -2,7 +2,7 @@ COMMENT = prometheus exporter for hardw
MODGO_MODNAME = github.com/prometheus/node_exporter
MODGO_VERSION = v1.5.0
-REVISION = 0
+REVISION = 1
DISTNAME = node_exporter-${MODGO_VERSION}
Index: patches/patch-cpu-collector
===================================================================
RCS file: patches/patch-cpu-collector
diff -N patches/patch-cpu-collector
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-cpu-collector 20 Apr 2023 10:13:40 -0000
@@ -0,0 +1,32 @@
+Use correct definition of stuct clockinfo.
+
+diff --git collector/cpu_openbsd.go collector/cpu_openbsd.go
+index 13ee99a..8715ff9 100644
+--- collector/cpu_openbsd.go
++++ collector/cpu_openbsd.go
+@@ -25,14 +25,6 @@ import (
+ "golang.org/x/sys/unix"
+ )
+
+-type clockinfo struct {
+- hz int32
+- tick int32
+- tickadj int32
+- stathz int32
+- profhz int32
+-}
+-
+ const (
+ CP_USER = iota
+ CP_NICE
+@@ -72,8 +64,8 @@ func (c *cpuCollector) Update(ch chan<- prometheus.Metric)
(err error) {
+ if err != nil {
+ return err
+ }
+- clock := *(*clockinfo)(unsafe.Pointer(&clockb[0]))
+- hz := float64(clock.stathz)
++ clock := *(*unix.Clockinfo)(unsafe.Pointer(&clockb[0]))
++ hz := float64(clock.Stathz)
+
+ ncpus, err := unix.SysctlUint32("hw.ncpu")
+ if err != nil {