Hi, Ludovic Courtès wrote:
> Michael Raskin <[email protected]> writes: > >> Eelco Dolstra wrote: > >>>> +in >>>> +rec { >>>> + src = fetchurl { >>>> + url = >>>> "http://launchpad.net/cuneiform-linux/${version}/${version}/+download/cuneiform-${version}.tar.bz2"; >>>> + sha256 = "0jgiccimwv1aqp9gzl9937gdlh9zl5qpaygf0n1xcbfd5aqz14ig"; >>>> + }; >>> This fetchurl call is potentially inconsistent: if I supply a version other >>> than >>> 0.6, the sha256 hash won't be correct. >> That is not the point. The point is that you do not need to edit version >> everywhere in expression - and if you specify it wrong, fetchurl fails. > > Agreed, it makes for smaller diffs. :-) To be clear, I don't have a problem with 'let version = "0.6";' which is very convenient (and also cleaner since you shouldn't repeat the same piece of information). The problem is that it gets the version from the function arguments, so the function basically promises something in its interface that it doesn't support (namely that you can ask it to build arbitrary versions). -- Eelco Dolstra | http://www.st.ewi.tudelft.nl/~dolstra/ _______________________________________________ nix-dev mailing list [email protected] https://mail.cs.uu.nl/mailman/listinfo/nix-dev
