Re: [Nix-dev] How to traverse "/nix-support/propagated-native-build-inputs" in nix ?

2017-05-14 Thread Volth
As a quick hack, I solved it by make a derivation which do the
travercs in its bash code (in buindCommand) producing a text file as
an output.

inspecting "myPackage.propagatedBuildInputs" looks a cleaner solution, thank you

On 5/14/17, Vladimír Čunát  wrote:
> On 05/14/2017 05:16 PM, Volth wrote:
>> I would like to get list of all propagated build inputs in nix
>
> In general you can't even get that file.  As it is designed, that list
> is defined by contents of files in build output, so you can't be certain
> until you produce the path (which is what you want to avoid, if I get
> you right).
>
> You can, of course, inspect myPackage.propagatedBuildInputs
> (recursively), etc.
>
> --Vladimir
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] How to traverse "/nix-support/propagated-native-build-inputs" in nix ?

2017-05-14 Thread Vladimír Čunát
On 05/14/2017 05:16 PM, Volth wrote:
> I would like to get list of all propagated build inputs in nix

In general you can't even get that file.  As it is designed, that list
is defined by contents of files in build output, so you can't be certain
until you produce the path (which is what you want to avoid, if I get
you right).

You can, of course, inspect myPackage.propagatedBuildInputs
(recursively), etc.

--Vladimir
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] How to traverse "/nix-support/propagated-native-build-inputs" in nix ?

2017-05-14 Thread Volth
Hi

I would like to get list of all propagated build inputs in nix

But the code like

```
  get-propagated-derivations = s:
if (lib.isStorePath s) then
  if (builtins.pathExists
"${s}/nix-support/propagated-native-build-inputs") then
lib.concatMap get-propagated-derivations (lib.splitString
" " (lib.fileContents
"${s}/nix-support/propagated-native-build-inputs"))
  else
[s]
else
  [s];

```

does not work becase builtins.pathExists throws with "cannot refer to
other paths".
lib.fileContents has no such problem but it throws unless the file exists.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev