My aggregated monorepo of OCaml code, automaintained
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix --rebuild-base: use sudo to delete root-owned base image files

Docker export creates root-owned files in the base image. The
previous code used Bos.OS.Path.delete which silently failed on
root-owned files, leaving the old base in place.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+3 -3
+3 -3
day11/bin/cmd_batch.ml
··· 247 247 (* Delete base image early if --rebuild-base, before loading *) 248 248 if rebuild_base then begin 249 249 let base_dir = Fpath.(cache_dir / "base") in 250 - Printf.printf "Deleting base image and all build layers for rebuild...\n%!"; 251 - ignore (Bos.OS.Path.delete ~recurse:true base_dir); 252 250 let os_dir_pre = Fpath.(cache_dir / Printf.sprintf "%s-%s-%s" 253 251 os_distribution os_version arch) in 254 - (* Need sudo for root-owned layer files *) 252 + Printf.printf "Deleting base image and all build layers for rebuild...\n%!"; 253 + (* Both dirs have root-owned files from Docker export / container builds *) 255 254 Common.with_eio (fun env -> 255 + ignore (Day11_exec.Sudo.rm_rf env base_dir); 256 256 ignore (Day11_exec.Sudo.rm_rf env os_dir_pre)) 257 257 end; 258 258 (* Try to load cached base image for DAG construction. *)