My aggregated monorepo of OCaml code, automaintained
0
fork

Configure Feed

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

Fix: create compile nodes without checking installed_libs at DAG time

On a fresh cache, build layers don't exist yet when the compile DAG
is constructed, so scan_libs finds nothing. Moved the installed_libs
check to execution time (in compile_package) where the build layer
is guaranteed to exist.

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

+4 -6
+4 -6
day11/doc/generate.ml
··· 195 195 - link(A) depends on compile(X) for all X in A's solution *) 196 196 let compile_nodes : (OpamPackage.t, build) Hashtbl.t = Hashtbl.create 64 in 197 197 let link_nodes_list = ref [] in 198 - (* Create compile nodes — deps mirror build deps *) 198 + (* Create compile nodes for every package with a matching odoc tool. 199 + Don't check installed_libs here — layers may not exist yet in a 200 + fresh cache. The compile callback checks at execution time. *) 199 201 List.iter (fun (node : build) -> 200 - let pkg_dir = build_dir ~os_dir node in 201 - let installed_libs = Day11_layer.Installed_files.scan_libs 202 - ~layer_dir:pkg_dir in 203 - if installed_libs <> [] && find_odoc_tool node.pkg <> None then begin 202 + if find_odoc_tool node.pkg <> None then begin 204 203 let odoc_tool = Option.get (find_odoc_tool node.pkg) in 205 204 let composite_tool_hash = Day11_layer.Hash.of_strings 206 205 [ driver_tool.hash; odoc_tool.hash ] in 207 206 let compile_hash = Day11_layer.Hash.of_strings 208 207 [ "compile"; node.hash; composite_tool_hash ] in 209 - (* Compile deps = build node + compile nodes for build deps *) 210 208 let compile_deps = [ node ] in 211 209 let cn : build = { hash = compile_hash; pkg = node.pkg; 212 210 deps = compile_deps } in