1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-22 17:01:08 +01:00

refactor: Extract EvalState::realiseString

(cherry picked from commit 7465fbe926)

# Conflicts:
#	src/libexpr/primops.cc
This commit is contained in:
Robert Hensing 2025-01-27 12:32:46 +01:00 committed by Mergify
parent a28791a91e
commit 865239c732
3 changed files with 29 additions and 5 deletions

View file

@ -619,12 +619,8 @@ nix_realised_string * nix_string_realise(nix_c_context * context, EvalState * st
context->last_err_code = NIX_OK;
try {
auto & v = check_value_in(value);
nix::NixStringContext stringContext;
auto rawStr = state->state.coerceToString(nix::noPos, v, stringContext, "while realising a string").toOwned();
nix::StorePathSet storePaths;
auto rewrites = state->state.realiseContext(stringContext, &storePaths);
auto s = nix::rewriteStrings(rawStr, rewrites);
auto s = state->state.realiseString(v, &storePaths, isIFD);
// Convert to the C API StorePath type and convert to vector for index-based access
std::vector<StorePath> vec;