Bug 249946

Summary: net/nncp: Update to 6.1.0
Product: Ports & Packages Reporter: Sergey Matveev <stargrave>
Component: Individual Port(s)Assignee: Fernando Apesteguía <fernape>
Status: Closed FIXED    
Severity: Affects Only Me CC: dmgk, fernape, stargrave
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
URL: http://www.nncpgo.org/Release-6_002e1_002e0.html
Attachments:
Description Flags
Update patch from 5.3.3 to 5.4.0
none
Update patch from 5.3.3 to 5.4.1
stargrave: maintainer-approval+
Update patch from 5.3.3 to 5.5.0
stargrave: maintainer-approval+
diff to unbreak with go1.16
none
patch with fix for INFO files
none
Update to 5.5.1 and unbreak with go1.16
stargrave: maintainer-approval+
Update to 5.6.0 und unbreak with go1.16
stargrave: maintainer-approval+
Update to 6.1.0 und unbreak with go1.16
stargrave: maintainer-approval+
Update to 6.1.0
stargrave: maintainer-approval+
Update to 6.1.0 with explicit USES=go:modules stargrave: maintainer-approval+

Description Sergey Matveev 2020-09-27 18:08:30 UTC
Created attachment 218366 [details]
Update patch from 5.3.3 to 5.4.0

Update NNCP to 5.4.0.
Comment 1 Sergey Matveev 2020-09-27 21:17:37 UTC
Created attachment 218370 [details]
Update patch from 5.3.3 to 5.4.1
Comment 2 Fernando Apesteguía freebsd_committer freebsd_triage 2020-09-30 06:16:44 UTC
^Triage: If there is a changelog or release notes URL available for this version, please add it to the URL field.

^Triage: Please set the maintainer-approval attachment flag (to +) on patches for ports you maintain to signify approval.
--
Attachment -> Details -> maintainer-approval [+]


Thanks!
Comment 3 Sergey Matveev 2020-09-30 18:53:48 UTC
(In reply to Fernando Apesteguía from comment #2)

Added an approval and URL to 5.4.1 release. As I can see, only one URL can be added. But 5.4.0 release just updates dependencies and uses redo build system (however compatibility Makefiles are included, tested on my local machine).
Comment 4 Sergey Matveev 2021-01-07 20:53:52 UTC
Created attachment 221368 [details]
Update patch from 5.3.3 to 5.5.0
Comment 5 Dmitri Goutnik freebsd_committer freebsd_triage 2021-01-08 15:55:19 UTC
Created attachment 221390 [details]
diff to unbreak with go1.16

While here, could you please amend the patch to include the attached fix? This unbreaks port build with go1.16. Thanks!
Comment 6 Fernando Apesteguía freebsd_committer freebsd_triage 2021-01-08 16:13:14 UTC
(In reply to Dmitri Goutnik from comment #5)
Sure. It is still queued to be build tested :-)
Comment 7 Fernando Apesteguía freebsd_committer freebsd_triage 2021-01-09 19:00:27 UTC
(In reply to Fernando Apesteguía from comment #6)

===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: info/nncp.info
===> Checking for items in pkg-plist which are not in STAGEDIR
===> Error: Plist issues found.

Does this file need to be included?
Comment 8 Sergey Matveev 2021-01-09 21:28:17 UTC
(In reply to Fernando Apesteguía from comment #7)
Should be installed, it is the only documentation available. Previously INFO= in the Makefile was enough, strange.
Comment 9 Fernando Apesteguía freebsd_committer freebsd_triage 2021-01-11 08:15:23 UTC
(In reply to Dmitri Goutnik from comment #5)
Hi Dmitri,

Even with that patch, I get this on CURRENT:

===>  Building for nncp-5.5.0
--- warning ---
WARNING: this is not real Makefile. Just proxying commands to redo command
--- all ---
contrib/do -c all
do  all
do    bin/all
do      bin/nncp-bundle
do        gopath
do      bin/nncp-call
do      bin/nncp-caller
# go.cypherpunks.ru/nncp/v5/cmd/nncp-caller
unexpected fault address 0x520b42
fatal error: fault
[signal SIGBUS: bus error code=0x3 addr=0x520b42 pc=0x520b42]

goroutine 1 [running]:
runtime.throw(0x6cd22b, 0x5)
        /usr/local/go/src/runtime/panic.go:1116 +0x72 fp=0xc0000d0b30 sp=0xc0000d0b00 pc=0x435912
runtime.sigpanic()
        /usr/local/go/src/runtime/signal_unix.go:739 +0x465 fp=0xc0000d0b60 sp=0xc0000d0b30 pc=0x44c025
cmd/link/internal/loader.(*Loader).migrateAttributes(0xc0006c0000, 0xbfbd, 0x14245c8910244489)
        /usr/local/go/src/cmd/link/internal/loader/loader.go:2655 +0x62 fp=0xc0000d0bf0 sp=0xc0000d0b60 pc=0x520b42
cmd/link/internal/loader.loadObjFull(0xc0006c0000, 0xc000053020, 0xc0029b0000)
        /usr/local/go/src/cmd/link/internal/loader/loader.go:2750 +0x127 fp=0xc0000d0ca0 sp=0xc0000d0bf0 pc=0x521a47
cmd/link/internal/loader.(*Loader).LoadFull(0xc0006c0000, 0x86c760, 0xc0000ae100, 0x0)
        /usr/local/go/src/cmd/link/internal/loader/loader.go:2156 +0xf77 fp=0xc0000d0db8 sp=0xc0000d0ca0 pc=0x51e8d7
cmd/link/internal/ld.(*Link).loadlibfull(0xc0000a7880, 0xc001054000, 0x19352, 0x19352, 0x530000)
        /usr/local/go/src/cmd/link/internal/ld/lib.go:2835 +0x73 fp=0xc0000d0eb8 sp=0xc0000d0db8 pc=0x5d29f3
cmd/link/internal/ld.Main(0x86c760, 0x20, 0x20, 0x1, 0x7, 0x10, 0x0, 0x0, 0x6d87b2, 0x1b, ...)
        /usr/local/go/src/cmd/link/internal/ld/main.go:341 +0x18cc fp=0xc0000d1118 sp=0xc0000d0eb8 pc=0x5e0b0c
main.main()
        /usr/local/go/src/cmd/link/main.go:68 +0x1dc fp=0xc0000d1f88 sp=0xc0000d1118 pc=0x65bd3c
runtime.main()
        /usr/local/go/src/runtime/proc.go:204 +0x209 fp=0xc0000d1fe0 sp=0xc0000d1f88 pc=0x438109
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1374 +0x1 fp=0xc0000d1fe8 sp=0xc0000d1fe0 pc=0x469b21
do:     nncp-caller: got exit code 2
do:   all: got exit code 1
do: all: got exit code 1
*** [all] Error code 1

make[1]: stopped in /wrkdirs/usr/ports/net/nncp/work/nncp-5.5.0
1 error

make[1]: stopped in /wrkdirs/usr/ports/net/nncp/work/nncp-5.5.0
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1
Comment 10 Fernando Apesteguía freebsd_committer freebsd_triage 2021-01-11 08:16:49 UTC
Created attachment 221449 [details]
patch with fix for INFO files

Upstream Makefile does not seem to honor INFODIR. Add a patch to fix it.
Comment 11 Dmitri Goutnik freebsd_committer freebsd_triage 2021-01-11 11:39:57 UTC
(In reply to Fernando Apesteguía from comment #9)
This seems like an unrelated issue with Go linker. Is this with lang/go or lang/go-devel? What version of -CURRENT?
Comment 12 Sergey Matveev 2021-01-11 12:33:52 UTC
(In reply to Fernando Apesteguía from comment #10)
INFODIR honoring was broken when there was move from Makefiles to redo. I fixed it in next minor release: http://www.git.cypherpunks.ru/?p=nncp.git;a=commitdiff;h=2ed9d422314edb2d32f9e23ac39fc5d180d8b1f8

I will attach the patch with updated 5.5.1 checksums and Dmitri's patch to unbreak with go1.16.
Comment 13 Sergey Matveev 2021-01-11 12:34:39 UTC
Created attachment 221456 [details]
Update to 5.5.1 and unbreak with go1.16
Comment 14 Sergey Matveev 2021-01-11 12:47:15 UTC
(In reply to Fernando Apesteguía from comment #9)
That is something strange in the Go's runtime/linker itself. On my machine it works with Go 1.12 till 1.15.6 versions.
Comment 15 Fernando Apesteguía freebsd_committer freebsd_triage 2021-01-11 13:05:34 UTC
(In reply to Sergey Matveev from comment #14)

It is in poudriere, but my current might be a bit old (Jail OSVERSION: 1300117). I will update it and try again.

It was using go-1.15.6

===>   nncp-5.5.0 depends on file: /usr/local/bin/go - not found
===>   Installing existing package /packages/All/go-1.15.6,1.txz
[13-current-default] Installing go-1.15.6,1...
[13-current-default] Extracting go-1.15.6,1: .......... done
===>   nncp-5.5.0 depends on file: /usr/local/bin/go - found
Comment 16 Dmitri Goutnik freebsd_committer freebsd_triage 2021-01-11 19:41:02 UTC
(In reply to Fernando Apesteguía from comment #9)
Builds fine for me on a recent 13.0-CURRENT snapshot:

# uname -a
FreeBSD freebsd13 13.0-CURRENT FreeBSD 13.0-CURRENT #0 main-c255641-gf2b794e1e90: Thu Jan  7 06:25:26 UTC 2021     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64

# uname -KU
1300133 1300133

# go version
go version go1.15.6 freebsd/amd64
Comment 17 Fernando Apesteguía freebsd_committer freebsd_triage 2021-01-12 14:12:39 UTC
(In reply to Dmitri Goutnik from comment #16)
Updated the jail to 1300134. And failed again. But now I got him!

I always use poudriere to build ports. Well, this one works:

sudo poudriere testport -j13-current -p default -o net/nncp

and this one _always_ fails:

sudo poudriere testport -i -j13-current -p default -o net/nncp

The reason to execute with -i is that it is super easy for me to test ports like this from the jail.

So, on my part the patch is OK. If there is no objection, I would like to defer the commit. I would like to ask to other committers about this.
Comment 18 Fernando Apesteguía freebsd_committer freebsd_triage 2021-01-14 08:43:05 UTC
I think what happens is very similar to what is described in this issue:

https://github.com/golang/go/issues/42772
Comment 19 Sergey Matveev 2021-01-18 08:02:17 UTC
Created attachment 221695 [details]
Update to 5.6.0 und unbreak with go1.16

Yet another NNCP update. But of course it won't help with linker bugs on FreeBSD.
Comment 20 commit-hook freebsd_committer freebsd_triage 2021-02-21 19:58:32 UTC
A commit references this bug:

Author: dmgk
Date: Sun Feb 21 19:58:27 UTC 2021
New revision: 566241
URL: https://svnweb.freebsd.org/changeset/ports/566241

Log:
  net/nncp: Unbreak with go1.16

  ===>  Building for nncp-5.3.3
  ...
  no required module provides package go.cypherpunks.ru/nncp/v5/cmd/nncp-cfgenc: working directory is not part of a module

  PR:		249946
  Approved by:	Sergey Matveev <stargrave@stargrave.org> (maintainer)

Changes:
  head/net/nncp/Makefile
Comment 21 Sergey Matveev 2021-02-24 09:38:52 UTC
Created attachment 222784 [details]
Update to 6.1.0 und unbreak with go1.16
Comment 22 Fernando Apesteguía freebsd_committer freebsd_triage 2021-02-24 14:53:40 UTC
(In reply to Sergey Matveev from comment #21)

distinfo is not properly updated:

===>  License GPLv3 accepted by the user
===>   nncp-6.1.0 depends on file: /usr/local/sbin/pkg - found
=> nncp-6.1.0.tar.xz is not in /usr/ports/net/nncp/distinfo.
=> Either /usr/ports/net/nncp/distinfo is out of date, or
=> nncp-6.1.0.tar.xz is spelled incorrectly.
*** Error code 1

Even after make makesum, I get a build error:

===>  Building for nncp-6.1.0
--- warning ---
WARNING: this is not real Makefile. Just proxying commands to redo command
--- all ---
contrib/do -c all
do  all
do    bin/all
do      bin/nncp-bundle
build flag -mod=vendor only valid when using modules
do:     nncp-bundle: got exit code 1
do:   all: got exit code 1
do: all: got exit code 1
*** [all] Error code 1
Comment 23 Sergey Matveev 2021-02-24 16:48:15 UTC
Created attachment 222793 [details]
Update to 6.1.0
Comment 24 Sergey Matveev 2021-02-24 16:51:27 UTC
(In reply to Fernando Apesteguía from comment #22)
My fault: forget to make makesum. But I am unable to reproduce "-mod=vendor" error, however I use 12.0 with manually built Go 1.15 and Go 1.16 with manual command execution. I still do not know what MAKE_ENV=$GO_ENV means, but probably it contains some environment variables turning go modules support off, and that is why -mod=vendor does not work properly. Current latest NNCP do not use GOPATH and uses go modules vendoring, so it should be buildable completely without any hacks like GOPATH.
Comment 25 Dmitri Goutnik freebsd_committer freebsd_triage 2021-02-24 17:13:32 UTC
(In reply to Sergey Matveev from comment #24)

~/ports/head/net/nncp/work/nncp-6.1.0 $ grep -nR mod=vendor *
bin/default.do:5:mod=`$GO list -mod=vendor -m`
bin/default.do:10:$GO build -mod=vendor -o ../bin/$3 -ldflags "$GO_LDFLAGS" ./cmd/$1
test.do:6:$GO test -mod=vendor -failfast ./...

Because this port doesn't use Go modules (it doesn't have go.mod and port Makefile accordingly forcefully disable module-aware mode), but bin/default.do:10 adds -mod=vendor flag (which is only valid in module-aware mode), the build fails.

Either "-mod=vendor" flags need to be removed or the source needs to be converted to use Go modules and modules mode needs to be turned off for the port with "USES=go:modules,no_targets"
Comment 26 Dmitri Goutnik freebsd_committer freebsd_triage 2021-02-24 17:14:54 UTC
Sorry, s/turned off/turned on/
Comment 27 Sergey Matveev 2021-02-24 17:36:21 UTC
(In reply to Dmitri Goutnik from comment #25)
But the code is fully module-aware: src/go.{mod,sum} exists and bin/default.do changes directory to src/ where it executes go-commands.
Comment 28 Dmitri Goutnik freebsd_committer freebsd_triage 2021-02-24 17:37:50 UTC
(In reply to Sergey Matveev from comment #27)
Oh ok, I actually didn't check :)
In this case, changing USES to "USES=go:modules,no_targets" should fix it.
Comment 29 Sergey Matveev 2021-02-24 17:43:14 UTC
Created attachment 222795 [details]
Update to 6.1.0 with explicit USES=go:modules
Comment 30 commit-hook freebsd_committer freebsd_triage 2021-02-25 15:06:59 UTC
A commit references this bug:

Author: fernape
Date: Thu Feb 25 15:06:41 UTC 2021
New revision: 566540
URL: https://svnweb.freebsd.org/changeset/ports/566540

Log:
  net/nncp: Update to 6.1.0

  ChangeLog: http://www.nncpgo.org/Release-6_002e1_002e0.html

  PR:	249946
  Submitted by:	stargrave@stargrave.org (maintainer)

Changes:
  head/net/nncp/Makefile
  head/net/nncp/distinfo
  head/net/nncp/files/nncp.newsyslog.conf.sample
  head/net/nncp/files/pkg-message.in
  head/net/nncp/pkg-plist
Comment 31 Fernando Apesteguía freebsd_committer freebsd_triage 2021-02-25 15:07:33 UTC
Committed,

Thanks!