Hi Eelco, Vlada,

thank you for your feedback!

Eelco Dolstra <[email protected]> writes:
> On 22/06/14 16:41, Florian Friesdorf wrote:
>
>>> Personally, I would try to do all work from that substituteAll point in 
>>> derivations and not through nix strings (i.e. catenate by cat command).
>
> Right. Doing large string rewrites at evaluation time is a bad idea
> because it's slow.

I understand now that with pkgs.substiuteAll I would write a new file
which serves as an input to my expression and would only be updated if
the source file changed in contrast to do the substitution with every
evaluation.

Am I correct that my solution performs about as good as the in-place
testScripts for tests/installer.nix which us ${ } and that as Vlada said
this would be bad within pkgs.* but okish within nixos/tests?

Would caching of function values within nix be an option, so that
caching does not only happen via the store?

>> I've got a working solution:
>> https://github.com/chaoflow/nixpkgs/blob/2efc8fe32239cccab0e1b89b3c0983a2857dd128/nixos/tests/python.nix#L23
>> 
>> Should I move replaceSubstring and interpolateAtAtVars to
>> lib/strings.nix?
>
> At first glance, these functions seem pretty slow to me (since they use
> splitString). So it's probably not a good idea to add them to the standard
> library (and I'd prefer removing splitString from there).

They are definitely slow in their current form.

Florian
-- 
Florian Friesdorf <[email protected]>
  GPG FPR: 7A13 5EEE 1421 9FC2 108D  BAAF 38F8 99A3 0C45 F083
Jabber/XMPP: [email protected]
IRC: chaoflow on freenode,ircnet,blafasel,OFTC

Attachment: pgpw179G8PqGF.pgp
Description: PGP signature

_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to