Skip to content

Commit

Permalink
Open the store before constructing EvalState.
Browse files Browse the repository at this point in the history
EvalState requires the `store` global to be initialized before it is constructed
in some cases, e.g. when it needs to download a tarball for something in
NIX_PATH. Hence, this fixes #13.
  • Loading branch information
solson committed Feb 17, 2016
1 parent dc8b517 commit cfc874e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions nix-repl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ NixRepl::NixRepl(const Strings & searchPath)
, staticEnv(false, &state.staticBaseEnv)
{
curDir = absPath(".");

store = openStore();
}


Expand Down Expand Up @@ -622,6 +620,7 @@ int main(int argc, char * * argv)
return true;
});

store = openStore();
NixRepl repl(searchPath);
repl.mainLoop(files);
});
Expand Down

4 comments on commit cfc874e

@shlevy
Copy link
Member

@shlevy shlevy commented on cfc874e Apr 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This definitely does not fix #13! 😀

@dtzWill
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aw man, I got notified that was closed and was very excited hahaha 😁.

@copumpkin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same! I dropped everything to come check!

@solson
Copy link
Member Author

@solson solson commented on cfc874e Apr 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hehe, I guess that's the danger of pulling in the history of another repo (https://github.com/edolstra/nix-repl). This fixed edolstra/nix-repl#13. GitHub can be a bit overzealous with "fixed" messages.

Please sign in to comment.