[Nix-dev] warning if trying to install a package but it fails an assert.

Marc Weber marco-oweber at gmx.de
Fri Dec 19 13:36:50 CET 2008


> Independently of .passthru.function, this sounds like a good plan
> to me. You check your required flags against defaults. If they're
> met, you reuse the default. If they're not met, you adapt on the fly,
> but warn. Actually, it could be a global configuration setting to
> either be silent about it, to warn, or to throw an error in such
> a case, with the default for this setting being the warning ...

How should this look like+

  python = mkDerivation (.. {
    cfg = {
      fooSupport = false;
    };
  })

  # Ovirride defaults and either warn or throw exception depending on your
  # settings
  dependingPackage = mkDerivation (.. {
    buildInputs = { python.passthru.fun { cfg = { fooSupport = true; } } }
  })

Now there is another use case in which we don't want warnings:
pythonFull

It could look like this

  # "full" version
  pythonFull = python.passthru.fun {
    cfg = {
      silent = true; # never warn or throw exceptions.
      fooSupport = true;
    }
  }

Or use another merge function for this:

  # "full" version
  pythonFull = python.passthru.funSilent {
                                  ^^^^^^
    cfg = {
      fooSupport = true;
    }
  }

How do you like this implementation? It would be trivial.
But I'm not yet sure how easy it is to use it?

Sincerly

Marc Weber



More information about the nix-dev mailing list