Gentoo Archives: gentoo-dev

From: William Hubbs <williamh@g.o>
To: gentoo-dev@l.g.o
Cc: mgorny@g.o
Subject: Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog golang-build.eclass
Date: Wed, 24 Jun 2015 21:04:56
Message-Id: 20150624210439.GA5820@linux1
In Reply to: Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog golang-build.eclass by "Michał Górny"
1 On Wed, Jun 24, 2015 at 07:02:49PM +0200, Michał Górny wrote:
2 > Dnia 2015-06-24, o godz. 11:51:44
3 > William Hubbs <williamh@g.o> napisał(a):
4 >
5 > > On Wed, Jun 24, 2015 at 05:54:31PM +0200, Michał Górny wrote:
6 > > > Dnia 2015-06-24, o godz. 15:38:34
7 > > > "William Hubbs (williamh)" <williamh@g.o> napisał(a):
8 > >
9 > > *snip*
10 > >
11 > > > > # @FUNCTION: _golang-build_setup
12 > > > > # @INTERNAL
13 > > > > # @DESCRIPTION:
14 > > > > # Make sure EGO_PN has a value.
15 > > > > _golang-build_setup() {
16 > > > > [ -z "${EGO_PN}" ] &&
17 > > >
18 > > > Please don't use 'unsafe' single brackets. Use bash's double brackets,
19 > > > i.e. [[ -z ${EGO_PN} ]].
20 > >
21 > > Ok, this will be fixed.
22 > >
23 > > > > golang-build_src_compile() {
24 > > > > debug-print-function ${FUNCNAME} "$@"
25 > > > >
26 > > > > _golang-build_setup
27 > > > > set -- env GOPATH="${WORKDIR}/${P}:${EPREFIX}/usr/lib/go-gentoo" \
28 > > > > go build -v -work -x "${EGO_PN}"
29 > > > > echo "$@"
30 > > >
31 > > > I suggest to push this to stderr, >&2.
32 > >
33 > > Why? this is just printing the command before we run it. Do Make, etc
34 > > print this output to stderr?
35 >
36 > This is pretty much a debugging output which doesn't belong besides
37 > regular output. Make doesn't, bash does.
38
39 My concern is, if the go tools themselves put some output on stdout and
40 some on stderr and I redirect everything to stderr, that could break
41 upstream behaviour, and I would rather not do that.
42
43 >
44 > > > > "$@" || die
45 > > >
46 > > > And anyway, this looks to have a common, repeating part that sounds
47 > > > like a good candidate for separate emake-like function... ego? :D
48 > >
49 > > Do you mean these lines:
50 > >
51 > > echo "$@"
52 > > "$@" || die
53 >
54 > Also the common settings for go.
55 >
56 > i.e.:
57 >
58 > set -- env GOPATH="${WORKDIR}/${P}:${EPREFIX}/usr/lib/go-gentoo" \
59 > go "${@}"
60 > echo "${@}"
61 > "${@}" || die...
62
63 I would have to think about that, because you are looking at different
64 subcommands (build, get, install), so I would need to see which flags
65 are really common to all of them.
66
67 William

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies