Created attachment 190789 [details] build log for beats-6.2.1 I tried to build port sysutils/beats, but got build error: ===> Building for beats-6.2.1 gmake[1]: Entering directory '/wrkdirs/usr/ports/sysutils/beats/work/beats-6.2.1/filebeat' go build -i go build runtime/cgo: open /usr/local/go/pkg/freebsd_amd64/runtime/cgo.a: permission denied gmake[1]: *** [../libbeat/scripts/Makefile:95: filebeat] Error 1 gmake[1]: Leaving directory '/wrkdirs/usr/ports/sysutils/beats/work/beats-6.2.1/filebeat' *** Error code 2 Stop. make: stopped in /usr/ports/sysutils/beats portsree: 18.02.2018
Hello, I saw this from the exp-run, but cannot reproduce it. What version of FreeBSD are you running? Which version of GO is installed? $ ls -l /usr/local/go/pkg/freebsd_amd64/runtime/cgo.a -rw-r--r-- 1 root wheel 30730 nov. 11 00:16 /usr/local/go/pkg/freebsd_amd64/runtime/cgo.a $ pkg which /usr/local/go/pkg/freebsd_amd64/runtime/cgo.a /usr/local/go/pkg/freebsd_amd64/runtime/cgo.a was installed by package go-1.9.2,1 What the permission mode of cgo.a on your system? Best regards, Palle
It *looks* like something is bad in the new go-1.10. @jlaffaye do you have any idea why building beats get permission denied for cgo.a ? Palle
Hello Palle, I built it by poudriere in standard environment, jail was created automatically, no special permissions was made, go-1.10 built by dependencies from this portstree (18.02.2018) with no errors.
Created attachment 190790 [details] go-1.10 build log
A commit references this bug: Author: girgen Date: Mon Feb 19 14:09:36 UTC 2018 New revision: 462321 URL: https://svnweb.freebsd.org/changeset/ports/462321 Log: Mark port as broken since it overwrites files from go-1.10 PR: 226039 Changes: head/sysutils/beats/Makefile
I see now, with an up to date ports tree, it overwrites files in /usr/local/go/pkg/freebsd_386/ /usr/local/go/pkg/freebsd_386/ /usr/local/go/pkg/freebsd_386/ that are owned by go-1.10. I'm setting the port as broken until I find a way to fix this. Palle
I have narrowed this down to the go-1.9.x -> go 1.10 update With go-1.9.4,1 it works fine: $ pwd; svn switch ^/head/lang/go@461268 /usr/ports/lang/go At revision 461268. $ but with go-1.10, it fails. It seems like something in the go build toolchain makes some atrange decisions? jlaffaye@, do you have any ideas? poudriere testport sysutils/beats # fails but cd /usr/ports/lang/go; svn switch ^/head/lang/go@461268 ; poudriere testport sysutils/beats # works since the port rewrites files in /usr/local/go/pkg/freebsd_386/ that are owned by go. There is notghin in the build description AFAIKS that makes the beats port do this, so my suspicion is that something changed in lang/go version 1.10. Palle
just for reference, poudriere finds this problem with the build_fs_violation target: ===> Building for beats-6.1.2 gmake[1]: Entering directory '/wrkdirs/usr/ports/sysutils/beats/work/beats-6.1.2/filebeat' go build -i gmake[1]: Leaving directory '/wrkdirs/usr/ports/sysutils/beats/work/beats-6.1.2/filebeat' gmake[1]: Entering directory '/wrkdirs/usr/ports/sysutils/beats/work/beats-6.1.2/heartbeat' go build -i gmake[1]: Leaving directory '/wrkdirs/usr/ports/sysutils/beats/work/beats-6.1.2/heartbeat' gmake[1]: Entering directory '/wrkdirs/usr/ports/sysutils/beats/work/beats-6.1.2/metricbeat' go build -i # _/wrkdirs/usr/ports/sysutils/beats/work/beats-6.1.2/metricbeat cc: warning: argument unused during compilation: '-nopie' gmake[1]: Leaving directory '/wrkdirs/usr/ports/sysutils/beats/work/beats-6.1.2/metricbeat' gmake[1]: Entering directory '/wrkdirs/usr/ports/sysutils/beats/work/beats-6.1.2/packetbeat' go build -i # _/wrkdirs/usr/ports/sysutils/beats/work/beats-6.1.2/packetbeat cc: warning: argument unused during compilation: '-nopie' gmake[1]: Leaving directory '/wrkdirs/usr/ports/sysutils/beats/work/beats-6.1.2/packetbeat' =========================================================================== =>> Checking for filesystem violations... done =>> Error: Filesystem touched during build: usr/local/go/pkg/freebsd_386/net.a: size (1140462, 1128886) usr/local/go/pkg/freebsd_386/runtime/cgo.a: size (36088, 16646) usr/local/go/pkg/freebsd_386/os/user.a: size (94840, 81780) build of sysutils/beats | beats-6.1.2 ended at Mon Feb 19 15:39:28 CET 2018 build time: 00:01:16 !!! build failure encountered !!! [00:01:20] Error: Build failed in phase: build_fs_violation [00:01:20] Cleaning up 103i386-default: removed 103i386-default-n: removed [00:01:22] Unmounting file systems
Created attachment 191130 [details] Patch to fix core golang lib overwrite The problem is that the beats libbeat Makefile has: GOBUILD_FLAGS?=-i This make it run "go build -i" instead of just "go build" hence the issue. Setting GOBUILD_FLAGS="" prevents the install.
A commit references this bug: Author: girgen Date: Fri Mar 2 14:55:27 UTC 2018 New revision: 463408 URL: https://svnweb.freebsd.org/changeset/ports/463408 Log: Update to 6.2.2 Fix the broken build with help from Steven Hartland. PR: 226039 Submitted by: Steven Hartland Changes: head/sysutils/beats/Makefile head/sysutils/beats/distinfo