Re: something broke net/syncthing

2020-08-24 Thread Aaron Bieber


On Mon, Aug 24, 2020, at 3:38 AM, Stuart Henderson wrote:
> On 2020/08/22 00:12, Edd Barrett wrote:
> > On Sat, Aug 22, 2020 at 12:03:38AM +0100, Edd Barrett wrote:
> > > -WANTLIB += c pthread
> > 
> > I think I may have been wrong to remove this, even though `make
> > port-lib-depends-check` is happy.
> > 
> > Is that right Stuart?
> 
> You'll need to ask someone familiar with go. One of the problems with
> go ports is there is no mechanism to trigger updates when the compiler
> itself is updated (which will usually result in the built packages
> changing).
> 
> We don't really want a run dependency on the compiler but there's no
> other way to say "update this package when the compiler is updated"
> as there's no library dependency (the usual trigger for this..)
> 
>

Fwiw, jsing has a branch of upstream Go that makes the transition to using libc 
:
( https://github.com/4a6f656c/go/tree/openbsd-syscall , 
https://github.com/golang/go/issues/36435 )
Maybe we keep the wantlib until this is in our tree? Less work down the line 
maybe.



Re: something broke net/syncthing

2020-08-24 Thread Stuart Henderson
On 2020/08/22 00:12, Edd Barrett wrote:
> On Sat, Aug 22, 2020 at 12:03:38AM +0100, Edd Barrett wrote:
> > -WANTLIB += c pthread
> 
> I think I may have been wrong to remove this, even though `make
> port-lib-depends-check` is happy.
> 
> Is that right Stuart?

You'll need to ask someone familiar with go. One of the problems with
go ports is there is no mechanism to trigger updates when the compiler
itself is updated (which will usually result in the built packages
changing).

We don't really want a run dependency on the compiler but there's no
other way to say "update this package when the compiler is updated"
as there's no library dependency (the usual trigger for this..)



Re: something broke net/syncthing

2020-08-22 Thread Marcus MERIGHI
Hello Edd, 

e...@theunixzoo.co.uk (Edd Barrett), 2020.08.22 (Sat) 09:37 (CEST):
> On Sat, Aug 22, 2020 at 05:49:59AM +, Mikolaj Kucharski wrote:
> Updated diff (also put back WANTLIB):

works, thanks!

Marcus



Re: something broke net/syncthing

2020-08-22 Thread Edd Barrett
On Sat, Aug 22, 2020 at 05:49:59AM +, Mikolaj Kucharski wrote:
> I don't use syncthing, but that package name looks incorrect. String rc4
> is conflicting with flavor naming pattern. You need to drop the dash, so
> final package name is syncthing-1.9.0rc4

You're right.

This is confirmed by the suffix examples in packages-specs(7).

Updated diff (also put back WANTLIB):


Index: Makefile
===
RCS file: /cvs/ports/net/syncthing/Makefile,v
retrieving revision 1.30
diff -u -p -r1.30 Makefile
--- Makefile17 May 2020 16:10:25 -  1.30
+++ Makefile22 Aug 2020 07:33:00 -
@@ -1,10 +1,13 @@
 # $OpenBSD: Makefile,v 1.30 2020/05/17 16:10:25 edd Exp $
 
+BROKEN-aarch64 =golang.org/x/Sys/cpu panic (illegal instruction)
+
 COMMENT =  open decentralized synchronization utility
 
-V =1.5.0
-DISTNAME = syncthing-${V}
-DISTFILES =syncthing-source-v${V}${EXTRACT_SUFX}
+# Release candidate used so as to fix critical quic-go problem.
+V =1.9.0
+DISTNAME = syncthing-${V}rc4
+DISTFILES =syncthing-source-v${V}-rc.4${EXTRACT_SUFX}
 
 CATEGORIES =   net
 HOMEPAGE = https://syncthing.net/
@@ -16,7 +19,7 @@ PERMIT_PACKAGE = Yes
 
 WANTLIB += c pthread
 
-MASTER_SITES = https://github.com/syncthing/syncthing/releases/download/v${V}/
+MASTER_SITES = 
https://github.com/syncthing/syncthing/releases/download/v${V}-rc.4/
 
 WRKDIST =  ${WRKDIR}/syncthing
 WRKSRC =   ${WRKDIR}/go/src/github.com/syncthing/syncthing
Index: distinfo
===
RCS file: /cvs/ports/net/syncthing/distinfo,v
retrieving revision 1.20
diff -u -p -r1.20 distinfo
--- distinfo17 May 2020 16:10:25 -  1.20
+++ distinfo21 Aug 2020 22:46:07 -
@@ -1,2 +1,2 @@
-SHA256 (syncthing-source-v1.5.0.tar.gz) = 
S048m76d15aRnTABGLaBft/j25UTsGelhZFSSzxaJI0=
-SIZE (syncthing-source-v1.5.0.tar.gz) = 10475068
+SHA256 (syncthing-source-v1.9.0-rc.4.tar.gz) = 
F6cI6y/vvFwxfQi+U4lwf8II4PMyXUhKnWv1t/LMZ+o=
+SIZE (syncthing-source-v1.9.0-rc.4.tar.gz) = 11142237
Index: patches/patch-build_go
===
RCS file: /cvs/ports/net/syncthing/patches/patch-build_go,v
retrieving revision 1.11
diff -u -p -r1.11 patch-build_go
--- patches/patch-build_go  3 Jan 2020 17:57:35 -   1.11
+++ patches/patch-build_go  20 Aug 2020 18:47:05 -
@@ -23,12 +23,12 @@ Index: build.go
  }
  
  // These are repos we need to clone to run "go generate"
-@@ -466,7 +480,7 @@ func appendParameters(args []string, tags []string, pk
+@@ -527,7 +541,7 @@ func appendParameters(args []string, tags []string, pk
  
if !debugBinary {
// Regular binaries get version tagged and skip some debug 
symbols
--  args = append(args, "-ldflags", ldflags(path.Base(pkg)))
-+  args = append(args, "-x", "-ldflags", ldflags(path.Base(pkg)))
+-  args = append(args, "-ldflags", ldflags(tags))
++  args = append(args, "-x", "-ldflags", ldflags(tags))
} else {
// -gcflags to disable optimizations and inlining. Skip -ldflags
// because `Could not launch program: decoding dwarf section 
info at

-- 
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk



Re: something broke net/syncthing

2020-08-21 Thread Mikolaj Kucharski
Hi,

On Sat, Aug 22, 2020 at 12:03:38AM +0100, Edd Barrett wrote:
>  
> -V =  1.5.0
> -DISTNAME =   syncthing-${V}
> -DISTFILES =  syncthing-source-v${V}${EXTRACT_SUFX}
> +# Release candidate used so as to fix critical quic-go problem.
> +V =  1.9.0
> +DISTNAME =   syncthing-${V}-rc4
> +DISTFILES =  syncthing-source-v${V}-rc.4${EXTRACT_SUFX}
>  

$ make show=PKGNAMES
syncthing-1.9.0-rc4

I don't use syncthing, but that package name looks incorrect. String rc4
is conflicting with flavor naming pattern. You need to drop the dash, so
final package name is syncthing-1.9.0rc4

-- 
Regards,
 Mikolaj



Re: something broke net/syncthing

2020-08-21 Thread Edd Barrett
On Sat, Aug 22, 2020 at 12:03:38AM +0100, Edd Barrett wrote:
> -WANTLIB += c pthread

I think I may have been wrong to remove this, even though `make
port-lib-depends-check` is happy.

Is that right Stuart?

-- 
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk



Re: something broke net/syncthing

2020-08-21 Thread Edd Barrett
On Wed, Aug 19, 2020 at 01:45:12PM +0100, Stuart Henderson wrote:
> Alternatively we can mark it broken so people don't waste their time
> on it...

Here's a diff to fix this mess.

It must be built using go-1.15 that abieber@ just committed, and the
syncthing version is a release candidate, as the stable version doesn't
contain the go-quic fix we require.

aarch64 remains busted, but abieber@ is going to look into that I think.

All tests pass on amd64.

Give this a shot. OK?


Index: Makefile
===
RCS file: /cvs/ports/net/syncthing/Makefile,v
retrieving revision 1.30
diff -u -p -r1.30 Makefile
--- Makefile17 May 2020 16:10:25 -  1.30
+++ Makefile21 Aug 2020 22:45:02 -
@@ -1,10 +1,13 @@
 # $OpenBSD: Makefile,v 1.30 2020/05/17 16:10:25 edd Exp $
 
+BROKEN-aarch64 =golang.org/x/Sys/cpu panic (illegal instruction)
+
 COMMENT =  open decentralized synchronization utility
 
-V =1.5.0
-DISTNAME = syncthing-${V}
-DISTFILES =syncthing-source-v${V}${EXTRACT_SUFX}
+# Release candidate used so as to fix critical quic-go problem.
+V =1.9.0
+DISTNAME = syncthing-${V}-rc4
+DISTFILES =syncthing-source-v${V}-rc.4${EXTRACT_SUFX}
 
 CATEGORIES =   net
 HOMEPAGE = https://syncthing.net/
@@ -14,9 +17,7 @@ MAINTAINER =  Edd Barrett https://github.com/syncthing/syncthing/releases/download/v${V}/
+MASTER_SITES = 
https://github.com/syncthing/syncthing/releases/download/v${V}-rc.4/
 
 WRKDIST =  ${WRKDIR}/syncthing
 WRKSRC =   ${WRKDIR}/go/src/github.com/syncthing/syncthing
Index: distinfo
===
RCS file: /cvs/ports/net/syncthing/distinfo,v
retrieving revision 1.20
diff -u -p -r1.20 distinfo
--- distinfo17 May 2020 16:10:25 -  1.20
+++ distinfo21 Aug 2020 22:46:07 -
@@ -1,2 +1,2 @@
-SHA256 (syncthing-source-v1.5.0.tar.gz) = 
S048m76d15aRnTABGLaBft/j25UTsGelhZFSSzxaJI0=
-SIZE (syncthing-source-v1.5.0.tar.gz) = 10475068
+SHA256 (syncthing-source-v1.9.0-rc.4.tar.gz) = 
F6cI6y/vvFwxfQi+U4lwf8II4PMyXUhKnWv1t/LMZ+o=
+SIZE (syncthing-source-v1.9.0-rc.4.tar.gz) = 11142237
Index: patches/patch-build_go
===
RCS file: /cvs/ports/net/syncthing/patches/patch-build_go,v
retrieving revision 1.11
diff -u -p -r1.11 patch-build_go
--- patches/patch-build_go  3 Jan 2020 17:57:35 -   1.11
+++ patches/patch-build_go  20 Aug 2020 18:47:05 -
@@ -23,12 +23,12 @@ Index: build.go
  }
  
  // These are repos we need to clone to run "go generate"
-@@ -466,7 +480,7 @@ func appendParameters(args []string, tags []string, pk
+@@ -527,7 +541,7 @@ func appendParameters(args []string, tags []string, pk
  
if !debugBinary {
// Regular binaries get version tagged and skip some debug 
symbols
--  args = append(args, "-ldflags", ldflags(path.Base(pkg)))
-+  args = append(args, "-x", "-ldflags", ldflags(path.Base(pkg)))
+-  args = append(args, "-ldflags", ldflags(tags))
++  args = append(args, "-x", "-ldflags", ldflags(tags))
} else {
// -gcflags to disable optimizations and inlining. Skip -ldflags
// because `Could not launch program: decoding dwarf section 
info at

-- 
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk



Re: something broke net/syncthing

2020-08-19 Thread Stuart Henderson
On 2020/08/19 06:42, Aaron Bieber wrote:
> > Because the go ports stuff is slightly stupid you need to "make patch"
> > then "make" and quickly hit ^C before you can edit the files in WRKSRC
> > to generate a patch
> 
> Alternatively, this works for most cases and is less error prone that ^C:
>   alias 'gopatch=WRKDIST=$(make show=WRKSRC) make update-patches'

sigh

> We can update syncthing to use the quic patch, but IMO we should wait until
> it's merged before including it.

Really? the port has been built but broken for a month.

Alternatively we can mark it broken so people don't waste their time on it...



Re: something broke net/syncthing

2020-08-19 Thread Aaron Bieber
On Wed, 19 Aug 2020 at 13:25:42 +0100, Stuart Henderson wrote:
> On 2020/08/19 09:33, Edd Barrett wrote:
> > Hi Marcus,
> > 
> > On Wed, Aug 19, 2020 at 10:18:24AM +0200, Marcus MERIGHI wrote:
> > > This is just a selfish "ping"... I've hit it now, too.
> > 
> > We are waiting for quic-go to publish a fix. As soon as they do, we will
> > be on it!
> > 
> > FWIW, they've published a PR which should fix the issue, but it hasn't
> > been merged yet:
> > https://github.com/lucas-clemente/quic-go/pull/2720
> > 
> > I'll leave a comment asking if they can prioritise it, as I too am
> > without file synchronisation.
> > 
> > Thanks.
> > 
> > -- 
> > Best Regards
> > Edd Barrett
> > 
> > http://www.theunixzoo.co.uk
> > 
> 
> Since the port includes a vendored distfile can't we just patch it?
> Because the go ports stuff is slightly stupid you need to "make patch"
> then "make" and quickly hit ^C before you can edit the files in WRKSRC
> to generate a patch

Alternatively, this works for most cases and is less error prone that ^C:
  alias 'gopatch=WRKDIST=$(make show=WRKSRC) make update-patches'

We can update syncthing to use the quic patch, but IMO we should wait until
it's merged before including it.



Re: something broke net/syncthing

2020-08-19 Thread Stuart Henderson
On 2020/08/19 09:33, Edd Barrett wrote:
> Hi Marcus,
> 
> On Wed, Aug 19, 2020 at 10:18:24AM +0200, Marcus MERIGHI wrote:
> > This is just a selfish "ping"... I've hit it now, too.
> 
> We are waiting for quic-go to publish a fix. As soon as they do, we will
> be on it!
> 
> FWIW, they've published a PR which should fix the issue, but it hasn't
> been merged yet:
> https://github.com/lucas-clemente/quic-go/pull/2720
> 
> I'll leave a comment asking if they can prioritise it, as I too am
> without file synchronisation.
> 
> Thanks.
> 
> -- 
> Best Regards
> Edd Barrett
> 
> http://www.theunixzoo.co.uk
> 

Since the port includes a vendored distfile can't we just patch it?
Because the go ports stuff is slightly stupid you need to "make patch"
then "make" and quickly hit ^C before you can edit the files in WRKSRC
to generate a patch



Re: something broke net/syncthing

2020-08-19 Thread Edd Barrett
On Wed, Aug 19, 2020 at 12:22:02PM +0200, Theo Buehler wrote:
> It seems the Go update broke this.

Yes, it was the go-1.15 update, but we missed it because the failure is
at runtime.

FreeBSD and homebrew are also in the same boat...

-- 
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk



Re: something broke net/syncthing

2020-08-19 Thread Theo Buehler
On Wed, Aug 19, 2020 at 09:33:30AM +0100, Edd Barrett wrote:
> Hi Marcus,
> 
> On Wed, Aug 19, 2020 at 10:18:24AM +0200, Marcus MERIGHI wrote:
> > This is just a selfish "ping"... I've hit it now, too.
> 
> We are waiting for quic-go to publish a fix. As soon as they do, we will
> be on it!
> 
> FWIW, they've published a PR which should fix the issue, but it hasn't
> been merged yet:
> https://github.com/lucas-clemente/quic-go/pull/2720
> 
> I'll leave a comment asking if they can prioritise it, as I too am
> without file synchronisation.

It seems the Go update broke this.

If I build and install Go 1.13.9 (just cvs -q up -D20200716 -Pd in
lang/go, then build & install) on -current and then build and install
syncthing, it appears to work. If I build syncthing with Go 1.15beta1, I
see this panic.

Presumably the SYSTEM_VERSION bump forced users to update to the package
built from Go 1.15beta1.



Re: something broke net/syncthing

2020-08-19 Thread Edd Barrett
Hi Marcus,

On Wed, Aug 19, 2020 at 10:18:24AM +0200, Marcus MERIGHI wrote:
> This is just a selfish "ping"... I've hit it now, too.

We are waiting for quic-go to publish a fix. As soon as they do, we will
be on it!

FWIW, they've published a PR which should fix the issue, but it hasn't
been merged yet:
https://github.com/lucas-clemente/quic-go/pull/2720

I'll leave a comment asking if they can prioritise it, as I too am
without file synchronisation.

Thanks.

-- 
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk



Re: something broke net/syncthing

2020-08-19 Thread Marcus MERIGHI
Hello!

Thanks for your work on ports, Edd and Aaron!

This is just a selfish "ping"... I've hit it now, too.

On amd64 -current as of yesterday. The error I get is the same.

Marcus

$ syncthing
panic: qtls.ClientSessionState not compatible with tls.ClientSessionState

goroutine 1 [running]:
github.com/syncthing/syncthing/vendor/github.com/lucas-clemente/quic-go/internal/handshake.init.1()

/usr/obj/ports/syncthing-1.5.0/go/src/github.com/syncthing/syncthing/vendor/github.com/lucas-clemente/quic
-go/internal/handshake/unsafe.go:20 +0x112

aa...@bolddaemon.com (Aaron Bieber), 2020.08.11 (Tue) 01:07 (CEST):
> I hit this with go-ipfs too. 
> https://github.com/lucas-clemente/quic-go/issues/2614
> 
> Not sure what the best course of action is.
> 
> PGP: 0x1F81112D62A9ADCE / 3586 3350 BFEA C101 DB1A  4AF0 1F81 112D 62A9 ADCE
> 
> On Mon, Aug 10, 2020, at 5:01 PM, Edd Barrett wrote:
> > Hi all,
> > 
> > Just got a email from a user saying that syncthing is broken on the
> > latest snapshot. Just checked and I can reproduce it:
> > 
> > ```
> > $ syncthing
> > panic: qtls.ClientSessionState not compatible with tls.ClientSessionState
> > 
> > goroutine 1 [running]:
> > github.com/syncthing/syncthing/vendor/github.com/lucas-clemente/quic-go/internal/handshake.init.1()
> > 
> > /usr/obj/ports/syncthing-1.5.0/go/src/github.com/syncthing/syncthing/vendor/github.com/lucas-clemente/quic-go/internal/handshake/unsafe.go:20
> >  +0x112
> > ```
> > 
> > Note that I could only reproduce this when removing and reinstalling the
> > package. There hasn't been an update to syncthing recently, so something
> > else must have busted it.
> > 
> > I'm out of time tonight, but any ideas? Clang 10? Surely not.
> > 
> > CC abieber@ -- local golang guru.
> > 
> > -- 
> > Best Regards
> > Edd Barrett
> > 
> > http://www.theunixzoo.co.uk
> >
> 



Re: something broke net/syncthing

2020-08-10 Thread Aaron Bieber
I hit this with go-ipfs too. 
https://github.com/lucas-clemente/quic-go/issues/2614

Not sure what the best course of action is.

PGP: 0x1F81112D62A9ADCE / 3586 3350 BFEA C101 DB1A  4AF0 1F81 112D 62A9 ADCE

On Mon, Aug 10, 2020, at 5:01 PM, Edd Barrett wrote:
> Hi all,
> 
> Just got a email from a user saying that syncthing is broken on the
> latest snapshot. Just checked and I can reproduce it:
> 
> ```
> $ syncthing
> panic: qtls.ClientSessionState not compatible with tls.ClientSessionState
> 
> goroutine 1 [running]:
> github.com/syncthing/syncthing/vendor/github.com/lucas-clemente/quic-go/internal/handshake.init.1()
> 
> /usr/obj/ports/syncthing-1.5.0/go/src/github.com/syncthing/syncthing/vendor/github.com/lucas-clemente/quic-go/internal/handshake/unsafe.go:20
>  +0x112
> ```
> 
> Note that I could only reproduce this when removing and reinstalling the
> package. There hasn't been an update to syncthing recently, so something
> else must have busted it.
> 
> I'm out of time tonight, but any ideas? Clang 10? Surely not.
> 
> CC abieber@ -- local golang guru.
> 
> -- 
> Best Regards
> Edd Barrett
> 
> http://www.theunixzoo.co.uk
>