Bug 192964 - [New Port] devel/go-hashicorp-logutils
Summary: [New Port] devel/go-hashicorp-logutils
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Carlo Strub
URL:
Keywords:
Depends on:
Blocks: 192937
  Show dependency treegraph
 
Reported: 2014-08-24 11:27 UTC by Thomas Bartelmess
Modified: 2014-09-05 21:17 UTC (History)
3 users (show)

See Also:


Attachments
poudriere build log (9.76 KB, text/plain)
2014-08-24 11:27 UTC, Thomas Bartelmess
no flags Details
portlint output (12 bytes, text/plain)
2014-08-24 11:27 UTC, Thomas Bartelmess
no flags Details
Shar archive (2.52 KB, text/plain)
2014-08-24 11:28 UTC, Thomas Bartelmess
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Bartelmess 2014-08-24 11:27:26 UTC
Created attachment 146207 [details]
poudriere build log

I am not sure if go-hachicorp-logutils is the best name for the port. The library that is called 'github.com/hashicorp/logutils', which is the convention in go.

However go-github.com-hashicorp-logutils seems to long for a port name.
Comment 1 Thomas Bartelmess 2014-08-24 11:27:54 UTC
Created attachment 146208 [details]
portlint output
Comment 2 Thomas Bartelmess 2014-08-24 11:28:23 UTC
Created attachment 146209 [details]
Shar archive
Comment 3 John Marino freebsd_committer freebsd_triage 2014-08-24 16:25:55 UTC
1) you can just past portlint output in comment, we don't need attachment for that

2) when you attach a shar, set mime = text/plain

3) You tabbed too much, everything except PORTVERSION

4) you did this again:

X.include <bsd.port.pre.mk>
X.include "${PORTSDIR}/lang/go/files/bsd.go.mk"
X.include <bsd.port.post.mk>

5) see this?

X@dirrmtry %%GO_SRCDIR%%/%%GO_PKGNAME%%
X@dirrmtry %%GO_SRCDIR%%/github.com/hashicorp
X@dirrmtry %%GO_SRCDIR%%/github.com
X@dirrmtry %%GO_SRCDIR%%
X@dirrmtry %%GO_LIBDIR%%/github.com/hashicorp
X@dirrmtry %%GO_LIBDIR%%/github.com
X@dirrmtry %%GO_LIBDIR%%
X@dirrmtry share/go/pkg
X@dirrmtry share/go

I think only the first one is needed; the rest probably belong to go.  And the first one should be @dirrm, not @dirrmtry.  Never use @dirrmtry if @dirrm is guaranteed to work.

Please update the shar.
Comment 4 Thomas Bartelmess 2014-08-24 17:02:27 UTC
For me it seems like 
bsd.port.pre.mk has to be included before bsd.go.mk
If it's not included, I am getting an error, because the $ARCH variable is not set

   WARNING (devel/go-hashicorp-logutils): make: "/usr/ports/devel/go-hashicorp-logutils/../../lang/go/files/bsd.go.mk" line 20: Malformed conditional (${ARCH} == "i386")
   WARNING (devel/go-hashicorp-logutils): make: Fatal errors encountered -- cannot continue


Is there a reason why 

.include "${.CURDIR}/../../lang/go/files/bsd.go.mk"

if preferred over
.include "${PORTSDIR}/lang/go/files/bsd.go.mk"

or is that just convention?

I was the go-sql-driver (https://svnweb.freebsd.org/ports/head/devel/go-sql-driver/) which is also a go library.

(In reply to John Marino from comment #3)
> 1) you can just past portlint output in comment, we don't need attachment
> for that
> 
> 2) when you attach a shar, set mime = text/plain
> 
> 3) You tabbed too much, everything except PORTVERSION
> 
> 4) you did this again:
> 
> X.include <bsd.port.pre.mk>
> X.include "${PORTSDIR}/lang/go/files/bsd.go.mk"
> X.include <bsd.port.post.mk>
> 
> 5) see this?
> 
> X@dirrmtry %%GO_SRCDIR%%/%%GO_PKGNAME%%
> X@dirrmtry %%GO_SRCDIR%%/github.com/hashicorp
> X@dirrmtry %%GO_SRCDIR%%/github.com
> X@dirrmtry %%GO_SRCDIR%%
> X@dirrmtry %%GO_LIBDIR%%/github.com/hashicorp
> X@dirrmtry %%GO_LIBDIR%%/github.com
> X@dirrmtry %%GO_LIBDIR%%
> X@dirrmtry share/go/pkg
> X@dirrmtry share/go
> 
> I think only the first one is needed; the rest probably belong to go.  And
> the first one should be @dirrm, not @dirrmtry.  Never use @dirrmtry if
> @dirrm is guaranteed to work.
> 
> Please update the shar.
Comment 5 John Marino freebsd_committer freebsd_triage 2014-08-24 17:56:36 UTC
(In reply to Thomas Bartelmess from comment #4)
> For me it seems like 
> bsd.port.pre.mk has to be included before bsd.go.mk
> If it's not included, I am getting an error, because the $ARCH variable is
> not set
> 
>    WARNING (devel/go-hashicorp-logutils): make:
> "/usr/ports/devel/go-hashicorp-logutils/../../lang/go/files/bsd.go.mk" line
> 20: Malformed conditional (${ARCH} == "i386")
>    WARNING (devel/go-hashicorp-logutils): make: Fatal errors encountered --
> cannot continue


crap, bsd.go.mk is what needs it.


> 
> 
> Is there a reason why 
> 
> .include "${.CURDIR}/../../lang/go/files/bsd.go.mk"
> 
> if preferred over
> .include "${PORTSDIR}/lang/go/files/bsd.go.mk"


One good reason is that it eliminates the need for <pre> and <post> normally.  A second reason is that the absolute path fails in some use cases, relative paths never fail.

Still make this relative patch, but leave <pre>/<post> with a "#" comment saying that bsd.go.mk has $ARCH requiring <pre> inclusion first.
Comment 6 John Marino freebsd_committer freebsd_triage 2014-08-24 17:57:03 UTC
s/relative patch/relative path/
Comment 7 Thomas Bartelmess 2014-08-24 18:46:17 UTC
I think the
@dirrmtry %%GO_SRCDIR%%/%%GO_PKGNAME%%
@dirrmtry %%GO_SRCDIR%%/github.com/hashicorp
@dirrmtry %%GO_SRCDIR%%/github.com
@dirrmtry %%GO_SRCDIR%%
@dirrmtry %%GO_LIBDIR%%/github.com/hashicorp
@dirrmtry %%GO_LIBDIR%%/github.com
@dirrmtry %%GO_LIBDIR%%
@dirrmtry share/go/pkg
@dirrmtry share/go

is still required since go installs the sources of the package there.


(In reply to John Marino from comment #5)
> (In reply to Thomas Bartelmess from comment #4)
> > For me it seems like 
> > bsd.port.pre.mk has to be included before bsd.go.mk
> > If it's not included, I am getting an error, because the $ARCH variable is
> > not set
> > 
> >    WARNING (devel/go-hashicorp-logutils): make:
> > "/usr/ports/devel/go-hashicorp-logutils/../../lang/go/files/bsd.go.mk" line
> > 20: Malformed conditional (${ARCH} == "i386")
> >    WARNING (devel/go-hashicorp-logutils): make: Fatal errors encountered --
> > cannot continue
> 
> 
> crap, bsd.go.mk is what needs it.
> 
> 
> > 
> > 
> > Is there a reason why 
> > 
> > .include "${.CURDIR}/../../lang/go/files/bsd.go.mk"
> > 
> > if preferred over
> > .include "${PORTSDIR}/lang/go/files/bsd.go.mk"
> 
> 
> One good reason is that it eliminates the need for <pre> and <post>
> normally.  A second reason is that the absolute path fails in some use
> cases, relative paths never fail.
> 
> Still make this relative patch, but leave <pre>/<post> with a "#" comment
> saying that bsd.go.mk has $ARCH requiring <pre> inclusion first.

(In reply to John Marino from comment #3)
> 1) you can just past portlint output in comment, we don't need attachment
> for that
> 
> 2) when you attach a shar, set mime = text/plain
> 
> 3) You tabbed too much, everything except PORTVERSION
> 
> 4) you did this again:
> 
> X.include <bsd.port.pre.mk>
> X.include "${PORTSDIR}/lang/go/files/bsd.go.mk"
> X.include <bsd.port.post.mk>
> 
> 5) see this?
> 
> X@dirrmtry %%GO_SRCDIR%%/%%GO_PKGNAME%%
> X@dirrmtry %%GO_SRCDIR%%/github.com/hashicorp
> X@dirrmtry %%GO_SRCDIR%%/github.com
> X@dirrmtry %%GO_SRCDIR%%
> X@dirrmtry %%GO_LIBDIR%%/github.com/hashicorp
> X@dirrmtry %%GO_LIBDIR%%/github.com
> X@dirrmtry %%GO_LIBDIR%%
> X@dirrmtry share/go/pkg
> X@dirrmtry share/go
> 
> I think only the first one is needed; the rest probably belong to go.  And
> the first one should be @dirrm, not @dirrmtry.  Never use @dirrmtry if
> @dirrm is guaranteed to work.
> 
> Please update the shar.
Comment 8 John Marino freebsd_committer freebsd_triage 2014-08-25 06:54:54 UTC
(In reply to Thomas Bartelmess from comment #7)
> I think the
> @dirrmtry %%GO_SRCDIR%%/%%GO_PKGNAME%%
> @dirrmtry %%GO_SRCDIR%%/github.com/hashicorp
> @dirrmtry %%GO_SRCDIR%%/github.com
> @dirrmtry %%GO_SRCDIR%%
> @dirrmtry %%GO_LIBDIR%%/github.com/hashicorp
> @dirrmtry %%GO_LIBDIR%%/github.com
> @dirrmtry %%GO_LIBDIR%%
> @dirrmtry share/go/pkg
> @dirrmtry share/go
> 
> is still required since go installs the sources of the package there.


I have a very difficult time believing "share/go" didn't exist before this package gets installed.

/me checks

wow, it didn't.  That's terrible.  Every single go program that installs a library has to include these lines?  Aren't
%%GO_SRCDIR%%
%%GO_LIBDIR%%
share/go/pkg
share/go 

common?

I'll add the maintainer of GO in CC.  If this isn't unique to this port, then I'd suggest that GO start installing these directories so it owns them.

Obviously the key is whether or not these directories are common or unique.
Comment 9 Thomas Bartelmess 2014-08-26 15:35:24 UTC
I just checked, lang/go does not create the share folder.

All go packages devel/go-flags, devel/go-json-rest, devel/go-pretty, devel/go-sql-driver, devel/go-runewidth, devel/go-termbox have @dirrmtry share/go in the pkg-plist 

(In reply to John Marino from comment #8)
> (In reply to Thomas Bartelmess from comment #7)
> > I think the
> > @dirrmtry %%GO_SRCDIR%%/%%GO_PKGNAME%%
> > @dirrmtry %%GO_SRCDIR%%/github.com/hashicorp
> > @dirrmtry %%GO_SRCDIR%%/github.com
> > @dirrmtry %%GO_SRCDIR%%
> > @dirrmtry %%GO_LIBDIR%%/github.com/hashicorp
> > @dirrmtry %%GO_LIBDIR%%/github.com
> > @dirrmtry %%GO_LIBDIR%%
> > @dirrmtry share/go/pkg
> > @dirrmtry share/go
> > 
> > is still required since go installs the sources of the package there.
> 
> 
> I have a very difficult time believing "share/go" didn't exist before this
> package gets installed.
> 
> /me checks
> 
> wow, it didn't.  That's terrible.  Every single go program that installs a
> library has to include these lines?  Aren't
> %%GO_SRCDIR%%
> %%GO_LIBDIR%%
> share/go/pkg
> share/go 
> 
> common?
> 
> I'll add the maintainer of GO in CC.  If this isn't unique to this port,
> then I'd suggest that GO start installing these directories so it owns them.
> 
> Obviously the key is whether or not these directories are common or unique.
Comment 10 John Marino freebsd_committer freebsd_triage 2014-08-26 15:38:17 UTC
(In reply to Thomas Bartelmess from comment #9)
> I just checked, lang/go does not create the share folder.
> 
> All go packages devel/go-flags, devel/go-json-rest, devel/go-pretty,
> devel/go-sql-driver, devel/go-runewidth, devel/go-termbox have @dirrmtry
> share/go in the pkg-plist 
> 

the question is if this is smart.
if share/go is a standard directory, then probably go should be installing it and all those packages should be cleaned up before even more go packages are added.
Comment 11 John Marino freebsd_committer freebsd_triage 2014-08-26 19:15:23 UTC
Okay, it's not this port's fault about lang/go.
At this moment in time, the shar is correct.

If lang/go gets a standard share/go directory (as I think it should) then all the affected ports will need to be fixed then, including this one.

Moving to patch-ready status; neither of my criticisms were valid at the end.
Comment 12 commit-hook freebsd_committer freebsd_triage 2014-09-05 21:15:52 UTC
A commit references this bug:

Author: cs
Date: Fri Sep  5 21:15:27 UTC 2014
New revision: 367391
URL: http://svnweb.freebsd.org/changeset/ports/367391

Log:
  logutils is a Go package that augments the standard library "log"
  package to make logging a bit more modern, without fragmenting
  the Go ecosystem with new logging packages.

  PR:		ports/192964
  Submitted by:	Thomas Bartelmess <thomas@bartelmess.io>

Changes:
  head/devel/Makefile
  head/devel/go-hashicorp-logutils/
  head/devel/go-hashicorp-logutils/Makefile
  head/devel/go-hashicorp-logutils/distinfo
  head/devel/go-hashicorp-logutils/pkg-descr
  head/devel/go-hashicorp-logutils/pkg-plist
Comment 13 Carlo Strub freebsd_committer freebsd_triage 2014-09-05 21:17:28 UTC
Committed. Thank you very much.
Comment 14 commit-hook freebsd_committer freebsd_triage 2014-09-05 21:17:53 UTC
A commit references this bug:

Author: cs
Date: Fri Sep  5 21:16:58 UTC 2014
New revision: 45550
URL: http://svnweb.freebsd.org/changeset/doc/45550

Log:
  Add new contributor

  PR:		192964

Changes:
  head/en_US.ISO8859-1/articles/contributors/contrib.additional.xml