Created attachment 227687 [details] v1 (use "git am") lang/go(-devel) does not respect CC per https://docs.freebsd.org/en/books/porters-handbook/porting-dads/#dads-cc Reproduce by deleting 'cc' from jail and overriding CC to another value. Package contents did change; PORTREVISION is bumped for lang/go(-devel): 11.4/amd64: https://codeberg.org/ei/misc/commit/b7f9d4e30f1 11.4/i386: https://codeberg.org/ei/misc/commit/f3b9c5ec157 12.2/amd64: https://codeberg.org/ei/misc/commit/040234ee1e6 12.2/i386: https://codeberg.org/ei/misc/commit/9897cb3af0a 13.0/amd64: https://codeberg.org/ei/misc/commit/33deb678794 My 'misc' repository also contains bulk and testport logs for this change, not adding URL links to specific commits because codeberg did not generate log diff this time for some reason, diff between logs can also be observed by cloning the 'misc' repository and viewing with git if needed.
Are environment/user CFLAGS and other flags (LDFLAGS, etc) honoured? Honoured meaning 'appended', not just included
(In reply to Kubilay Kocak from comment #1) > Are environment/user CFLAGS and other flags (LDFLAGS, etc) honoured? This is not easily verifiable as lang/go build log is not verbose by default, and I am not familiar with Go build system to verbose build log. I added "CFLAGS" and "LDFLAGS" to Makefile to check, and it seems that Go can't build with these passed: =======================<phase: build >============================ ===== env: NO_DEPENDS=yes ===> Building for go-1.17_3,1 cd /wrkdirs/usr/ports/lang/go/work/go/src ; /usr/bin/env XDG_CACHE_HOME=/wrkdirs/usr/ports/lang/go/work GOROOT_BOOTSTRAP=/wrkdirs/usr/ports/lang/go/work/go-freebsd-amd64-bootstrap GOROOT=/wrkdirs/usr/ports/lang/go/work/go GOROOT_FINAL=/usr/local/go GOBIN= GOOS=freebsd GOARCH=amd64 GO386= GOARM= CC=cc CFLAGS=-O2 -pipe -fstack-protector-foo -fstack-protector-strong -fno-strict-aliasing LDFLAGS= -fstack-protector-strong /bin/sh make.bash -v env: -pipe: No such file or directory *** Error code 127 Also, this seems PR scope creep to me.
Created attachment 228168 [details] v1.1 (use "git am") Update to the latest ports.
ping
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=f55607ce7b906bd7886b857f568956880f4281ff commit f55607ce7b906bd7886b857f568956880f4281ff Author: Evgeniy Khramtsov <evgeniy@khramtsov.org> AuthorDate: 2021-11-08 06:19:59 +0000 Commit: Guangyuan Yang <ygy@FreeBSD.org> CommitDate: 2021-11-08 06:19:59 +0000 lang/go, lang/go-devel: Respect CC PR: 258291 lang/go-devel/Makefile | 2 +- lang/go/Makefile | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
Fixed, thanks!
(In reply to Guangyuan Yang from comment #6) See context in v1.1: @@ -90,6 +90,7 @@ do-build: GOARCH=${GOARCH_${ARCH}} \ GO386=${GO386} \ GOARM=${GOARM_${ARCH}} \ + CC=${CC} \ ${SH} make.bash -v vs ports f55607ce7: @@ -106,6 +106,7 @@ do-test: GOARCH=${GOARCH_${ARCH}} \ GO386=${GO386} \ GOARM=${GOARM_${ARCH}} \ + CC=${CC} \ ${SH} run.bash -no-rebuild The result is that CC is still not respected for "do-build" target: Building Go cmd/dist using /wrkdirs/usr/ports/lang/go/work/go-freebsd-amd64-bootstrap. (go1.14 freebsd/amd64) cmd/dist go tool dist: cannot invoke C compiler "clang": exec: "clang": executable file not found in $PATH Go needs a system C compiler for use with cgo. To set a C compiler, set CC=the-compiler. To disable cgo, set CGO_ENABLED=0. *** Error code 2 Stop. make: stopped in /usr/ports/lang/go Passing CC in do-build as in v1.1 unbreaks the build.
(In reply to Evgeniy Khramtsov from comment #7) Sorry - I manually edited the wrong place of the Makefile. Will fix it soon.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=2309e28d9e4f185b5de56f0b4e5b0bde857a3c3a commit 2309e28d9e4f185b5de56f0b4e5b0bde857a3c3a Author: Guangyuan Yang <ygy@FreeBSD.org> AuthorDate: 2021-11-15 21:52:27 +0000 Commit: Guangyuan Yang <ygy@FreeBSD.org> CommitDate: 2021-11-15 21:52:27 +0000 lang/go, lang/go-devel: Respect CC PR: 258291 Fixes: f55607ce7b906bd7886b857f568956880f4281ff Reported by: Evgeniy Khramtsov <evgeniy@khramtsov.org> lang/go-devel/Makefile | 2 +- lang/go/Makefile | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)