pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: GO on macOS Monterrey



On 3/4/22 17:15, Greg A. Woods wrote:
At Fri, 4 Mar 2022 20:09:23 +0100, Adam <adam%netbsd.org@localhost> wrote:
Subject: Re: GO on macOS Monterrey

Has anyone looked into the possibility of using a newer GO
package than 1.4 for bootstrapping?  Apparently go 1.10 and
earlier depend on a kernel feature that has been removed from
Monterrey.
  go/build cmd/go fatal error: runtime: bsdthread_register error
  runtime stack:
runtime.throw(0x3ea895)
        /Users/bacon/Pkgsrc/pkg/go14/src/runtime/panic.go:491
        +0xad fp=0x7ff7bfefe390 sp=0x7ff7bfefe360
runtime.goenvs()
        /Users/bacon/Pkgsrc/pkg/go14/src/runtime/os_darwin.c:104
        +0x70 fp=0x7ff7bfefe3a8 sp=0x7ff7bfefe390
runtime.schedinit()
        /Users/bacon/Pkgsrc/pkg/go14/src/runtime/proc.c:144 +0x5f
        fp=0x7ff7bfefe3d0 sp=0x7ff7bfefe3a8
runtime.rt0_go(0x7ff7bfefe408, 0x4, 0x7ff7bfefe408, 0x0, 0x1000,
        0x4, 0x7ff7bfefe880, 0x7ff7bfefe8d0, 0x7ff7bfefe8d6,
        0x7ff7bfefe8d9, ...)
        /Users/bacon/Pkgsrc/pkg/go14/src/runtime/asm_amd64.s:95
        +0x116 fp=0x7ff7bfefe3d8 sp=0x7ff7bfefe3d0
*** Error code 2

You have to install lang/go-bin and add

GOROOT_BOOTSTRAP= ${LOCALBASE}/go-bin

to your mk.conf.

Index: lang/go/bootstrap.mk
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/lang/go/bootstrap.mk,v
retrieving revision 1.7
diff -u -r1.7 bootstrap.mk
--- lang/go/bootstrap.mk	14 Jul 2021 14:32:04 -0000	1.7
+++ lang/go/bootstrap.mk	4 Mar 2022 22:56:47 -0000
@@ -1,7 +1,7 @@
  # $NetBSD: bootstrap.mk,v 1.7 2021/07/14 14:32:04 jperkin Exp $

  .if !defined(GOROOT_BOOTSTRAP) || !exists(${GOROOT_BOOTSTRAP}/bin/go)
-.  if ${MACHINE_ARCH} == "aarch64"
+.  if ${MACHINE_ARCH} == "aarch64" || (${OPSYS} == "Darwin" && ${OSX_VERSION:R} >= 12)
  BUILD_DEPENDS+=		go-bin-[0-9]*:../../lang/go-bin
  GOROOT_BOOTSTRAP=	${PREFIX}/go-bin
  .  else


--
					Greg A. Woods <gwoods%acm.org@localhost>

Kelowna, BC     +1 250 762-7675           RoboHack <woods%robohack.ca@localhost>
Planix, Inc. <woods%planix.com@localhost>     Avoncote Farms <woods%avoncote.ca@localhost>

I was pondering what it would take to automate this dependency chain. If this works, it looks like a no-brainer that should be committed ASAP. I assume you have fully tested it?

Home | Main Index | Thread Index | Old Index