Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: orbea <orbea@××××××.net>
Cc: Gentoo Dev <gentoo-dev@l.g.o>
Subject: [gentoo-dev] Re: [PATCH 1/5] ninja-utils.eclass: Support dev-util/samurai
Date: Mon, 09 May 2022 17:50:03
Message-Id: CAJ0EP425hUFbJap-3pju=R1ucTwcDJLNb=QLm9DKJP=U-qkzNw@mail.gmail.com
1 On Mon, May 9, 2022 at 1:13 PM orbea <orbea@××××××.net> wrote:
2 >
3 > On Mon, 9 May 2022 10:59:03 -0400
4 > Mike Gilbert <floppym@g.o> wrote:
5 > > The NINJA environment variable is used directly by meson and may
6 > > contain an absolute path. I don't think it makes sense to restrict
7 > > possible values to just "ninja" and "samu". That will make it more
8 > > difficult for users to override it with a local copy of either tool,
9 > > or to use a different implementation should someone write one in the
10 > > future.
11 > >
12 > > It might make sense to introduce a different eclass variable to
13 > > control NINJA_DEPEND and the default value for NINJA.
14 >
15 > The game antares (https://github.com/arescentral/antares) has a custom
16 > python based build system that also respects the NINJA variable.
17 >
18 > Your point is a good one, but I'm unsure how this would work? The
19 > NINJA_DEPEND variable has to be set to a valid package elsewhere in the
20 > eclass scripts, for example the 'has_version -b' check in the cmake
21 > eclass.
22 >
23 > Allowing the user to set an arbitrary value will require they also
24 > being able to set NINJA_DEPEND to a correct value. In some of these
25 > cases there may not be an applicable ebuild to set it to even. Maybe
26 > I'm missing something, but this seems like a good way to complicate the
27 > process and possibly introduce pebkac. Maybe it would be preferable to
28 > just add additional ninja implementations to the list as they are
29 > available?
30 >
31 > Also if its just testing local versions I think it could be worked
32 > around by setting the PATH and / or using symlinks? A user could
33 > create a dummy ebuild as well.
34
35 We could make the eclass ewarn on unknown NINJA values, and set
36 NINJA_DEPEND to empty in that case. Just don't call "die".
37
38 That would allow users to override NINJA without triggering a failure,
39 and still alerts ebuild maintainers in case they make a typo when
40 setting NINJA in an ebuild.