Hi ports@,

$ cat gocover/pkg/DESCR                                                  
Cover is a program for analyzing the coverage profiles
generated by 'go test -coverprofile=cover.out'.

Cover is also used by 'go test -cover' to rewrite
the source code with annotations to track which parts
of each function are executed.
$ 

Most notably the tool is also required by goconvey
(http://goconvey.co/).

The reason for providing a port is the way the go tools are
packaged by upstream which assumes that they will land
in the $GOTOOLDIR which is outside the users folder (on my box
it defaults to: /usr/local/go/pkg/tool/openbsd_386/).

for details please see a previous thread:
http://marc.info/?t=142686792400002&r=1&w=2

Testing:

This port has been tested on a i386 snapshot of (Mar 19) OpenBSD 5.7
using go 1.4.1.

$ go version
go version go1.4.1 openbsd/386

Note that working with go requires raised limits or an altered
login.conf.
If your account is in staff you can change a terminal temporarily with:

ulimit -n 512
ulimit -p 512
ulimit -d 2036792

if 'go version' results in:
$ go version
runtime: panic before malloc heap initialized
fatal error: runtime: cannot reserve arena virtual address space

runtime stack:
runtime.throw(0x854ce92)
        /usr/local/go/src/runtime/panic.go:491 +0x83 fp=0xcfbc508c
        sp=0xcfbc5074
runtime.mallocinit()
        /usr/local/go/src/runtime/malloc.c:223 +0xe9 fp=0xcfbc50c8
        sp=0xcfbc508c
runtime.schedinit()
        /usr/local/go/src/runtime/proc.c:137 +0x34 fp=0xcfbc50e0
        sp=0xcfbc50c8
runtime.rt0_go(0xcfbc5174, 0xfff, 0x85470a0, 0x0, 0x0, 0x0, 0x4c9d5d2b,
0xcfbc512c, 0xcfbc5170, 0xcfbc512c, ...)
        /usr/local/go/src/runtime/asm_386.s:100 +0xed fp=0xcfbc50e4
        sp=0xcfbc50e0
$ 

Then you're limits are too low.


Most desired tests are:
 - different architectures (not i386)
 - checking if I didn't miss anything
 - testing on a fresh system by installing go convey and running it with
 -cover=true

What I am not sure about:
 - Duplicated code from lang/go (do-configure ; see below)
 - Correctness of do-install step
 - Port category (though I saw a lot of code coverage tools in devel
 group)
 - The way I fetch the common gotools distfile
 - The last point in the 'desired tests'. I had a global 'root' install
 of the cover tool
   without a port so I don't know if it installed anything else except
   the cover binary
   installing goconvey and running it with -cover=true on a fresh system
   would quickly
   reveal any stuff that I might have missed

The biggest part to take away from this port is how the go upstream
packages 'tools'.
They want  to install them in GOTOOLDIR where most users don't have
permission for
writing (/usr/local/go/pkg/openbsd_$arch) they are also packaged in the
same repository
with a single common download.

Most notable of those tools might be:
 - cover for code coverage (this port)
 - godoc for documentation (textproc/godoc in ports@ mailing list)
 - oracle for code analysis (no port)
possibly more interesting ones now & in the future.

I already asked Stuart for a common download mirror with godoc (Thanks!)
but I had to copy
parts of lang/go to get the proper target directory for the go tools. My
question to more experienced
port maintainers is: 'Does the OpenBSD ports tree have a mechanism for
common port components
so other ports for go tools won't have to copy this again?'

Additionally should it be treated differently? A single meta-port with
flavours? Common namespace
for all future tools?

Regards,
-- 
  Adam Wolk
  adam.w...@koparo.com

Attachment: gocover.tar.gz
Description: application/gzip

Reply via email to