From 1fc9ba4885f5a16e263bcc5e58bef68e3aa32cea Mon Sep 17 00:00:00 2001 From: Kane York Date: Thu, 13 Aug 2020 16:40:27 -0700 Subject: refactor(tvix): always pass Bindings by ptr, use shared/unique_ptr Value now carries a shared_ptr, and all Bindings constructors return a unique_ptr. The test that wanted to compare two Bindings by putting them into Values has been modified to use the new Equal() method on Bindings (extracted from EvalState). Change-Id: I8dfb60e65fdabb717e3b3e5d56d5b3fc82f70883 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1744 Tested-by: BuildkiteCI Reviewed-by: glittershark Reviewed-by: tazjin --- third_party/nix/src/nix-prefetch-url/nix-prefetch-url.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'third_party/nix/src/nix-prefetch-url') diff --git a/third_party/nix/src/nix-prefetch-url/nix-prefetch-url.cc b/third_party/nix/src/nix-prefetch-url/nix-prefetch-url.cc index 5454c6cd108e..66e7cff810f5 100644 --- a/third_party/nix/src/nix-prefetch-url/nix-prefetch-url.cc +++ b/third_party/nix/src/nix-prefetch-url/nix-prefetch-url.cc @@ -107,7 +107,7 @@ static int _main(int argc, char** argv) { auto store = openStore(); auto state = std::make_unique(myArgs.searchPath, store); - Bindings& autoArgs = *myArgs.getAutoArgs(*state); + std::unique_ptr autoArgs = myArgs.getAutoArgs(*state); /* If -A is given, get the URI from the specified Nix expression. */ @@ -122,7 +122,7 @@ static int _main(int argc, char** argv) { resolveExprPath(lookupFileArg(*state, args.empty() ? "." : args[0])); Value vRoot; state->evalFile(path, vRoot); - Value& v(*findAlongAttrPath(*state, attrPath, autoArgs, vRoot)); + Value& v(*findAlongAttrPath(*state, attrPath, autoArgs.get(), vRoot)); state->forceAttrs(v); /* Extract the URI. */ -- cgit 1.4.1