Index | Thread | Search

From:
Jeremie Courreges-Anglas <jca@wxcvbn.org>
Subject:
Re: [lang/go] remove mips64 support
To:
Joel Sing <joel@sing.id.au>
Cc:
ports@openbsd.org
Date:
Mon, 24 Jun 2024 17:35:07 +0200

Download raw body.

Thread
On Sun, Jun 23, 2024 at 01:56:44AM +1000, Joel Sing wrote:
> The openbsd/mips64 port is effectively unmaintainable. I've been
> trying to upstream the direct syscall to libc conversion for two
> years now:
> 
>   https://github.com/golang/go/issues/61546
> 
> Currently, I'm carrying a bunch of extra diffs in ports, I have
> limited working hardware to build/test on and when it was broken
> in ports for multiple months, no one seemed to notice.
> 
> I think it's time to simply give up.

No opinion on that.  Kudos for trying!

> The below removes mips64 from GO_ARCHS, along with armv7 which
> seems like it should not be there.

Looks correct, arch-defines.mk talks about MACHINE_ARCH which should
be "arm" according to arch/arm/include/param.h.  I can't verify this
on a live system though.

> Remove mips64 from the
> lang/go Makefile and sort the MACHINE_ARCH handling list.
> Do the same in go.port.mk, however add riscv64 (neither mips64
> or riscv64 were there - not sure what the impact was).

No idea either.  I added this on top of the previous riscv64 bulk
build, and it didn't magically fix the go ports that fail.  Not very
surprising, AFAIK the problem with most/all of those ports lies within
module deps that are too old to know about openbsd/riscv64.  In the
unlikely event of a regression on riscv64, we can fix it up.

> ok?
> 
> P.S. I'll deal with the removal of mips64 specific patches in the
> upcoming Go 1.23 bump.

You also should remove the mips64 bootstraps from distinfo, as dpb(1)
would error out trying to download them.  Except for this, LGTM.

> Index: infrastructure/mk/arch-defines.mk
> ===================================================================
> RCS file: /cvs/ports/infrastructure/mk/arch-defines.mk,v
> diff -u -p -r1.106 arch-defines.mk
> --- infrastructure/mk/arch-defines.mk	16 May 2024 11:04:44 -0000	1.106
> +++ infrastructure/mk/arch-defines.mk	22 Jun 2024 15:38:10 -0000
> @@ -24,7 +24,7 @@ GCC4_ARCHS = alpha hppa sh sparc64
>  GCC3_ARCHS = m88k
>  # arches where certain ports are available
>  MONO_ARCHS = aarch64 amd64 i386
> -GO_ARCHS = aarch64 amd64 arm armv7 i386 mips64 riscv64
> +GO_ARCHS = aarch64 amd64 arm i386 riscv64
>  LUAJIT_ARCHS = aarch64 arm amd64 i386 powerpc
>  RUST_ARCHS = aarch64 amd64 i386 powerpc64 riscv64 sparc64
>  # arch-specific features that ocaml ports need to know about
> Index: lang/go/Makefile
> ===================================================================
> RCS file: /cvs/ports/lang/go/Makefile,v
> diff -u -p -r1.151 Makefile
> --- lang/go/Makefile	22 Jun 2024 12:43:03 -0000	1.151
> +++ lang/go/Makefile	22 Jun 2024 15:38:10 -0000
> @@ -1,6 +1,6 @@
>  ONLY_FOR_ARCHS =	${GO_ARCHS}
>  
> -BIN_BOOTSTRAP_GOARCHS =	386 amd64 arm arm64 mips64 riscv64
> +BIN_BOOTSTRAP_GOARCHS =	386 amd64 arm arm64 riscv64
>  BIN_BOOTSTRAP_VERSION = 1.20.4
>  
>  COMMENT =		Go programming language
> @@ -46,16 +46,14 @@ GOROOT =		${PREFIX}/go
>  GOROOT_BOOTSTRAP =
>  
>  # sync with go.port.mk
> -.if ${MACHINE_ARCH} == "amd64"
> +.if ${MACHINE_ARCH} == "aarch64"
> +GOARCH =		arm64
> +.elif ${MACHINE_ARCH} == "amd64"
>  GOARCH =		amd64
>  .elif ${MACHINE_ARCH} == "arm"
>  GOARCH =		arm
> -.elif ${MACHINE_ARCH} == "aarch64"
> -GOARCH =		arm64
>  .elif ${MACHINE_ARCH} == "i386"
>  GOARCH =		386
> -.elif ${MACHINE_ARCH} == "mips64"
> -GOARCH =		mips64
>  .elif ${MACHINE_ARCH} == "riscv64"
>  GOARCH =		riscv64
>  .endif
> Index: lang/go/go.port.mk
> ===================================================================
> RCS file: /cvs/ports/lang/go/go.port.mk,v
> diff -u -p -r1.73 go.port.mk
> --- lang/go/go.port.mk	22 Jun 2024 14:01:40 -0000	1.73
> +++ lang/go/go.port.mk	22 Jun 2024 15:38:10 -0000
> @@ -23,14 +23,16 @@ _subst := ${_subst}:S/${l:U}/!$l/g
>  BUILD_DEPENDS +=	${MODGO_BUILD_DEPENDS}
>  .endif
>  
> -.if ${MACHINE_ARCH} == "amd64"
> +.if ${MACHINE_ARCH} == "aarch64"
> +_GOARCH =	arm64
> +.elif ${MACHINE_ARCH} == "amd64"
>  _GOARCH =	amd64
>  .elif ${MACHINE_ARCH} == "arm"
>  _GOARCH =	arm
> -.elif ${MACHINE_ARCH} == "aarch64"
> -_GOARCH =	arm64
>  .elif ${MACHINE_ARCH} == "i386"
>  _GOARCH =	386
> +.elif ${MACHINE_ARCH} == "riscv64"
> +_GOARCH =	riscv64
>  .endif
>  
>  MODGO_PACKAGE_PATH =	${PREFIX}/go-pkg
> 

-- 
jca