mirror of
https://github.com/NixOS/nix.git
synced 2025-11-10 20:46:01 +01:00
No global eval settings in libnixexpr
Progress on #5638 There is still a global eval settings, but it pushed down into `libnixcmd`, which is a lot less bad a place for this sort of thing.
This commit is contained in:
parent
cb0c868da4
commit
52bfccf8d8
24 changed files with 102 additions and 71 deletions
|
|
@ -126,13 +126,11 @@ ref<EvalState> EvalCommand::getEvalState()
|
|||
{
|
||||
if (!evalState) {
|
||||
evalState =
|
||||
std::allocate_shared<EvalState>(
|
||||
#if HAVE_BOEHMGC
|
||||
std::allocate_shared<EvalState>(traceable_allocator<EvalState>(),
|
||||
lookupPath, getEvalStore(), getStore())
|
||||
#else
|
||||
std::make_shared<EvalState>(
|
||||
lookupPath, getEvalStore(), getStore())
|
||||
traceable_allocator<EvalState>(),
|
||||
#endif
|
||||
lookupPath, getEvalStore(), evalSettings, getStore())
|
||||
;
|
||||
|
||||
evalState->repair = repair;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "eval-settings.hh"
|
||||
#include "common-eval-args.hh"
|
||||
#include "shared.hh"
|
||||
#include "config-global.hh"
|
||||
#include "filetransfer.hh"
|
||||
#include "eval.hh"
|
||||
#include "fetchers.hh"
|
||||
|
|
@ -13,6 +14,12 @@
|
|||
|
||||
namespace nix {
|
||||
|
||||
EvalSettings evalSettings {
|
||||
settings.readOnlyMode
|
||||
};
|
||||
|
||||
static GlobalConfig::Register rEvalSettings(&evalSettings);
|
||||
|
||||
MixEvalArgs::MixEvalArgs()
|
||||
{
|
||||
addFlag({
|
||||
|
|
|
|||
|
|
@ -12,9 +12,15 @@ namespace nix {
|
|||
|
||||
class Store;
|
||||
class EvalState;
|
||||
struct EvalSettings;
|
||||
class Bindings;
|
||||
struct SourcePath;
|
||||
|
||||
/**
|
||||
* @todo Get rid of global setttings variables
|
||||
*/
|
||||
extern EvalSettings evalSettings;
|
||||
|
||||
struct MixEvalArgs : virtual Args, virtual MixRepair
|
||||
{
|
||||
static constexpr auto category = "Common evaluation options";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue