this repo has no description
0
fork

Configure Feed

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

fix(js_top_worker): OxCaml demo support, exec RPC fix, and dependency cleanup

- Add comprehensive JS stubs for OxCaml-specific primitives (domain TLS,
arch detection, blocking sync, basement/capsule) needed by the OxCaml
js_of_ocaml runtime
- Fix demo.js to load rpc_worker.bc.js (JSON-RPC) instead of the
non-RPC _opam/worker.js, fixing a protocol mismatch bug
- Fix exec RPC method never resolving: rename phrase_p parameter from
~name:"string" to unnamed, preventing rpclib from incorrectly treating
the phrase as a named parameter in the dispatch dict
- Remove unused cbort, zarith, bytesrw dependencies from opam and
dune-project
- Bump dune version in x-ocaml opam files to 3.21 for OxCaml support
- Update cram test expected output for current package list

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

+251 -41
+2 -1
example/demo.js
··· 25 25 function getWorkerURL(baseUrl) { 26 26 // Convert relative URL to absolute - importScripts in blob workers needs absolute URLs 27 27 const absoluteBase = new URL(baseUrl, window.location.href).href; 28 - const content = `globalThis.__global_rel_url="${absoluteBase}"\nimportScripts("${absoluteBase}/worker.js");`; 28 + const workerScript = new URL("rpc_worker.bc.js", window.location.href).href; 29 + const content = `globalThis.__global_rel_url="${absoluteBase}"\nimportScripts("${workerScript}");`; 29 30 return URL.createObjectURL(new Blob([content], { type: "text/javascript" })); 30 31 } 31 32
+1 -1
idl/toplevel_api.ml
··· 229 229 230 230 let implementation = implement description 231 231 let unit_p = Param.mk Types.unit 232 - let phrase_p = Param.mk ~name:"string" ~description:["The OCaml phrase to execute"] Types.string 232 + let phrase_p = Param.mk ~description:["The OCaml phrase to execute"] Types.string 233 233 let id_p = Param.mk opt_id 234 234 let env_id_p = Param.mk ~name:"env_id" ~description:["Environment ID (empty string for default)"] env_id 235 235 let env_id_list_p = Param.mk env_id_list
+1 -2
idl/toplevel_api_gen.ml
··· 2218 2218 let implementation = implement description 2219 2219 let unit_p = Param.mk Types.unit 2220 2220 let phrase_p = 2221 - Param.mk ~name:"string" ~description:["The OCaml phrase to execute"] 2222 - Types.string 2221 + Param.mk ~description:["The OCaml phrase to execute"] Types.string 2223 2222 let id_p = Param.mk opt_id 2224 2223 let env_id_p = 2225 2224 Param.mk ~name:"env_id"
-4
js_top_worker-rpc.opam
··· 12 12 "rresult" 13 13 "merlin-lib" 14 14 "rpclib" 15 - "cbort" 16 - "zarith" 17 - "bytesrw" 18 15 "js_of_ocaml" {>= "5.0"} 19 16 "js_of_ocaml-ppx" {>= "5.0"} 20 17 ] ··· 28 25 """ 29 26 pin-depends: [ 30 27 [ "mime_printer.dev" "git+https://github.com/jonludlam/mime_printer.git#odoc_notebook" ] 31 - [ "cbort.dev" "git+https://tangled.org/@anil.recoil.org/ocaml-cbort.git" ] 32 28 ]
+91
lib/stubs.js
··· 23 23 return 0 24 24 } 25 25 26 + //Provides: caml_sys_const_arch_amd64 const 27 + function caml_sys_const_arch_amd64() { 28 + return 1 29 + } 30 + 31 + //Provides: caml_sys_const_arch_arm64 const 32 + function caml_sys_const_arch_arm64() { 33 + return 0 34 + } 35 + 36 + // OxCaml domain TLS - single-domain JS environment, just use a global 37 + var _tls_state = 0; 38 + //Provides: caml_domain_tls_get 39 + function caml_domain_tls_get() { 40 + return _tls_state; 41 + } 42 + 43 + //Provides: caml_domain_tls_set 44 + function caml_domain_tls_set(v) { 45 + _tls_state = v; 46 + return 0; 47 + } 48 + 49 + //Provides: caml_ml_domain_index 50 + function caml_ml_domain_index() { 51 + return 0; 52 + } 53 + 54 + //Provides: caml_make_local_vect 55 + //Requires: caml_make_vect 56 + function caml_make_local_vect(len, init) { 57 + return caml_make_vect(len, init); 58 + } 59 + 60 + // OxCaml blocking sync primitives - no-ops in single-threaded JS 61 + //Provides: caml_blocking_mutex_new 62 + function caml_blocking_mutex_new() { 63 + return 0; 64 + } 65 + 66 + //Provides: caml_blocking_mutex_lock 67 + function caml_blocking_mutex_lock(_m) { 68 + return 0; 69 + } 70 + 71 + //Provides: caml_blocking_mutex_unlock 72 + function caml_blocking_mutex_unlock(_m) { 73 + return 0; 74 + } 75 + 76 + //Provides: caml_blocking_condition_new 77 + function caml_blocking_condition_new() { 78 + return 0; 79 + } 80 + 81 + //Provides: caml_blocking_condition_wait 82 + function caml_blocking_condition_wait(_c, _m) { 83 + return 0; 84 + } 85 + 86 + //Provides: caml_blocking_condition_signal 87 + function caml_blocking_condition_signal(_c) { 88 + return 0; 89 + } 90 + 91 + //Provides: caml_thread_yield 92 + function caml_thread_yield() { 93 + return 0; 94 + } 95 + 96 + // Basement/capsule primitives - OxCaml specific 97 + //Provides: basement_dynamic_supported 98 + function basement_dynamic_supported() { 99 + return 0; 100 + } 101 + 102 + //Provides: basement_dynamic_make 103 + function basement_dynamic_make(_v) { 104 + return _v; 105 + } 106 + 107 + //Provides: basement_dynamic_get 108 + function basement_dynamic_get(_v) { 109 + return _v; 110 + } 111 + 112 + //Provides: basement_alloc_stack_bind 113 + function basement_alloc_stack_bind(_stack, _f, _v) { 114 + return 0; 115 + } 116 +
+156 -33
test/cram/directives.t/run.t
··· 494 494 495 495 $ unix_client exec_toplevel '' '# #list;;' 496 496 {mime_vals:[];parts:[];script:S(# #list;; 497 + 0install-solver (version: 2.18) 497 498 angstrom (version: 0.16.1) 498 499 angstrom.async (version: n/a) 499 500 angstrom.lwt-unix (version: n/a) 500 501 angstrom.unix (version: n/a) 502 + asn1-combinators (version: 0.3.2) 501 503 astring (version: 0.8.5) 502 504 astring.top (version: 0.8.5) 503 505 base (version: v0.17.3) ··· 506 508 base.shadow_stdlib (version: v0.17.3) 507 509 base64 (version: 3.5.2) 508 510 base64.rfc2045 (version: 3.5.2) 511 + bigarray-compat (version: 1.1.0) 509 512 bigstringaf (version: 0.10.0) 510 513 bos (version: 0.2.1) 511 514 bos.setup (version: 0.2.1) ··· 515 518 brr.ocaml_poke_ui (version: 0.0.8) 516 519 brr.poke (version: 0.0.8) 517 520 brr.poked (version: 0.0.8) 521 + bstr (version: 0.0.4) 518 522 bytes (version: [distributed with OCaml 4.02 or above]) 519 - bytesrw (version: 0.3.0) 520 - bytesrw.sysrandom (version: 0.3.0) 521 - bytesrw.unix (version: 0.3.0) 523 + bytesrw (version: 0.2.0) 524 + bytesrw.unix (version: 0.2.0) 525 + ca-certs (version: v1.0.1) 522 526 camlp-streams (version: n/a) 523 - cbort (version: 2b102ae) 524 - chrome-trace (version: 1.6.2-12057-g12f9ecb) 525 - cmdliner (version: 2.1.0) 527 + caqti (version: v2.2.4) 528 + caqti-lwt (version: v2.2.4) 529 + caqti-lwt.unix (version: v2.2.4) 530 + caqti.blocking (version: v2.2.4) 531 + caqti.platform (version: v2.2.4) 532 + caqti.platform.unix (version: v2.2.4) 533 + caqti.plugin (version: v2.2.4) 534 + caqti.template (version: v2.2.4) 535 + checkseum (version: 0.5.2) 536 + checkseum.c (version: 0.5.2) 537 + checkseum.ocaml (version: 0.5.2) 538 + chrome-trace (version: 3.21.0) 539 + cmdliner (version: 1.3.0) 526 540 compiler-libs (version: 5.4.0) 527 541 compiler-libs.bytecomp (version: 5.4.0) 528 542 compiler-libs.common (version: 5.4.0) ··· 530 544 compiler-libs.optcomp (version: 5.4.0) 531 545 compiler-libs.toplevel (version: 5.4.0) 532 546 cppo (version: n/a) 547 + crunch (version: 4.0.0) 533 548 csexp (version: 1.5.2) 534 549 cstruct (version: 6.2.0) 550 + decompress (version: n/a) 551 + decompress.de (version: 1.5.3) 552 + decompress.gz (version: 1.5.3) 553 + decompress.lz (version: 1.5.3) 554 + decompress.lzo (version: 1.5.3) 555 + decompress.zl (version: 1.5.3) 556 + digestif (version: 1.3.0) 557 + digestif.c (version: 1.3.0) 558 + digestif.ocaml (version: 1.3.0) 559 + dockerfile (version: n/a) 535 560 domain-local-await (version: 1.0.1) 561 + domain-name (version: 0.5.0) 562 + dream (version: n/a) 563 + dream-httpaf (version: n/a) 564 + dream-pure (version: n/a) 565 + dream.certificate (version: n/a) 566 + dream.cipher (version: n/a) 567 + dream.graphiql (version: n/a) 568 + dream.graphql (version: n/a) 569 + dream.http (version: n/a) 570 + dream.server (version: n/a) 571 + dream.sql (version: n/a) 572 + dream.unix (version: n/a) 536 573 dune (version: n/a) 537 - dune-action-plugin (version: 1.6.2-12057-g12f9ecb) 538 - dune-build-info (version: 1.6.2-12057-g12f9ecb) 539 - dune-configurator (version: 1.6.2-12057-g12f9ecb) 540 - dune-glob (version: 1.6.2-12057-g12f9ecb) 574 + dune-action-plugin (version: 3.21.0) 575 + dune-build-info (version: 3.21.0) 576 + dune-configurator (version: 3.21.0) 577 + dune-glob (version: 3.21.0) 541 578 dune-private-libs (version: n/a) 542 - dune-private-libs.dune-section (version: 1.6.2-12057-g12f9ecb) 543 - dune-private-libs.meta_parser (version: 1.6.2-12057-g12f9ecb) 544 - dune-rpc (version: 1.6.2-12057-g12f9ecb) 545 - dune-rpc-lwt (version: 1.6.2-12057-g12f9ecb) 546 - dune-rpc.private (version: 1.6.2-12057-g12f9ecb) 547 - dune-site (version: 1.6.2-12057-g12f9ecb) 548 - dune-site.dynlink (version: 1.6.2-12057-g12f9ecb) 549 - dune-site.linker (version: 1.6.2-12057-g12f9ecb) 550 - dune-site.plugins (version: 1.6.2-12057-g12f9ecb) 551 - dune-site.private (version: 1.6.2-12057-g12f9ecb) 552 - dune-site.toplevel (version: 1.6.2-12057-g12f9ecb) 579 + dune-private-libs.dune-section (version: 3.21.0) 580 + dune-private-libs.meta_parser (version: 3.21.0) 581 + dune-rpc (version: 3.21.0) 582 + dune-rpc-lwt (version: 3.21.0) 583 + dune-rpc.private (version: 3.21.0) 584 + dune-site (version: 3.21.0) 585 + dune-site.dynlink (version: 3.21.0) 586 + dune-site.linker (version: 3.21.0) 587 + dune-site.plugins (version: 3.21.0) 588 + dune-site.private (version: 3.21.0) 589 + dune-site.toplevel (version: 3.21.0) 553 590 dune.configurator (version: n/a) 554 - dyn (version: 1.6.2-12057-g12f9ecb) 591 + duration (version: 0.2.1) 592 + dyn (version: 3.21.0) 555 593 dynlink (version: 5.4.0) 556 594 eio (version: n/a) 557 595 eio.core (version: n/a) ··· 563 601 eio_main (version: n/a) 564 602 eio_posix (version: n/a) 565 603 either (version: 1.0.0) 604 + eqaf (version: 0.10) 605 + eqaf.bigstring (version: 0.10) 606 + eqaf.bytes (version: 0.10) 607 + faraday (version: 0.8.2) 608 + faraday-lwt (version: 0.8.2) 609 + faraday-lwt-unix (version: 0.8.2) 610 + faraday.async (version: n/a) 611 + faraday.lwt (version: n/a) 612 + faraday.lwt-unix (version: n/a) 613 + fiber (version: 3.7.0) 566 614 findlib (version: 1.9.8) 567 615 findlib.dynload (version: 1.9.8) 568 616 findlib.internal (version: 1.9.8) ··· 574 622 fmt.tty (version: 0.11.0) 575 623 fpath (version: 0.7.3) 576 624 fpath.top (version: 0.7.3) 577 - fs-io (version: 1.6.2-12057-g12f9ecb) 625 + fs-io (version: 3.21.0) 578 626 gen (version: 1.1) 627 + gluten (version: 0.5.2) 628 + gluten-lwt (version: 0.5.2) 629 + gluten-lwt-unix (version: 0.5.2) 630 + gmap (version: 0.3.0) 631 + graphql (version: 0.14.0) 632 + graphql-lwt (version: 0.14.0) 633 + graphql_parser (version: 0.14.0) 634 + h2 (version: 0.10.0) 635 + h2-lwt (version: 0.10.0) 636 + h2-lwt-unix (version: 0.10.0) 579 637 hmap (version: 0.8.1) 638 + hpack (version: 0.12.0-6-g49c0591) 639 + httpaf (version: 0.7.1) 640 + httpun (version: 0.1.0) 641 + httpun-lwt (version: 0.1.0) 642 + httpun-lwt-unix (version: 0.1.0) 643 + httpun-types (version: 0.1.0) 644 + httpun-ws (version: 0.2.0) 580 645 iomux (version: v0.4) 646 + ipaddr (version: 5.6.1) 647 + ipaddr.top (version: 5.6.1) 648 + ipaddr.unix (version: 5.6.1) 581 649 jane-street-headers (version: v0.17.0) 582 650 js_of_ocaml (version: 6.2.0) 583 651 js_of_ocaml-compiler (version: 6.2.0) ··· 600 668 js_top_worker-unix (version: n/a) 601 669 js_top_worker-web (version: 0.0.1) 602 670 js_top_worker_rpc_def (version: n/a) 603 - js_top_worker_rpc_def.__private__ (version: n/a) 604 - js_top_worker_rpc_def.__private__.js_top_worker_rpc_def (version: 0.0.1) 605 671 jsonm (version: 1.0.2) 672 + jsonrpc (version: 1.25.0) 673 + jsont (version: 0.2.0) 674 + jsont.brr (version: 0.2.0) 675 + jsont.bytesrw (version: 0.2.0) 606 676 jst-config (version: v0.17.0) 677 + kdf (version: n/a) 678 + kdf.hkdf (version: 1.0.0) 679 + kdf.pbkdf (version: 1.0.0) 680 + kdf.scrypt (version: 1.0.0) 681 + ke (version: 0.6) 682 + lambdasoup (version: n/a) 607 683 logs (version: 0.10.0) 608 684 logs.browser (version: 0.10.0) 609 685 logs.cli (version: 0.10.0) ··· 611 687 logs.lwt (version: 0.10.0) 612 688 logs.threaded (version: 0.10.0) 613 689 logs.top (version: 0.10.0) 614 - lwt (version: 6.0.0) 690 + lru (version: 0.3.1) 691 + lsp (version: 1.25.0) 692 + lwt (version: 5.9.2) 615 693 lwt-dllist (version: 1.1.0) 616 - lwt.unix (version: 6.0.0) 694 + lwt.unix (version: 5.9.2) 695 + lwt_ppx (version: 5.9.3) 696 + lwt_ssl (version: 1.2.0) 697 + macaddr (version: 5.6.1) 698 + macaddr.top (version: 5.6.1) 699 + magic-mime (version: 1.3.1) 700 + markup (version: n/a) 617 701 menhir (version: n/a) 618 702 menhirCST (version: 20260122) 619 703 menhirGLR (version: 20260122) ··· 638 722 merlin-lib.query_protocol (version: 5.6.1-504) 639 723 merlin-lib.sherlodoc (version: 5.6.1-504) 640 724 merlin-lib.utils (version: 5.6.1-504) 641 - mime_printer (version: e46cb08) 725 + mime_printer (version: 0.0.1) 726 + mirage-clock (version: 4.2.0) 727 + mirage-crypto (version: 1.2.0) 728 + mirage-crypto-ec (version: 1.2.0) 729 + mirage-crypto-pk (version: 1.2.0) 730 + mirage-crypto-rng (version: 1.2.0) 731 + mirage-crypto-rng-lwt (version: 1.2.0) 732 + mirage-crypto-rng.unix (version: 1.2.0) 642 733 mtime (version: 2.1.0) 643 734 mtime.clock (version: 2.1.0) 644 735 mtime.clock.os (version: 2.1.0) 645 736 mtime.top (version: 2.1.0) 737 + multipart_form (version: 0.7.0) 738 + multipart_form-lwt (version: 0.7.0) 646 739 ocaml-compiler-libs (version: n/a) 647 740 ocaml-compiler-libs.bytecomp (version: v0.17.0) 648 741 ocaml-compiler-libs.common (version: v0.17.0) 649 742 ocaml-compiler-libs.optcomp (version: v0.17.0) 650 743 ocaml-compiler-libs.shadow (version: v0.17.0) 651 744 ocaml-compiler-libs.toplevel (version: v0.17.0) 745 + ocaml-index (version: n/a) 746 + ocaml-lsp-server (version: n/a) 652 747 ocaml-syntax-shims (version: n/a) 653 748 ocaml-version (version: n/a) 654 749 ocaml_intrinsics_kernel (version: v0.17.1) 655 750 ocamlbuild (version: 0.16.1) 656 - ocamlc-loc (version: 1.6.2-12057-g12f9ecb) 751 + ocamlc-loc (version: 3.21.0) 657 752 ocamldoc (version: 5.4.0) 658 753 ocamlformat-lib (version: 0.28.1) 659 754 ocamlformat-lib.format_ (version: 0.28.1) ··· 664 759 ocamlformat-lib.parser_shims (version: 0.28.1) 665 760 ocamlformat-lib.parser_standard (version: 0.28.1) 666 761 ocamlformat-lib.stdlib_shims (version: 0.28.1) 762 + ocamlformat-rpc-lib (version: 0.28.1) 667 763 ocamlgraph (version: 2.2.0) 668 764 ocp-indent (version: n/a) 669 765 ocp-indent.dynlink (version: 1.9.0) ··· 672 768 ocp-indent.utils (version: 1.9.0) 673 769 ocplib-endian (version: n/a) 674 770 ocplib-endian.bigstring (version: n/a) 771 + ohex (version: n/a) 772 + opam-0install (version: 0.4.2) 675 773 opam-core (version: n/a) 676 774 opam-core.cmdliner (version: n/a) 677 775 opam-file-format (version: 2.2.0) 678 776 opam-format (version: n/a) 777 + opam-repository (version: n/a) 778 + opam-state (version: n/a) 679 779 optint (version: 0.3.0) 680 - ordering (version: 1.6.2-12057-g12f9ecb) 780 + ordering (version: 3.21.0) 781 + parsexp (version: v0.17.0) 681 782 patch (version: 3.1.0) 783 + pecu (version: 0.7) 682 784 pp (version: 2.0.0) 683 785 ppx_assert (version: v0.17.0) 684 786 ppx_assert.runtime-lib (version: v0.17.0) ··· 703 805 ppx_deriving.show (version: 6.1.1) 704 806 ppx_deriving.std (version: 6.1.1) 705 807 ppx_deriving_rpc (version: 10.0.0) 808 + ppx_deriving_yojson (version: 3.10.0) 809 + ppx_deriving_yojson.runtime (version: 3.10.0) 706 810 ppx_enumerate (version: v0.17.0) 707 811 ppx_enumerate.runtime-lib (version: v0.17.0) 708 812 ppx_expect (version: v0.17.3) ··· 729 833 ppx_sexp_conv (version: v0.17.1) 730 834 ppx_sexp_conv.expander (version: v0.17.1) 731 835 ppx_sexp_conv.runtime-lib (version: v0.17.1) 836 + ppx_yojson_conv_lib (version: v0.17.0) 732 837 ppxlib (version: 0.37.0) 733 838 ppxlib.__private__ (version: n/a) 734 839 ppxlib.__private__.ppx_foo_deriver (version: 0.37.0) ··· 743 848 ppxlib.traverse (version: 0.37.0) 744 849 ppxlib.traverse_builtins (version: 0.37.0) 745 850 ppxlib_jane (version: v0.17.4) 851 + prettym (version: 0.0.4) 746 852 psq (version: 0.2.1) 853 + ptime (version: 1.2.0) 854 + ptime.clock (version: 1.2.0) 855 + ptime.clock.os (version: 1.2.0) 856 + ptime.top (version: 1.2.0) 747 857 re (version: n/a) 748 858 re.emacs (version: n/a) 749 859 re.glob (version: n/a) ··· 769 879 seq (version: [distributed with OCaml 4.07 or above]) 770 880 sexplib0 (version: v0.17.0) 771 881 sha (version: v1.15.4) 882 + spawn (version: v0.17.0) 883 + spdx_licenses (version: 1.4.0) 884 + ssl (version: 0.7.0) 772 885 stdio (version: v0.17.0) 773 886 stdlib (version: 5.4.0) 774 887 stdlib-shims (version: 0.3.0) 775 - stdune (version: 1.6.2-12057-g12f9ecb) 888 + stdune (version: 3.21.0) 776 889 str (version: 5.4.0) 777 890 stringext (version: 1.6.0) 778 891 swhid_core (version: n/a) ··· 780 893 threads (version: 5.4.0) 781 894 threads.posix (version: [internal]) 782 895 time_now (version: v0.17.0) 783 - top-closure (version: 1.6.2-12057-g12f9ecb) 896 + tls (version: 2.0.3) 897 + tls-eio (version: 2.0.3) 898 + tls.unix (version: 2.0.3) 899 + top-closure (version: 3.21.0) 784 900 topkg (version: 1.1.1) 785 901 tyxml (version: 4.6.0) 786 902 tyxml.functor (version: 4.6.0) 903 + uchar (version: distributed with OCaml 4.03 or above) 787 904 unix (version: 5.4.0) 905 + unstrctrd (version: 0.4) 906 + unstrctrd.parser (version: 0.4) 788 907 uri (version: 4.4.0) 789 908 uri.services (version: 4.4.0) 790 909 uri.services_full (version: 4.4.0) 791 910 uring (version: v2.7.0) 792 911 uucp (version: 17.0.0) 912 + uunf (version: 17.0.0) 913 + uunf.string (version: 17.0.0) 793 914 uuseg (version: 17.0.0) 794 915 uuseg.string (version: 17.0.0) 795 916 uutf (version: 1.0.4) 796 - xdg (version: 1.6.2-12057-g12f9ecb) 917 + x509 (version: 1.0.6) 918 + xdg (version: 3.21.0) 919 + xdge (version: v1.0.0) 797 920 xmlm (version: 1.4.0) 798 921 yojson (version: 3.0.0) 799 922 zarith (version: 1.14)