@@ -44,17 +44,26 @@ Store * nix_store_open(nix_c_context * context, const char * uri, const char ***
4444 try {
4545 std::string uri_str = uri ? uri : " " ;
4646
47- if (uri_str.empty ())
48- return new Store{nix::openStore ()};
47+ if (uri_str.empty ()) {
48+ auto store = nix::openStore ();
49+ auto asyncPathWriter = nix::AsyncPathWriter::make (store);
50+ return new Store{asyncPathWriter, store};
51+ }
4952
50- if (!params)
51- return new Store{nix::openStore (uri_str)};
53+ if (!params) {
54+ auto store = nix::openStore (uri_str);
55+ auto asyncPathWriter = nix::AsyncPathWriter::make (store);
56+ return new Store{asyncPathWriter, store};
57+ }
5258
5359 nix::Store::Config::Params params_map;
5460 for (size_t i = 0 ; params[i] != nullptr ; i++) {
5561 params_map[params[i][0 ]] = params[i][1 ];
5662 }
57- return new Store{nix::openStore (uri_str, params_map)};
63+
64+ auto store = nix::openStore (uri_str, params_map);
65+ auto asyncPathWriter = nix::AsyncPathWriter::make (store);
66+ return new Store{asyncPathWriter, store};
5867 }
5968 NIXC_CATCH_ERRS_NULL
6069}
@@ -127,6 +136,7 @@ StorePath * nix_store_parse_path(nix_c_context * context, Store * store, const c
127136 context->last_err_code = NIX_OK;
128137 try {
129138 nix::StorePath s = store->ptr ->parseStorePath (path);
139+ store->asyncPathWriter ->waitForPath (s);
130140 return new StorePath{std::move (s)};
131141 }
132142 NIXC_CATCH_ERRS_NULL
0 commit comments