-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to deal with string contexts #74
Comments
That's a very good observation, thank you! I don't have a clear answer yet how I can/want to solve this. |
We need NixOS/nix#4677 |
https://github.com/wireapp/wire-server/blob/develop/nix/pkg-info.nix I’ve made this abomination a while ago. It works but it probably needs a ton of adjustments if you want to use it for anything but wireserver |
It goes what I described above though. |
will go around in circleYou could use https://nix.dev/manual/nix/2.18/language/builtins#builtins-genericClosure for this |
That’s not the only problem though. Nix will also memory leak like crazy. So probably not going to work anyway. You need to be careful what to recurse on. I think I also excluded a couple of attrsets to not look at. |
In Nix >= 2.6 you can use the following code to correctly and reliably determine the dependency closure of a derivation (in Nix < 2.6 you have to parse the drv files yourself which is perfectly possible): drv:
builtins.map (builtins.getAttr "key")
builtins.genericClosure {
startSet = [ { key = builtins.unsafeDiscardStringContext "${drv.drvPath}"; } ];
operator = { key }: builtins.map (drvPath: { key = drvPath; }) (
builtins.attrNames (builtins.getContext (builtins.readFile key))
);
}
) Obviously you are left with the problem that the serialized derivation files are lossy and lack e.g. |
Came up with something very similar. But adds a fixup phase that tried to reconstruct string-context deps if they happen to match non-string-context deps https://gist.github.com/arianvp/e96acf85734ebe7a58bf24d4758484eb As a last resort we can at least guess the version and pname by doing string parsing on the drv path and show a warning that the drv is unknown. |
the issue is as follows:
mkDerivation
buildsdrvPath
so we can query the dependenciesthis package clearly depends on
pkgs.hello
but bombon doesn't recognize that.I have not found a solution but a very sad one:
drvPath
of the derivationThe text was updated successfully, but these errors were encountered: