[Nix-dev] Dynamic substituteInPlace

zimbatm zimbatm at zimbatm.com
Mon Feb 15 23:04:33 CET 2016


It's not super clear to me what you are trying to achieve. Maybe you've
zoomed into that specific solution but with more context there might be
others available.

Is the file compiled or is it interpreted ?

I understand that you want to provide some information at runtime and
resolve the path to a derivation. How is that information provided to the
runtime and is the name of the derivation in a limited set ?
Maybe all you need is patchelf if you're compiling a program dynamically
but want to update it later to point to the .so object.


On Mon, 15 Feb 2016 at 17:16 stewart mackenzie <setori88 at gmail.com> wrote:

> Hello,
>
> I've got an issue I don't fully know how to solve in the simplest way.
>
> I have a file which contains something like this:
>
> 'text' -> input_port var_name_instance(a_dynamic_component_name)
> output_port ... etc etc
>
> a_dynamic_component_name could be a name of one of my components in a file
> equivalent to all-packages.nix
>
> How do I replace the name a_dynamic_component_name with
> /nix/store/<hash>-a_dynamic_component_name/lib/libcomponent.so dynamically?
>
> ie
>
> 'text' -> input_port var_name_instance(a_dynamic_component_name)
> output_port ... etc etc
>
> becomes
>
> 'text' -> input_port
> var_name_instance(/nix/store/<hash>-a_dynamic_component_name/lib/libcomponent.so)
> output_port ... etc etc
>
> This file is now ready for execution by a vm.
>
> I do not know the name ahead of time.
>
> Would builtins.tryEval help at all? Seems the docs are sparse and whatever
> is written on the subject lead me to believe it's a tryCatch.
>
> /sjm
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160215/befe4ef1/attachment.html 


More information about the nix-dev mailing list