Re: [update] lang/go to 1.16

2021-03-03 Thread Stuart Henderson
On 2021/03/03 10:16, Janne Johansson wrote:
> Den lör 20 feb. 2021 kl 07:54 skrev Joel Sing :
> > On 21-02-19 17:22:09, Aaron Bieber wrote:
> > > Here is a fairly well tested update to Go. This version now uses libc[1] 
> > > thanks
> > > to jsing@'s hard work!
> >
> > Just to clarify, Go 1.16 uses libc-based syscalls for amd64 and
> > arm64. The remaining platforms (openbsd/386, openbsd/arm, openbsd/mips64)
> > are still using direct syscalls. Once this update lands I'll patch
> > the remaining platforms in ports.
> > >
> > > Also tested but not included: mips64 support \o/
> >
> > This will still require a little effort and bootstrap, I'll deal with
> > this once we've got Go 1.16 with libc-based syscalls for the existing
> > four platforms.
> 
> I did test mips64 and it took me a while to figure out the magic incantation*)
> for bootstrapping it, then make and make test works
> 
> 
> 
> # API check
> Go version is "go1.16", ignoring -next
> /usr/local/ports/pobj/go-1.16/go/api/next.txt
> 
> ALL TESTS PASSED
> 
> 
> but make install seems to lack two files:
> 
> `/usr/ports/pobj/go-1.16/fake-mips64/.fake_done' is up to date.
> ===>  Building package for go-1.16p1
> Create /usr/ports/packages/mips64/all/go-1.16p1.tgz
> Creating package go-1.16p1
> checksumming|*
> 
>   | 9%
> Error: 
> /usr/ports/pobj/go-1.16/fake-mips64/usr/local/go/pkg/openbsd_mips64/os/signal/internal/pty.a
> does not exist
> Error: 
> /usr/ports/pobj/go-1.16/fake-mips64/usr/local/go/pkg/openbsd_mips64/runtime/cgo.a
> does not exist
> pkg_create: can't continue
> 
> cgo.a should probably be missing, since the release notes for 1.16
> says cgo is a no-go for obsd/mips64, but why
> pty.a is missing I have no idea, nor how to unlist cgo.a in a decent way.

Quick way:

.if ${MACHINE_ARCH} == "mips64"
MIPS_COMMENT =  @comment
.else
MIPS_COMMENT =
.endif
SUBST_VARS +=   MIPS_COMMENT

and prefix the plist lines with ${MIPS_COMMENT}

If it gets complex then it needs arch-dependent PFRAG files and use PKG_ARGS
to select them, see the i386/amd64 files from before the update to go 1.5.2
(2015/12/05).

> *)   make GOROOT_BOOTSTRAP=/usr/local/go/bootstrap GOARCH=mips64
> after populating the bootstrap dir from the MASTER_SITES0 tgz
> 
> -- 
> May the most significant bit of your life be positive.
> 



Re: [update] lang/go to 1.16

2021-03-03 Thread Janne Johansson
>
> I did test mips64 and it took me a while to figure out the magic incantation*)
> for bootstrapping it, then make and make test works
>
> but make install seems to lack two files:

..and there were commits done to lang/go between my tests and this
mail of course. Will let the dust settle a bit...

-- 
May the most significant bit of your life be positive.



Re: [update] lang/go to 1.16

2021-03-03 Thread Janne Johansson
Den lör 20 feb. 2021 kl 07:54 skrev Joel Sing :
> On 21-02-19 17:22:09, Aaron Bieber wrote:
> > Here is a fairly well tested update to Go. This version now uses libc[1] 
> > thanks
> > to jsing@'s hard work!
>
> Just to clarify, Go 1.16 uses libc-based syscalls for amd64 and
> arm64. The remaining platforms (openbsd/386, openbsd/arm, openbsd/mips64)
> are still using direct syscalls. Once this update lands I'll patch
> the remaining platforms in ports.
> >
> > Also tested but not included: mips64 support \o/
>
> This will still require a little effort and bootstrap, I'll deal with
> this once we've got Go 1.16 with libc-based syscalls for the existing
> four platforms.

I did test mips64 and it took me a while to figure out the magic incantation*)
for bootstrapping it, then make and make test works



# API check
Go version is "go1.16", ignoring -next
/usr/local/ports/pobj/go-1.16/go/api/next.txt

ALL TESTS PASSED


but make install seems to lack two files:

`/usr/ports/pobj/go-1.16/fake-mips64/.fake_done' is up to date.
===>  Building package for go-1.16p1
Create /usr/ports/packages/mips64/all/go-1.16p1.tgz
Creating package go-1.16p1
checksumming|*

  | 9%
Error: 
/usr/ports/pobj/go-1.16/fake-mips64/usr/local/go/pkg/openbsd_mips64/os/signal/internal/pty.a
does not exist
Error: 
/usr/ports/pobj/go-1.16/fake-mips64/usr/local/go/pkg/openbsd_mips64/runtime/cgo.a
does not exist
pkg_create: can't continue

cgo.a should probably be missing, since the release notes for 1.16
says cgo is a no-go for obsd/mips64, but why
pty.a is missing I have no idea, nor how to unlist cgo.a in a decent way.

*)   make GOROOT_BOOTSTRAP=/usr/local/go/bootstrap GOARCH=mips64
after populating the bootstrap dir from the MASTER_SITES0 tgz

-- 
May the most significant bit of your life be positive.



Re: [update] lang/go to 1.16

2021-02-20 Thread Joel Sing
On 21-02-20 10:39:40, Stuart Henderson wrote:
> On 2021/02/20 17:53, Joel Sing wrote:
> > > -MAKE_ENV +=  GO386=387
> > 
> > We'll presumably want to keep this with GO386=softfloat - otherwise the
> > go binary package will only be useable on i386 CPUs with SSE support.
> 
> Yes, it's needed for ALIX/WRAP/net5501/net4801 which still just about
> work with OpenBSD (as long as you don't run anything consuming much RAM
> until after reorder_kernel is done, the LLVM linker is quite greedy).

Right, although you're more likely to run binary packages (hence
the go.port.mk change) on such a machine, rather than the go toolchain
itself (which the Makefile part should only cover). That said, I have
no strong preference here :)



Re: [update] lang/go to 1.16

2021-02-20 Thread Stuart Henderson
On 2021/02/20 17:53, Joel Sing wrote:
> > -MAKE_ENV +=GO386=387
> 
> We'll presumably want to keep this with GO386=softfloat - otherwise the
> go binary package will only be useable on i386 CPUs with SSE support.

Yes, it's needed for ALIX/WRAP/net5501/net4801 which still just about
work with OpenBSD (as long as you don't run anything consuming much RAM
until after reorder_kernel is done, the LLVM linker is quite greedy).



Re: [update] lang/go to 1.16

2021-02-19 Thread Joel Sing
On 21-02-19 17:22:09, Aaron Bieber wrote:
> Here is a fairly well tested update to Go. This version now uses libc[1] 
> thanks
> to jsing@'s hard work!

Just to clarify, Go 1.16 uses libc-based syscalls for amd64 and
arm64. The remaining platforms (openbsd/386, openbsd/arm, openbsd/mips64)
are still using direct syscalls. Once this update lands I'll patch
the remaining platforms in ports.

> Some other changes that impact OpenBSD:
> 
> - Modules are used by default now. This breaks  sysutils/amazon-ssm-agent,
>   sysutils/fleetctl and  textproc/loccount, but I have fixes standing by[2] 
> for
>   when this goes in.
> - GO386=387 support was dropped[3]. We now use "GO386=softfloat". I have done 
> a
>   mini-bulk on i386 and everything works as expected. 
> 
> Test results are fairly typical, amd64 and i386 pass, arm{v7,64} have some
> sporadic issues like before.
> 
> The diff also includes a fix for portgen. The behavior of 'go list -m all'
> changed a bit[4].
> 
> Also tested but not included: mips64 support \o/

This will still require a little effort and bootstrap, I'll deal with
this once we've got Go 1.16 with libc-based syscalls for the existing
four platforms.

> OK?

ok jsing@, see comment inline.

> [1] https://github.com/golang/go/issues/36435
> [2] https://github.com/openbsd/ports/compare/master...qbit:go1.16rc1
> [3] https://github.com/golang/go/issues/40255
> [4] https://github.com/golang/go/issues/44238
> 
> Index: infrastructure/lib/OpenBSD/PortGen/Port/Go.pm
> ===
> RCS file: /cvs/ports/infrastructure/lib/OpenBSD/PortGen/Port/Go.pm,v
> retrieving revision 1.7
> diff -u -p -r1.7 Go.pm
> --- infrastructure/lib/OpenBSD/PortGen/Port/Go.pm 16 Jan 2021 23:38:13 
> -  1.7
> +++ infrastructure/lib/OpenBSD/PortGen/Port/Go.pm 20 Feb 2021 00:18:03 
> -
> @@ -144,7 +144,7 @@ sub _go_mod_info
>   close $fh;
>  
>   # Outputs: "dep version"
> - my @raw_deps = $self->_run($dir, qw(go list -m all));
> + my @raw_deps = $self->_run($dir, qw(go list -mod=mod -m all));
>   my @deps;
>   my $all_deps = {};
>   foreach my $dep (@raw_deps) {
> Index: lang/go/Makefile
> ===
> RCS file: /cvs/ports/lang/go/Makefile,v
> retrieving revision 1.91
> diff -u -p -r1.91 Makefile
> --- lang/go/Makefile  21 Jan 2021 14:47:15 -  1.91
> +++ lang/go/Makefile  20 Feb 2021 00:18:03 -
> @@ -7,7 +7,7 @@ BIN_BOOTSTRAP_VERSION = 1.13.9
>  
>  COMMENT =Go programming language
>  
> -VERSION =1.15.7
> +VERSION =1.16
>  DISTNAME =   go${VERSION}.src
>  PKGNAME =go-${VERSION}
>  PKGSPEC =${FULLPKGNAME:S/go-/go-=/}
> @@ -54,11 +54,6 @@ GOARCH =   arm64
>  .elif ${MACHINE_ARCH} == "i386"
>  GOARCH = 386
>  .endif
> -
> -# We cannot assume that the maching running the built code will have SSE,
> -# even though the machine building the package has SSE. As such, we need
> -# to explicitly disable SSE on i386 builds.
> -MAKE_ENV +=  GO386=387

We'll presumably want to keep this with GO386=softfloat - otherwise the
go binary package will only be useable on i386 CPUs with SSE support.

>  .for arch in ${BIN_BOOTSTRAP_GOARCHS}
>  SUPDISTFILES +=  
> go-openbsd-${arch}-bootstrap-${BIN_BOOTSTRAP_VERSION}${EXTRACT_SUFX}:0
> Index: lang/go/distinfo
> ===
> RCS file: /cvs/ports/lang/go/distinfo,v
> retrieving revision 1.56
> diff -u -p -r1.56 distinfo
> --- lang/go/distinfo  21 Jan 2021 14:47:15 -  1.56
> +++ lang/go/distinfo  20 Feb 2021 00:18:03 -
> @@ -1,6 +1,6 @@
>  SHA256 (go-openbsd-arm-bootstrap-1.13.9.tar.gz) = 
> j+uAyYE4OsdncBvt6YDTXhjGc9gQq0XCjmSUdOesiq8=
>  SHA256 (go-openbsd-arm64-bootstrap-1.13.9.tar.gz) = 
> 84YoDEuNNmXbGCSzP8g5X1zqPdoOPB8yW71vsUL+5jw=
> -SHA256 (go1.15.7.src.tar.gz) = hjGzqv2Oy5JE7C/7iiqLSYPPStFVcrmAH3xbFnwaKrw=
> +SHA256 (go1.16.src.tar.gz) = dogGPVVlYQWJjzI9kKeaOcN42G/omuGS6zt/xGNHyVo=
>  SIZE (go-openbsd-arm-bootstrap-1.13.9.tar.gz) = 120208513
>  SIZE (go-openbsd-arm64-bootstrap-1.13.9.tar.gz) = 118521763
> -SIZE (go1.15.7.src.tar.gz) = 23017978
> +SIZE (go1.16.src.tar.gz) = 20895394
> Index: lang/go/go.port.mk
> ===
> RCS file: /cvs/ports/lang/go/go.port.mk,v
> retrieving revision 1.38
> diff -u -p -r1.38 go.port.mk
> --- lang/go/go.port.mk14 Feb 2021 23:35:22 -  1.38
> +++ lang/go/go.port.mk20 Feb 2021 00:18:03 -
> @@ -47,7 +47,7 @@ MODGO_GOPATH ?= ${MODGO_WORKSPACE}:${MO
>  # We cannot assume that the maching running the built code will have SSE,
>  # even though the machine building the package has SSE. As such, we need
>  # to explicitly disable SSE on i386 builds.
> -MAKE_ENV +=  GO386=387
> +MAKE_ENV +=  GO386=softfloat
>