Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Aug 2009 02:10:06 +0300
From:      Peter Pentchev <roam@ringlet.net>
To:        Kevin Oberman <oberman@es.net>
Cc:        ports@freebsd.org, ahze@freebsd.org
Subject:   Re: serpentine port forces dependency on muine
Message-ID:  <20090826231006.GA1079@straylight.m.ringlet.net>
In-Reply-To: <20090826184748.4E77A1CC09@ptavv.es.net>
References:  <4A94D098.2040501@infracaninophile.co.uk> <20090826184748.4E77A1CC09@ptavv.es.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--HcAYCG3uE/tztfnV
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Aug 26, 2009 at 11:47:48AM -0700, Kevin Oberman wrote:
> > Date: Wed, 26 Aug 2009 07:05:12 +0100
> > From: Matthew Seaman <m.seaman@infracaninophile.co.uk>
> >=20
> > Kevin Oberman wrote:
> >=20
> > > If muine found in /usr/local/bin/, it will be built with the plug-in,
> > > regardless of which way the MUINE configure option is set because:
> > > .if (defined(MUINE) || exists(${LOCALBASE}/bin/muine)) && ${ARCH}=3D=
=3D"i386"
> >=20
> > This is incorrect behaviour in any case: ports should not arbitrarily c=
hange configuration depending on what is or is not already installed, and u=
ser
> > choices from OPTIONS dialogues should be paramount.  The test should be:
> >=20
> > .if defined(WITH_MUINE) && !defined(WITHOUT_MUINE) && ${ARCH} =3D=3D"i3=
86"
>=20
>=20
> The more I look at this port, the stranger it is.

Uhm, no it isn't, not really :)

> It has OPTIONS=3D, but does not include bsd.port.options.mk.

It includes bsd.port.pre.mk before testing the option.  The part that
takes care of displaying the dialog window to the user is in
bsd.port.pre.mk.  This part of the port's Makefile is correct.

> It then uses tests on a variable named MUINE (same as the option),
> not WITH_MUINE or WITHOUT_MUINE.

No it doesn't.  The port's Makefile uses tests on WITH_MUINE (line 32).
It then adds a variable named MUINE to the PLIST_SUB - the variable
that contains the substitutions to be made in the pkg-plist file.
And indeed, the pkg-plist file contains a couple of lines with
%%MUINE%% in them - that part works, too, because the port adds
MUINE to PLIST_SUB.  This part of the port's Makefile is also correct.

> This effectively makes the "option" not an option, at all. Serpentine
> is ALWAYS built with the muine plug-in and, since the muine port is
> broken (probably forever), this effectively breaks serpentine.

No it isn't.  Serpentine is always built with muine *only* if the muine
port is installed on the system at the time serpentine is build, as
I explained in the previous message.

Witness - on my system, where I *don't* have muine installed:

[roam@straylight /usr/ports/sysutils/serpentine]$ sudo make config
(I can't really paste the dialog window, but I now mark the MUINE
 option, turning it on)

[roam@straylight /usr/ports/sysutils/serpentine]$ make -V WITH_MUINE
true
[roam@straylight /usr/ports/sysutils/serpentine]$ make -V WITHOUT_MUINE

[roam@straylight /usr/ports/sysutils/serpentine]$ make -V BUILD_DEPENDS | (=
fgrep -q muine && echo yep)
yep
[roam@straylight /usr/ports/sysutils/serpentine]$ make -V RUN_DEPENDS | (fg=
rep -q muine && echo yep)
yep
[roam@straylight /usr/ports/sysutils/serpentine]$

So, when I selected the Muine option, the port depends on muine in both
its build- and runtime dependencies.  Now let's try it the other way...

[roam@straylight /usr/ports/sysutils/serpentine]$ sudo make config
(again, can't paste it, but I unmark the muine option)

[roam@straylight /usr/ports/sysutils/serpentine]$ make -V WITH_MUINE

[roam@straylight /usr/ports/sysutils/serpentine]$ make -V WITHOUT_MUINE
true
[roam@straylight /usr/ports/sysutils/serpentine]$ make -V BUILD_DEPENDS | (=
fgrep -q muine && echo yep)
[roam@straylight /usr/ports/sysutils/serpentine]$ make -V RUN_DEPENDS | (fg=
rep -q muine && echo yep)
[roam@straylight /usr/ports/sysutils/serpentine]$

So now WITH_MUINE is not defined (but WITHOUT_MUINE is), and thus
the port does NOT have muine in either its build- or runtime dependencies.

> I am baffled as to how this came to pass. The maintainer (ahze) knows a
> lot more about FreeBSD porting than I do, so I have to believe that
> there is some sense behind this, but I don't see it.

There is some sense.  As I explained in my previous mail, this will
work just fine if the muine port is not installed on the system at
the time serpentine is built.  This is true for the package building
cluster, and it is true for some of us who build our ports this way.

Now...  I do agree that having a port change its behavior depending
on what is installed on the system is not really a good idea.  It used
to be considered a good idea - I remember a time when many, many ports
did this instead of making the user define lots of variables when
the options framework did not exist yet :)  The idea was to make it *easy*
for the user - if she has installed muine, then she most probably *wants*
other apps to support muine, so the serpentine port just goes ahead and
does the right thing without asking.  Probably the WITH_MUINE knob was
present even then, before the options framework - and many people
considered this actually comfortable - "Yes, I know I can define this
variable to make serpentine build with muine support, but I don't even
have to do this - I just build muine beforehand and it's all right".

Even then, I was one of the people who didn't like this, and I removed
such autodetection in all the ports I took over, years ago.  Still,
other maintainers felt that this was useful and comfortable for the users.

This behavior should have been removed when the OPTIONS variable was
added to the port - now there *is* an easy way for the user to specify
whether she wants muine or not.  This part I agree with, and I think
that it should be removed now.

I'm just writing all of this to try to explain the point of view that
led to this situation in the first place, in revision 1.2 of the
Makefile, four years ago.  At that time, the options framework was
not completely finished yet, and users still had to specify WITH_*
and WITHOUT_* variables manually, either on the command line or in
elaborate config files; thus, the autodetection of muine was, indeed,
considered by some to be a useful thing.  Now, I think it's outgrown
its usefulness.

> As serpentine is a part of the gnome2-power-tools metaport and a LOT of
> folks are likely to be re-building a lot of ports due to the V8.0
> release, I'd really like to see it fixed.
>=20
> This does not effect me any longer as I have commented out the part of
> the configuration that enables  the muine plug-in, rebuilt serpentine,
> and deinstalled muine, but I am sure it will cause problems for others.

G'luck,
Peter

--=20
Peter Pentchev	roam@ringlet.net    roam@space.bg    roam@FreeBSD.org
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
I am the meaning of this sentence.

--HcAYCG3uE/tztfnV
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (FreeBSD)

iEYEARECAAYFAkqVwM4ACgkQ7Ri2jRYZRVO7ewCgm9ToCckBT8KiihbvCU95PdbE
jiIAn1lzZY44LlrjD0EegV0j44+oWsxK
=/kXJ
-----END PGP SIGNATURE-----

--HcAYCG3uE/tztfnV--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090826231006.GA1079>