@@ -418,7 +418,7 @@ public:
418418
419419 RootValue vImportedDrvToDerivation = nullptr ;
420420
421- ref<fetchers::InputCache> inputCache;
421+ const ref<fetchers::InputCache> inputCache;
422422
423423 /* *
424424 * Debugger
@@ -471,18 +471,18 @@ private:
471471
472472 /* Cache for calls to addToStore(); maps source paths to the store
473473 paths. */
474- ref<boost::concurrent_flat_map<SourcePath, StorePath>> srcToStore;
474+ const ref<boost::concurrent_flat_map<SourcePath, StorePath>> srcToStore;
475475
476476 /* *
477477 * A cache that maps paths to "resolved" paths for importing Nix
478478 * expressions, i.e. `/foo` to `/foo/default.nix`.
479479 */
480- ref<boost::concurrent_flat_map<SourcePath, SourcePath>> importResolutionCache;
480+ const ref<boost::concurrent_flat_map<SourcePath, SourcePath>> importResolutionCache;
481481
482482 /* *
483483 * A cache from resolved paths to values.
484484 */
485- ref<boost::concurrent_flat_map<
485+ const ref<boost::concurrent_flat_map<
486486 SourcePath,
487487 Value *,
488488 std::hash<SourcePath>,
@@ -592,12 +592,13 @@ public:
592592 * Parse a Nix expression from the specified file.
593593 */
594594 Expr * parseExprFromFile (const SourcePath & path);
595- Expr * parseExprFromFile (const SourcePath & path, std::shared_ptr<StaticEnv> & staticEnv);
595+ Expr * parseExprFromFile (const SourcePath & path, const std::shared_ptr<StaticEnv> & staticEnv);
596596
597597 /* *
598598 * Parse a Nix expression from the specified string.
599599 */
600- Expr * parseExprFromString (std::string s, const SourcePath & basePath, std::shared_ptr<StaticEnv> & staticEnv);
600+ Expr *
601+ parseExprFromString (std::string s, const SourcePath & basePath, const std::shared_ptr<StaticEnv> & staticEnv);
601602 Expr * parseExprFromString (std::string s, const SourcePath & basePath);
602603
603604 Expr * parseStdin ();
@@ -766,7 +767,7 @@ public:
766767
767768#if NIX_USE_BOEHMGC
768769 /* * A GC root for the baseEnv reference. */
769- std::shared_ptr<Env *> baseEnvP;
770+ const std::shared_ptr<Env *> baseEnvP;
770771#endif
771772
772773public:
@@ -780,7 +781,7 @@ public:
780781 /* *
781782 * The same, but used during parsing to resolve variables.
782783 */
783- std::shared_ptr<StaticEnv> staticBaseEnv; // !!! should be private
784+ const std::shared_ptr<StaticEnv> staticBaseEnv; // !!! should be private
784785
785786 /* *
786787 * Internal primops not exposed to the user.
@@ -862,7 +863,7 @@ private:
862863 size_t length,
863864 Pos::Origin origin,
864865 const SourcePath & basePath,
865- std::shared_ptr<StaticEnv> & staticEnv);
866+ const std::shared_ptr<StaticEnv> & staticEnv);
866867
867868 /* *
868869 * Current Nix call stack depth, used with `max-call-depth` setting to throw stack overflow hopefully before we run
0 commit comments