public inbox for nncp-devel@lists.cypherpunks.ru
Atom feed
* [nncp-devel] Problems getting NNCP 4.0 to compile
@ 2019-04-30 18:54 Shawn K. Quinn
  2019-05-01 20:22 ` Sergey Matveev
  0 siblings, 1 reply; 2+ messages in thread
From: Shawn K. Quinn @ 2019-04-30 18:54 UTC (permalink / raw)
  To: nncp-devel

First, it should be noted that NNCP 4.0 appears to require at least Go
1.11 or later. The 1.10 that comes with Ubuntu 18.04 LTS won't cut it
anymore.

Even after upgrading to Go 1.12, I wind up getting this when trying to
build:

skquinn@moonpatrol:~/usr/src/nncp-4.0$ make
cd /home/skquinn/usr/src/nncp-4.0/src/cypherpunks.ru/nncp ;
GOPATH=/home/skquinn/usr/src/nncp-4.0/gopath go build -mod=vendor
-ldflags "-X cypherpunks.ru/nncp.Version=4.0 -X
cypherpunks.ru/nncp.DefaultCfgPath=/usr/local/etc/nncp.yaml -X
cypherpunks.ru/nncp.DefaultSendmailPath=/usr/sbin/sendmail -X
cypherpunks.ru/nncp.DefaultSpoolPath=/var/spool/nncp -X
cypherpunks.ru/nncp.DefaultLogPath=/var/spool/nncp/log"
cypherpunks.ru/nncp/cmd/nncp-bundle
build flag -mod=vendor only valid when using modules
common.mk:51: recipe for target 'nncp-bundle' failed
make: *** [nncp-bundle] Error 1

Changing common.mk not to include -mod=vendor fares no better:

skquinn@moonpatrol:~/usr/src/nncp-4.0$ make
cd /home/skquinn/usr/src/nncp-4.0/src/cypherpunks.ru/nncp ;
GOPATH=/home/skquinn/usr/src/nncp-4.0/gopath go build  -ldflags "-X
cypherpunks.ru/nncp.Version=4.0 -X
cypherpunks.ru/nncp.DefaultCfgPath=/usr/local/etc/nncp.yaml -X
cypherpunks.ru/nncp.DefaultSendmailPath=/usr/sbin/sendmail -X
cypherpunks.ru/nncp.DefaultSpoolPath=/var/spool/nncp -X
cypherpunks.ru/nncp.DefaultLogPath=/var/spool/nncp/log"
cypherpunks.ru/nncp/cmd/nncp-bundle
# cypherpunks.ru/nncp
../../../gopath/src/cypherpunks.ru/nncp/ctx.go:115:17: invalid
operation: s.Bavail * int64(s.Bsize) (mismatched types uint64 and int64)
common.mk:51: recipe for target 'nncp-bundle' failed
make: *** [nncp-bundle] Error 2

What could I be missing?

-- 
Shawn K. Quinn <skquinn@rushpost•com>
http://www.rantroulette.com
http://www.skqrecordquest.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [nncp-devel] Problems getting NNCP 4.0 to compile
  2019-04-30 18:54 [nncp-devel] Problems getting NNCP 4.0 to compile Shawn K. Quinn
@ 2019-05-01 20:22 ` Sergey Matveev
  0 siblings, 0 replies; 2+ messages in thread
From: Sergey Matveev @ 2019-05-01 20:22 UTC (permalink / raw)
  To: nncp-devel

[-- Attachment #1: Type: text/plain, Size: 1329 bytes --]

Greetings!

*** Shawn K. Quinn [2019-04-30 22:14]:
>First, it should be noted that NNCP 4.0 appears to require at least Go
>1.11 or later. The 1.10 that comes with Ubuntu 18.04 LTS won't cut it
>anymore.

I build it up with Go 1.10 and GOPATH=$(PWD) BUILDMOD= flags and the
following fix: https://git.cypherpunks.ru/cgit.cgi/nncp.git/commit/?id=191a6f4e446c9c4b7c26fd746300bb775462c9bd
However I did not extensively test its workability.

>../../../gopath/src/cypherpunks.ru/nncp/ctx.go:115:17: invalid
>operation: s.Bavail * int64(s.Bsize) (mismatched types uint64 and int64)

I really tested that version on FreeBSD and forget that golang.org/x/sys
results can differ between various systems:

    [...]
    unix/ztypes_linux_amd64.go:1395:        Bavail  uint64
    unix/ztypes_freebsd_amd64.go:114:       Bavail   int64
    [...]

and that Bavail's differs between GNU/Linux and FreeBSD. I forcefully
convert it to int64 and that should fix the problem.

Also I added determining if Go supports modules and choosing of the
right GOPATH/BUILDMOD options when building. That should work on both
Go 1.10 and 1.12 systems.

Thank you very much for your feedback!!! I very appreciate it!

-- 
Sergey Matveev (http://www.stargrave.org/)
OpenPGP: CF60 E89A 5923 1E76 E263  6422 AE1A 8109 E498 57EF

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-01 20:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-30 18:54 [nncp-devel] Problems getting NNCP 4.0 to compile Shawn K. Quinn
2019-05-01 20:22 ` Sergey Matveev