File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ struct CacheImpl : Cache
5454 const Key & key,
5555 const Attrs & value) override
5656 {
57+ if (disabled ()) return ;
58+
5759 _state.lock ()->upsert .use ()
5860 (key.first )
5961 (attrsToJSON (key.second ).dump ())
@@ -81,9 +83,20 @@ struct CacheImpl : Cache
8183 return {};
8284 }
8385
86+ pid_t originalPid = getpid();
87+
88+ bool disabled ()
89+ {
90+ // FIXME: Temporary hack to disable the cache in
91+ // builtin:fetch-tree builders.
92+ return getpid () != originalPid;
93+ }
94+
8495 std::optional<Result> lookupExpired (
8596 const Key & key) override
8697 {
98+ if (disabled ()) return {};
99+
87100 auto state (_state.lock ());
88101
89102 auto keyJSON = attrsToJSON (key.second ).dump ();
@@ -111,6 +124,8 @@ struct CacheImpl : Cache
111124 Attrs value,
112125 const StorePath & storePath) override
113126 {
127+ if (disabled ()) return ;
128+
114129 /* Add the store prefix to the cache key to handle multiple
115130 store prefixes. */
116131 key.second .insert_or_assign (" store" , store.storeDir );
You can’t perform that action at this time.
0 commit comments