Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] expat depends

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: Andrew <afrayedknot AT thefrayedknot.armory.com>
  • To: SM Discuss <sm-discuss AT lists.ibiblio.org>
  • Subject: Re: [SM-Discuss] expat depends
  • Date: Wed, 18 Jan 2006 18:05:57 -0800

On Thu, Jan 19, 2006 at 12:31:23AM +0100, neuron wrote:
> > > For example, gaze orphan showed me that sdl_net is not needed anymore.
> > > After dispel of sdl_net, dosbox didn't work anymore. The problem is,
> > > that the dosbox ./configure uses sdl_net if it finds one during
> > > compilation, but there is no way to disable it. So the correct way to do
> > > DEPENDS file should be something like:
> > >
> > > if spell_ok sdl_net; then
> > > depends sdl_net
> > > else
> > > optional_depends sdl_net
> > > fi
> > >
> > > If we checked all libs and binaries after install, we might have good
> > > chance of having perfect dependencies, no ?
> >
> > That's what optional_depends is for, don't do if checks like that.
> > What you'd do is put 'if; then fi' in PRE_BUILD to modify the
> > configure script to not enable/find sdl_net if the user said 'n' to
> > sdl_net.
>
> Why ? I think that the result for end user is the same. Patching
> whatever seems to me harder than writing this:
>
> if spell_ok sdl_net; then
> depends sdl_net
> else
> optional_depends sdl_net
> fi
>
> Also the patch will have to be changed as the configure will be changed.
>

Support for a given optional dependency is not a function of whether
or not the spell is installed or not, it is a function of what the
user wants. Their decision might be effected by the status of the spell,
but thats an implementation detail.

When you use an optional depends the dependency can either be on or off.
The spell is then supposed to pass the appropriate options to the source's
build configuration to enable or disable the support, or modify it if no such
options exist. This is what eric was talking about.

The spell must explicitly disable support for something if the
optional depends is disabled, especially if the dependency is installed.

If I have arts installed and cast xmms, i might not want xmms linking
against arts at all. Note that optional_depends has additional parameters
to specify an enabled and disabled option, which in the default case
are passed to the ./configure script.

Also, depends/optional_depends can only be run during DEPENDS, which
is only run once during cast. It also makes little sense to check if a
dependent spell is installed or not because the dependent spell might
be installed by the time the current spell is being built.


The real answer to this problem is that spells need to explicitly list
all of their dependencies, and properly disable linking to disabled
optional_dependencies. The first problem is something that could be solved
using the prometheus testing tool and a script written by dufflebunk to
list missing dependencies. The hacky work-around thats being used is to
check what spells are linking against the spell's libraries and
trigger those whether or not a dependency exists. Each of those missing
dependencies are actually bugs.

-Andrew

--
_________________________________________________________________________
| Andrew D. Stitt | acedit at armory.com | astitt at sourcemage.org |
| irc: afrayedknot | Sorcery Team Lead | ftp://t.armory.com/ |
| 1024D/D39B096C | 76E4 728A 04EE 62B2 A09A 96D7 4D9E 239B D39B 096C |
-------------------------------------------------------------------------




Archive powered by MHonArc 2.6.24.

Top of Page