Skip to content

Commit 304cc0d

Browse files
committed
Remove callback we don't need for now
1 parent 5a35db1 commit 304cc0d

File tree

3 files changed

+5
-42
lines changed

3 files changed

+5
-42
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, DerivationBuilder
335335
NIXC_CATCH_ERRS
336336
}
337337

338-
nix_err nix_derivation_builder_finish(
339-
nix_c_context * context,
340-
DerivationBuilder * 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, DerivationBuilder * 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
@@ -248,11 +248,7 @@ DerivationBuilder * nix_make_derivation_builder(
248248

249249
nix_err nix_derivation_builder_start(nix_c_context * context, DerivationBuilder * builder);
250250

251-
nix_err nix_derivation_builder_finish(
252-
nix_c_context * context,
253-
DerivationBuilder * builder,
254-
void * userdata,
255-
void (*callback)(void * userdata, const char * outname, const StorePath * out));
251+
nix_err nix_derivation_builder_finish(nix_c_context * context, DerivationBuilder * builder);
256252

257253
void nix_derivation_builder_free(DerivationBuilder * builder);
258254

src/libstore-tests/nix_api_store.cc

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -310,31 +310,9 @@ TEST_F(nix_api_store_test_base, build_using_builder)
310310
assert_ctx_ok();
311311
ASSERT_EQ(ret, NIX_OK);
312312

313-
auto cb = LambdaAdapter{.fun = [&](const char * outname, const StorePath * outPath) {
314-
auto cb2 = LambdaAdapter{.fun = [&](const char * str, unsigned int) {
315-
nix::warn("WE JUST MADE THIS %s", str);
316-
bool ret = exists(std::filesystem::path{str});
317-
EXPECT_TRUE(ret);
318-
assert(ret);
319-
}};
320-
321-
void (*fp2)(const char *, unsigned int, decltype(cb2) *) = decltype(cb2)::call2<const char *, unsigned int>;
322-
nix_print_store_path(
323-
sd,
324-
outPath,
325-
reinterpret_cast<void (*)(const char *, unsigned int, void *)>(fp2),
326-
static_cast<void *>(&cb2));
327-
}};
328-
329-
void (*fp)(decltype(cb) *, const char *, const StorePath *) = decltype(cb)::call<const char *, const StorePath *>;
330-
331313
// Finish the build, i.e. cleanup (TODO expose pipe, so rather than just blocking,
332314
// the caller do its own event loop before calling this)
333-
ret = nix_derivation_builder_finish(
334-
ctx,
335-
builder,
336-
static_cast<void *>(&cb),
337-
reinterpret_cast<void (*)(void *, const char *, const StorePath *)>(fp));
315+
ret = nix_derivation_builder_finish(ctx, builder);
338316
assert_ctx_ok();
339317
ASSERT_EQ(ret, NIX_OK);
340318

0 commit comments

Comments
 (0)