Skip to content

Commit a5626e1

Browse files
committed
Remove double closure resolution in NRI build task
NRI server was calling get_closure_paths() then passing the expanded closure to prepare_volume(), which calls get_closure_paths() again internally. Let prepare_volume handle the single closure expansion.
1 parent 4794dce commit a5626e1

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

pkgs/nixkube/src/nri/server.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
)
3535
from ..cri import get_cri_socket, list_container_ids
3636
from ..events import report_event
37-
from ..nix import fetch_packages, get_build_args, get_closure_paths, get_current_system
37+
from ..nix import fetch_packages, get_build_args, get_current_system
3838
from ..store import extract_store_paths
3939
from ..volume import prepare_volume
4040
from .annotations import parse_nix_rw, parse_store_mounts
@@ -522,10 +522,8 @@ async def _spawn_build_task(
522522
await fetch_packages(store_paths, volume_path, extra_args)
523523
logger.debug(f"fetch_packages completed for container={container_id!r}")
524524

525-
# Get all paths
526-
paths = await get_closure_paths(store_paths)
527-
# Hardlink closure into volume
528-
await prepare_volume(volume_path, paths, None)
525+
# Hardlink closure into volume (prepare_volume handles closure expansion)
526+
await prepare_volume(volume_path, store_paths, None)
529527
nix_tree_path = volume_path / "nix"
530528

531529
# Wait for nri-wait to report PID+bundle (arrives when the createRuntime hook fires).
@@ -568,7 +566,7 @@ async def _spawn_build_task(
568566
logger.info(f"Removed from pending_builds for container={container_id!r}")
569567

570568
# Copy all packages to cache in background
571-
schedule_copy_to_cache(paths)
569+
schedule_copy_to_cache(store_paths)
572570

573571
# Report successful build
574572
await report_event(

0 commit comments

Comments
 (0)