Gentoo Archives: gentoo-dev

From: Sergei Trofimovich <slyfox@g.o>
To:
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH] cargo.eclass: use verbose cargo invocations
Date: Sat, 07 Dec 2019 08:59:15
Message-Id: 20191207085906.6f5841c2@sf
In Reply to: Re: [gentoo-dev] [PATCH] cargo.eclass: use verbose cargo invocations by Georgy Yakovlev
1 On Fri, 06 Dec 2019 16:16:32 -0800
2 Georgy Yakovlev <gyakovlev@g.o> wrote:
3
4 > On Friday, December 6, 2019 3:44:38 PM PST Sergei Trofimovich wrote:
5 > > On Fri, 6 Dec 2019 12:09:31 -0800
6 > >
7 > > Georgy Yakovlev <gyakovlev@g.o> wrote:
8 > > > Default output just prints crate name.
9 > > > With -vv we can see all cargo options and rustc args.
10 > > >
11 > > > Signed-off-by: Georgy Yakovlev <gyakovlev@g.o>
12 > > > ---
13 > >
14 > > Looks good!
15 > >
16 > > I had to do an equivalent locally at least a few times.
17 > Pushed!
18 > >
19 > > While at it I also suggest adding equivalent of
20 > > econf's/emake's ${EXTRA_ECONF} and ${EXTRA_EMAKE}
21 > > to allow users to inject arbitrary stuff. For example
22 > > to sneak in '-Z' options globally.
23 > >
24 > > Say, ${CARGO_BUILD_EXTRA}, ${CARGO_INSTALL_EXTRA},
25 > > ${CARGO_TEST_EXTRA}.
26 > >
27 >
28 > Yeah, it's on my to-do list for this eclass.
29 > 1 question tho, should it come after "$@" or before? Do you use it?
30 > I know cargo can be picky about order and some ebuilds rely on passing params
31 > in phase funcs.
32
33 I don't use it frequently for carge.eclass but use it extensively for
34 ./configure and haskell-cabal.eclass. I'd say variables are designed to
35 override everything else (eclass defaults and ebuild values) and thus
36 should come after "$@":
37 econf() { ... "$@" "${EXTRA_ECONF[@]}" }
38 ${MAKE:-make} ${MAKEOPTS} "$@" ${EXTRA_EMAKE}
39
40 --
41
42 Sergei