Date: Fri, 01 May 2026 18:53:54 +0000 From: Robert Clausecker <fuz@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 22c128410721 - main - sysutils/beats*: fix build on armv7 Message-ID: <69f4f6c2.3a570.53c9a4d9@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/ports/commit/?id=22c1284107218bffffc201881f84cb01ed33b141 commit 22c1284107218bffffc201881f84cb01ed33b141 Author: Robert Clausecker <fuz@FreeBSD.org> AuthorDate: 2026-04-30 16:59:36 +0000 Commit: Robert Clausecker <fuz@FreeBSD.org> CommitDate: 2026-05-01 18:51:49 +0000 sysutils/beats*: fix build on armv7 The patch "patch-go-sysinfo" ports a Linux-only go module to FreeBSD. Due to two oversights, the patch did not build on armv7. Fix the patch, ensuring that all beats versions build on armv7 FreeBSD. A subtle bug is addressed, too: the patch would previously convert from microseconds to nanoseconds for time.Unix() by multiplying with time.Microsecond, which is not the correct value. Multiply with 1000 instead. Approved by: portmgr (build fix blanket) MFH: 2026Q2 --- sysutils/beats8/files/patch-go-sysinfo | 4 ++-- sysutils/beats91/files/patch-go-sysinfo | 4 ++-- sysutils/beats92/files/patch-go-sysinfo | 4 ++-- sysutils/beats93/files/patch-go-sysinfo | 30 +++++++++++++++--------------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/sysutils/beats8/files/patch-go-sysinfo b/sysutils/beats8/files/patch-go-sysinfo index 2ac3e3daee55..20b9bb9f7a37 100644 --- a/sysutils/beats8/files/patch-go-sysinfo +++ b/sysutils/beats8/files/patch-go-sysinfo @@ -649,7 +649,7 @@ + + const maxlen = uint(1024) + out := make([]C.char, maxlen) -+ if res, err := C.procstat_getpathname(procstat, &p.kinfo, &out[0], C.ulong(maxlen)); res != 0 { ++ if res, err := C.procstat_getpathname(procstat, &p.kinfo, &out[0], C.size_t(maxlen)); res != 0 { + return "", err + } + return C.GoString(&out[0]), nil @@ -945,7 +945,7 @@ + return time.Time{}, fmt.Errorf("failed to get host uptime: %w", err) + } + -+ bootTime := time.Unix(tv.Sec, tv.Usec*int64(time.Microsecond)) ++ bootTime := time.Unix(int64(tv.Sec), 1000*int64(tv.Usec)) + return bootTime, nil +} + diff --git a/sysutils/beats91/files/patch-go-sysinfo b/sysutils/beats91/files/patch-go-sysinfo index 2ac3e3daee55..20b9bb9f7a37 100644 --- a/sysutils/beats91/files/patch-go-sysinfo +++ b/sysutils/beats91/files/patch-go-sysinfo @@ -649,7 +649,7 @@ + + const maxlen = uint(1024) + out := make([]C.char, maxlen) -+ if res, err := C.procstat_getpathname(procstat, &p.kinfo, &out[0], C.ulong(maxlen)); res != 0 { ++ if res, err := C.procstat_getpathname(procstat, &p.kinfo, &out[0], C.size_t(maxlen)); res != 0 { + return "", err + } + return C.GoString(&out[0]), nil @@ -945,7 +945,7 @@ + return time.Time{}, fmt.Errorf("failed to get host uptime: %w", err) + } + -+ bootTime := time.Unix(tv.Sec, tv.Usec*int64(time.Microsecond)) ++ bootTime := time.Unix(int64(tv.Sec), 1000*int64(tv.Usec)) + return bootTime, nil +} + diff --git a/sysutils/beats92/files/patch-go-sysinfo b/sysutils/beats92/files/patch-go-sysinfo index 2ac3e3daee55..20b9bb9f7a37 100644 --- a/sysutils/beats92/files/patch-go-sysinfo +++ b/sysutils/beats92/files/patch-go-sysinfo @@ -649,7 +649,7 @@ + + const maxlen = uint(1024) + out := make([]C.char, maxlen) -+ if res, err := C.procstat_getpathname(procstat, &p.kinfo, &out[0], C.ulong(maxlen)); res != 0 { ++ if res, err := C.procstat_getpathname(procstat, &p.kinfo, &out[0], C.size_t(maxlen)); res != 0 { + return "", err + } + return C.GoString(&out[0]), nil @@ -945,7 +945,7 @@ + return time.Time{}, fmt.Errorf("failed to get host uptime: %w", err) + } + -+ bootTime := time.Unix(tv.Sec, tv.Usec*int64(time.Microsecond)) ++ bootTime := time.Unix(int64(tv.Sec), 1000*int64(tv.Usec)) + return bootTime, nil +} + diff --git a/sysutils/beats93/files/patch-go-sysinfo b/sysutils/beats93/files/patch-go-sysinfo index 2ac3e3daee55..0f4774b4989a 100644 --- a/sysutils/beats93/files/patch-go-sysinfo +++ b/sysutils/beats93/files/patch-go-sysinfo @@ -1,4 +1,4 @@ ---- vendor/github.com/elastic/go-sysinfo/internal/cgo/disabled.go.orig 2025-09-19 18:12:17 UTC +--- vendor/github.com/elastic/go-sysinfo/internal/cgo/disabled.go.orig 2026-04-30 16:18:17 UTC +++ vendor/github.com/elastic/go-sysinfo/internal/cgo/disabled.go @@ -0,0 +1,23 @@ +// Licensed to Elasticsearch B.V. under one or more contributor @@ -24,7 +24,7 @@ + +// Enabled is true if cgo was enabled at compile-time. +const Enabled = false ---- vendor/github.com/elastic/go-sysinfo/internal/cgo/enabled.go.orig 2025-09-19 18:12:17 UTC +--- vendor/github.com/elastic/go-sysinfo/internal/cgo/enabled.go.orig 2026-04-30 16:18:17 UTC +++ vendor/github.com/elastic/go-sysinfo/internal/cgo/enabled.go @@ -0,0 +1,23 @@ +// Licensed to Elasticsearch B.V. under one or more contributor @@ -50,7 +50,7 @@ + +// Enabled is true if cgo was enabled at compile-time. +const Enabled = true ---- vendor/github.com/elastic/go-sysinfo/providers/freebsd/defs_freebsd.go.orig 2025-09-19 18:12:17 UTC +--- vendor/github.com/elastic/go-sysinfo/providers/freebsd/defs_freebsd.go.orig 2026-04-30 16:18:17 UTC +++ vendor/github.com/elastic/go-sysinfo/providers/freebsd/defs_freebsd.go @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V. under one or more contributor @@ -86,7 +86,7 @@ +type kvmSwap C.struct_kvm_swap + +type clockInfo C.struct_clockinfo ---- vendor/github.com/elastic/go-sysinfo/providers/freebsd/doc.go.orig 2025-09-19 18:12:17 UTC +--- vendor/github.com/elastic/go-sysinfo/providers/freebsd/doc.go.orig 2026-04-30 16:18:17 UTC +++ vendor/github.com/elastic/go-sysinfo/providers/freebsd/doc.go @@ -0,0 +1,22 @@ +// Licensed to Elasticsearch B.V. under one or more contributor @@ -111,7 +111,7 @@ +package freebsd + +//go:generate sh -c "go tool cgo -godefs defs_freebsd.go > ztypes_freebsd.go" ---- vendor/github.com/elastic/go-sysinfo/providers/freebsd/host_freebsd_cgo.go.orig 2025-09-19 18:12:17 UTC +--- vendor/github.com/elastic/go-sysinfo/providers/freebsd/host_freebsd_cgo.go.orig 2026-04-30 16:18:17 UTC +++ vendor/github.com/elastic/go-sysinfo/providers/freebsd/host_freebsd_cgo.go @@ -0,0 +1,238 @@ +// Licensed to Elasticsearch B.V. under one or more contributor @@ -352,7 +352,7 @@ + elem := append([]string{fs.mountPoint}, p...) + return filepath.Join(elem...) +} ---- vendor/github.com/elastic/go-sysinfo/providers/freebsd/host_freebsd_cgo_test.go.orig 2025-09-19 18:12:17 UTC +--- vendor/github.com/elastic/go-sysinfo/providers/freebsd/host_freebsd_cgo_test.go.orig 2026-04-30 16:18:17 UTC +++ vendor/github.com/elastic/go-sysinfo/providers/freebsd/host_freebsd_cgo_test.go @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V. under one or more contributor @@ -408,7 +408,7 @@ + t.Log(string(data)) + }) +} ---- vendor/github.com/elastic/go-sysinfo/providers/freebsd/kvm_freebsd_cgo.go.orig 2025-09-19 18:12:17 UTC +--- vendor/github.com/elastic/go-sysinfo/providers/freebsd/kvm_freebsd_cgo.go.orig 2026-04-30 16:18:17 UTC +++ vendor/github.com/elastic/go-sysinfo/providers/freebsd/kvm_freebsd_cgo.go @@ -0,0 +1,58 @@ +// Licensed to Elasticsearch B.V. under one or more contributor @@ -469,7 +469,7 @@ + + return &swap, nil +} ---- vendor/github.com/elastic/go-sysinfo/providers/freebsd/process_freebsd_cgo.go.orig 2025-09-19 18:12:17 UTC +--- vendor/github.com/elastic/go-sysinfo/providers/freebsd/process_freebsd_cgo.go.orig 2026-04-30 16:18:17 UTC +++ vendor/github.com/elastic/go-sysinfo/providers/freebsd/process_freebsd_cgo.go @@ -0,0 +1,386 @@ +// Licensed to Elasticsearch B.V. under one or more contributor @@ -649,7 +649,7 @@ + + const maxlen = uint(1024) + out := make([]C.char, maxlen) -+ if res, err := C.procstat_getpathname(procstat, &p.kinfo, &out[0], C.ulong(maxlen)); res != 0 { ++ if res, err := C.procstat_getpathname(procstat, &p.kinfo, &out[0], C.size_t(maxlen)); res != 0 { + return "", err + } + return C.GoString(&out[0]), nil @@ -858,7 +858,7 @@ + + return &proc, nil +} ---- vendor/github.com/elastic/go-sysinfo/providers/freebsd/sysctl_freebsd.go.orig 2025-09-19 18:12:17 UTC +--- vendor/github.com/elastic/go-sysinfo/providers/freebsd/sysctl_freebsd.go.orig 2026-04-30 16:18:17 UTC +++ vendor/github.com/elastic/go-sysinfo/providers/freebsd/sysctl_freebsd.go @@ -0,0 +1,248 @@ +// Licensed to Elasticsearch B.V. under one or more contributor @@ -945,7 +945,7 @@ + return time.Time{}, fmt.Errorf("failed to get host uptime: %w", err) + } + -+ bootTime := time.Unix(tv.Sec, tv.Usec*int64(time.Microsecond)) ++ bootTime := time.Unix(int64(tv.Sec), 1000*int64(tv.Usec)) + return bootTime, nil +} + @@ -1109,7 +1109,7 @@ + } + return uint64(v) +} ---- vendor/github.com/elastic/go-sysinfo/providers/freebsd/sysctl_freebsd_test.go.orig 2025-09-19 18:12:17 UTC +--- vendor/github.com/elastic/go-sysinfo/providers/freebsd/sysctl_freebsd_test.go.orig 2026-04-30 16:18:17 UTC +++ vendor/github.com/elastic/go-sysinfo/providers/freebsd/sysctl_freebsd_test.go @@ -0,0 +1,137 @@ +// Licensed to Elasticsearch B.V. under one or more contributor @@ -1249,7 +1249,7 @@ + t.Logf("%#v", os) + }) +} ---- vendor/github.com/elastic/go-sysinfo/providers/freebsd/ztypes_freebsd.go.orig 2025-09-19 18:12:17 UTC +--- vendor/github.com/elastic/go-sysinfo/providers/freebsd/ztypes_freebsd.go.orig 2026-04-30 16:18:17 UTC +++ vendor/github.com/elastic/go-sysinfo/providers/freebsd/ztypes_freebsd.go @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V. under one or more contributor @@ -1291,7 +1291,7 @@ + Stathz int32 + Profhz int32 +} ---- vendor/github.com/elastic/go-sysinfo/providers/shared/fqdn.go.orig 2025-09-19 18:12:11 UTC +--- vendor/github.com/elastic/go-sysinfo/providers/shared/fqdn.go.orig 2026-04-30 16:18:09 UTC +++ vendor/github.com/elastic/go-sysinfo/providers/shared/fqdn.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations @@ -1302,7 +1302,7 @@ package shared ---- vendor/github.com/elastic/go-sysinfo/system.go.orig 2025-09-19 18:12:11 UTC +--- vendor/github.com/elastic/go-sysinfo/system.go.orig 2026-04-30 16:18:09 UTC +++ vendor/github.com/elastic/go-sysinfo/system.go @@ -26,6 +26,7 @@ import ( // Register host and process providers.home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69f4f6c2.3a570.53c9a4d9>
