Skip to content

Commit 74d2354

Browse files
committed
Remove callback we don't need for now
1 parent baf151d commit 74d2354

File tree

3 files changed

+5
-39
lines changed

3 files changed

+5
-39
lines changed

src/libstore-c/nix_api_store.cc

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ StorePath * nix_store_parse_path2(nix_c_context * context, StoreDir store_dir, c
141141
NIXC_CATCH_ERRS_NULL
142142
}
143143

144-
void
145-
nix_print_store_path(StoreDir store_dir, const StorePath * path, nix_get_string_callback callback, void * user_data)
144+
void nix_print_store_path(
145+
StoreDir store_dir, const StorePath * path, nix_get_string_callback callback, void * user_data)
146146
{
147147
nix::Path sdInner = store_dir.store_directory;
148148
nix::StoreDirConfig sd{sdInner};
@@ -335,11 +335,7 @@ nix_err nix_derivation_builder_start(nix_c_context * context, nix_derivation_bui
335335
NIXC_CATCH_ERRS
336336
}
337337

338-
nix_err nix_derivation_builder_finish(
339-
nix_c_context * context,
340-
nix_derivation_builder * builder,
341-
void * userdata,
342-
void (*callback)(void * userdata, const char * outname, const StorePath * out))
338+
nix_err nix_derivation_builder_finish(nix_c_context * context, nix_derivation_builder * builder)
343339
{
344340
try {
345341
nix::StringSink sink;
@@ -357,13 +353,6 @@ nix_err nix_derivation_builder_finish(
357353
auto [status, diskFull] = builder->builder->unprepareBuild();
358354

359355
nix::warn("RESULT: %s", nix::statusToString(status));
360-
361-
if (callback) {
362-
for (const auto & [outputName, realisation] : builder->buildResult.builtOutputs) {
363-
StorePath p{realisation.outPath};
364-
callback(userdata, outputName.c_str(), &p);
365-
}
366-
}
367356
}
368357
NIXC_CATCH_ERRS
369358
}

src/libstore-c/nix_api_store.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,7 @@ nix_derivation_builder * nix_make_derivation_builder(
268268

269269
nix_err nix_derivation_builder_start(nix_c_context * context, nix_derivation_builder * builder);
270270

271-
nix_err nix_derivation_builder_finish(
272-
nix_c_context * context,
273-
nix_derivation_builder * builder,
274-
void * userdata,
275-
void (*callback)(void * userdata, const char * outname, const StorePath * out));
271+
nix_err nix_derivation_builder_finish(nix_c_context * context, nix_derivation_builder * builder);
276272

277273
void nix_derivation_builder_free(nix_derivation_builder * builder);
278274

src/libstore-tests/nix_api_store.cc

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -318,28 +318,9 @@ TEST_F(nix_api_store_test_base, build_using_builder)
318318
assert_ctx_ok();
319319
ASSERT_EQ(ret, NIX_OK);
320320

321-
auto cb = LambdaAdapter{.fun = [&](const char * outname, const StorePath * outPath) {
322-
auto cb2 = LambdaAdapter{.fun = [&](const char * str, unsigned int) {
323-
nix::warn("WE JUST MADE THIS %s", str);
324-
bool ret = exists(std::filesystem::path{str});
325-
EXPECT_TRUE(ret);
326-
assert(ret);
327-
}};
328-
329-
nix_print_store_path(
330-
sd,
331-
outPath,
332-
decltype(cb2)::call2_void<const char *, unsigned int>,
333-
static_cast<void *>(&cb2));
334-
}};
335-
336321
// Finish the build, i.e. cleanup (TODO expose pipe, so rather than just blocking,
337322
// the caller do its own event loop before calling this)
338-
ret = nix_derivation_builder_finish(
339-
ctx,
340-
builder,
341-
static_cast<void *>(&cb),
342-
decltype(cb)::call_void<const char *, const StorePath *>);
323+
ret = nix_derivation_builder_finish(ctx, builder);
343324
assert_ctx_ok();
344325
ASSERT_EQ(ret, NIX_OK);
345326

0 commit comments

Comments
 (0)