A fork of mtelver's day10 project

day10: fix jtw-tools repo URL, git+ prefix, and output path extraction

Three fixes for day10's JTW integration:

1. Default --jtw-tools-repo changed from bogus github URL to correct
tangled.org URL, default branch from "enhancements" to "main"

2. opam pin commands now use git+ prefix (git+https://...) so opam
treats the URL as a git repo instead of trying to download it as
an archive

3. Container output path fixed: jtw opam --path <pkg> writes to
<output>/<pkg>/lib/ but linux.ml was looking at <output>/lib/.
Now correctly reads from <output>/<pkg>/lib/.

Tested end-to-end with seq.0.3.1: jtw-tools layer builds, per-package
artifacts generated, batch assembly produces correct findlib_index.json
with meta_files key and content-hashed paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+15 -12
+7 -6
bin/jtw_tools.ml
··· 32 32 String.concat " && " 33 33 [ 34 34 Printf.sprintf "opam install -y ocaml-base-compiler.%s" version; 35 - (* Pin all js_top_worker packages from the repo *) 36 - Printf.sprintf "opam pin add -yn js_top_worker %s#%s" repo branch; 37 - Printf.sprintf "opam pin add -yn js_top_worker-rpc %s#%s" repo branch; 38 - Printf.sprintf "opam pin add -yn js_top_worker-bin %s#%s" repo branch; 39 - Printf.sprintf "opam pin add -yn js_top_worker-web %s#%s" repo branch; 40 - Printf.sprintf "opam pin add -yn js_top_worker_rpc_def %s#%s" repo branch; 35 + (* Pin all js_top_worker packages from the repo. 36 + Use git+ prefix so opam treats it as a git repo, not an archive. *) 37 + Printf.sprintf "opam pin add -yn js_top_worker git+%s#%s" repo branch; 38 + Printf.sprintf "opam pin add -yn js_top_worker-rpc git+%s#%s" repo branch; 39 + Printf.sprintf "opam pin add -yn js_top_worker-bin git+%s#%s" repo branch; 40 + Printf.sprintf "opam pin add -yn js_top_worker-web git+%s#%s" repo branch; 41 + Printf.sprintf "opam pin add -yn js_top_worker_rpc_def git+%s#%s" repo branch; 41 42 (* Install js_of_ocaml, jtw CLI, and web worker library *) 42 43 "opam install -y js_of_ocaml js_top_worker-bin js_top_worker-web"; 43 44 (* Verify tools are installed *)
+4 -2
bin/linux.ml
··· 711 711 let result = Os.sudo ~stdout:build_log ~stderr:build_log [ "runc"; "run"; "-b"; temp_dir; container_id ] in 712 712 let _ = Os.sudo ~stdout:"/dev/null" ~stderr:"/dev/null" [ "runc"; "delete"; "-f"; container_id ] in 713 713 let _ = Os.sudo ~stderr:"/dev/null" [ "umount"; rootfsdir ] in 714 - (* Copy output from container to jtw layer *) 715 - let jtw_output_lib = Path.(jtw_output_host / "lib") in 714 + (* Copy output from container to jtw layer. 715 + jtw opam --path <pkg> writes to <output>/<pkg>/lib/, so look there. *) 716 + let pkg_name = OpamPackage.name_to_string pkg in 717 + let jtw_output_lib = Path.(jtw_output_host / pkg_name / "lib") in 716 718 if Sys.file_exists jtw_output_lib then begin 717 719 let jtw_layer_lib = Path.(jtw_layer_dir / "lib") in 718 720 Os.mkdir ~parents:true (Filename.dirname jtw_layer_lib);
+4 -4
bin/main.ml
··· 1433 1433 Arg.(value & opt string "master" & info [ "doc-tools-branch" ] ~docv:"BRANCH" ~doc) 1434 1434 1435 1435 let jtw_tools_repo_term = 1436 - let doc = "Git repository for js_top_worker tools (default: https://github.com/jonnyfiveisonline/js_top_worker.git)" in 1437 - Arg.(value & opt string "https://github.com/jonnyfiveisonline/js_top_worker.git" & info [ "jtw-tools-repo" ] ~docv:"URL" ~doc) 1436 + let doc = "Git repository for js_top_worker tools (default: https://tangled.org/jon.recoil.org/js_top_worker)" in 1437 + Arg.(value & opt string "https://tangled.org/jon.recoil.org/js_top_worker" & info [ "jtw-tools-repo" ] ~docv:"URL" ~doc) 1438 1438 1439 1439 let jtw_tools_branch_term = 1440 - let doc = "Git branch for js_top_worker tools (default: enhancements)" in 1441 - Arg.(value & opt string "enhancements" & info [ "jtw-tools-branch" ] ~docv:"BRANCH" ~doc) 1440 + let doc = "Git branch for js_top_worker tools (default: main)" in 1441 + Arg.(value & opt string "main" & info [ "jtw-tools-branch" ] ~docv:"BRANCH" ~doc) 1442 1442 1443 1443 let html_output_term = 1444 1444 let doc = "Shared HTML output directory for all documentation (enables doc generation for all packages)" in