From nobody Wed Dec 4 08:23:08 2024 X-Original-To: ports@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Y39Wp3BfKz5gBcH; Wed, 04 Dec 2024 08:23:18 +0000 (UTC) (envelope-from fuz@fuz.su) Received: from fuz.su (fuz.su [IPv6:2001:41d0:8:e508::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "fuz.su", Issuer "fuz.su" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y39Wp0VPdz4mg6; Wed, 4 Dec 2024 08:23:17 +0000 (UTC) (envelope-from fuz@fuz.su) Authentication-Results: mx1.freebsd.org; none Received: from fuz.su (localhost [127.0.0.1]) by fuz.su (8.18.1/8.18.1) with ESMTPS id 4B48N9Du060813 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 4 Dec 2024 09:23:09 +0100 (CET) (envelope-from fuz@fuz.su) Received: (from fuz@localhost) by fuz.su (8.18.1/8.18.1/Submit) id 4B48N9If060812; Wed, 4 Dec 2024 09:23:09 +0100 (CET) (envelope-from fuz) Date: Wed, 4 Dec 2024 09:23:08 +0100 From: Robert Clausecker To: Koichiro Iwao Cc: ports@freebsd.org, go@freebsd.org Subject: Re: go: exec go1.22.6: permission denied Message-ID: References: List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-ports@freebsd.org Sender: owner-freebsd-ports@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16276, ipnet:2001:41d0::/32, country:FR] X-Rspamd-Queue-Id: 4Y39Wp0VPdz4mg6 X-Spamd-Bar: ---- Am Wed, Dec 04, 2024 at 11:36:23AM +0900 schrieb Koichiro Iwao: > Hello folks, > > I got the following error when trying to build some go packages. I found > the cause so I'd like to share it if this help someone. > > # portmaster www/gohugo > ===> License APACHE20 accepted by the user > ===> gohugo-0.139.3,1 depends on file: /usr/local/sbin/pkg - found > ===> gohugo-0.139.3,1 depends on file: /usr/local/bin/go121 - found > ===> gohugo-0.139.3,1 depends on package: ca_root_nss>0 - found > ===> Fetching all distfiles required by gohugo-0.139.3,1 for building > ===> Fetching github.com/gohugoio/hugo dependencies > go: exec go1.22.6: permission denied > *** Error code 1 > > Stop. > make[1]: stopped in /usr/ports/www/gohugo > > It turns out this was because I had dropped exec bit on > zroot/usr/ports/distfiles a decade ago according to the previously > recommended filesystem layout. > > zfs create -o exec=off -o setuid=off zroot/usr/ports/distfiles > https://wiki.freebsd.org/RootOnZFS/PoolLayout > > After I turn on exec bit unser distfiles directory, it works > perfectly. > > zfs set exec=on zroot/usr/ports/distfiles The reason for this is that your package requires Go 1.22 to build, but Go 1.21 has been configured as the toolchain to use for this package. Go helpfully downloads a Go 1.22 toolchain and tries to use that to build the package, which fails as the distfiles are not executable. We should avoid this scenario by setting GOTOOLCHAIN=local in the environment when building Go ports. This forces Go to always use the installed Go toolchain instead of trying to download a different one. See https://go.dev/doc/toolchain#select for how this mechanism works. As a maintainer, you should set USES=go:1.22 when this happens, forcing the Go toolchain to at least 1.22. Yours, Robert Clausecker -- () ascii ribbon campaign - for an encoding-agnostic world /\ - against html email - against proprietary attachments