Skip to content

Commit

Permalink
add FIX_CLEANUP_PERMISSIONS and enable it by default on go.port.mk when
Browse files Browse the repository at this point in the history
using MODGO_MODNAME.

This is needed to work around this issue:
golang/go#27455

which makes `make clean` because of the restrictive permissions.

input and corrections from sthen@ and jca@
ok sthen@ jca@ espie@
  • Loading branch information
pacoesteban committed Jun 8, 2020
1 parent e4180ef commit 2c326f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion infrastructure/mk/bsd.port.mk
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion lang/go/go.port.mk
Original file line number Diff line number Diff line change
@@ -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}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2c326f8

Please sign in to comment.