From 2c326f8b33ce9d267649ec4411436d543e3a943a Mon Sep 17 00:00:00 2001 From: paco Date: Mon, 8 Jun 2020 13:16:26 +0000 Subject: [PATCH] add FIX_CLEANUP_PERMISSIONS and enable it by default on go.port.mk when using MODGO_MODNAME. This is needed to work around this issue: https://github.com/golang/go/issues/27455 which makes `make clean` because of the restrictive permissions. input and corrections from sthen@ and jca@ ok sthen@ jca@ espie@ --- infrastructure/mk/bsd.port.mk | 6 +++++- lang/go/go.port.mk | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/infrastructure/mk/bsd.port.mk b/infrastructure/mk/bsd.port.mk index 6470af96f95a..97377f3c38c9 100644 --- a/infrastructure/mk/bsd.port.mk +++ b/infrastructure/mk/bsd.port.mk @@ -1,6 +1,6 @@ #-*- mode: Makefile; tab-width: 4; -*- # ex:ts=4 sw=4 filetype=make: -# $OpenBSD: bsd.port.mk,v 1.1538 2020/06/01 08:41:36 espie Exp $ +# $OpenBSD: bsd.port.mk,v 1.1539 2020/06/08 13:16:26 paco Exp $ # # bsd.port.mk - 940820 Jordan K. Hubbard. # This file is in the public domain. @@ -166,6 +166,7 @@ _PLIST_DB = ${PLIST_REPOSITORY}/${MACHINE_ARCH} PACKAGE_REPOSITORY ?= ${PORTSDIR}/packages FIX_EXTRACT_PERMISSIONS ?= No +FIX_CLEANUP_PERMISSIONS ?= No .if !exists(${X11BASE}/man/mandoc.db) . if exists(${X11BASE}/man/whatis.db) @@ -3222,6 +3223,9 @@ _internal-clean: . for l in ${_WRKDIRS} . if "$l" != "" @if [ -L $l ]; then ${_PBUILD} rm -rf `readlink $l`; fi +. if ${FIX_CLEANUP_PERMISSIONS:L} == "yes" + @if [ -e $l ]; then ${_PBUILD} chmod -R +rwX $l; fi +. endif @if [ -e $l ]; then ${_PBUILD} rm -rf $l; fi . endif . endfor diff --git a/lang/go/go.port.mk b/lang/go/go.port.mk index f87d511be536..a432e157b809 100644 --- a/lang/go/go.port.mk +++ b/lang/go/go.port.mk @@ -1,4 +1,4 @@ -# $OpenBSD: go.port.mk,v 1.31 2020/05/17 13:08:20 ajacoutot Exp $ +# $OpenBSD: go.port.mk,v 1.32 2020/06/08 13:16:27 paco Exp $ ONLY_FOR_ARCHS ?= ${GO_ARCHS} @@ -71,6 +71,8 @@ DISTFILES += ${MODGO_DIST_SUBDIR}/${_modpath}/@v/${_modver}.mod{${_modpath}/@v/$ . endfor MAKE_ENV += GOPROXY=file://${DISTDIR}/${MODGO_DIST_SUBDIR} MAKE_ENV += GO111MODULE=on GOPATH="${MODGO_GOPATH}" +# Workaround for https://github.com/golang/go/issues/27455 +FIX_CLEANUP_PERMISSIONS = Yes .else # ports are not allowed to fetch from the network at build time; point # GOPROXY at an unreachable host so that failures are also visible to