Hi!

[email protected] (Ludovic Courtès) writes:

> --8<---------------cut here---------------start------------->8---
> let x = derivation {
>       name = "x"; builder = ./foo.sh; system = builtins.currentSystem;
>     };
>     y = { b = x; };
> in
>   x // y
> --8<---------------cut here---------------end--------------->8---
>
> Running ‘nix-instantiate --strict --eval-only --xml’ yields this:
>
> --8<---------------cut here---------------start------------->8---
> <?xml version='1.0' encoding='utf-8'?>
> <expr>
>   <derivation drvPath="/nix/store/b1pmg2fhxnlnxy0z9hfglgyk66wpa2ar-x.drv" 
> outPath="/nix/store/fw6flnp42lqn9i62aknpch29sadds5pi-x">
>     <attr column="11" line="2" name="b" 
> path="/home/ludo/src/nixpkgs/maintainers/scripts/gnu/self-ref.nix">
>       <derivation drvPath="/nix/store/b1pmg2fhxnlnxy0z9hfglgyk66wpa2ar-x.drv" 
> outPath="/nix/store/fw6flnp42lqn9i62aknpch29sadds5pi-x">
>         <repeated />
>       </derivation>
>     </attr>
>
>     [...]
>
>   </derivation>
> </expr>
> --8<---------------cut here---------------end--------------->8---

Actually, isn’t this XML representation ambiguous?

It could just as well represent:

  let x = derivation {
            name = "x"; builder = ./foo.sh; system = builtins.currentSystem;
            b = x;
          };
  in x

though this one obviously leads to an infinite recursion.

In Nix derivations aren’t a disjoint type, but in the XML above they
/are/ disjoint.

Thanks,
Ludo’.

_______________________________________________
nix-dev mailing list
[email protected]
https://mail.cs.uu.nl/mailman/listinfo/nix-dev

Reply via email to