From 9aeac1e8a0b4b7851752941dbd17a60d3d0f76d6 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Mon, 7 Jul 2025 14:58:55 +0200 Subject: [PATCH 1/5] Tests: add a test demonstrating shapes loading cross-library --- compiler/tests-full/dune | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/tests-full/dune b/compiler/tests-full/dune index b07e4076cf..343920d152 100644 --- a/compiler/tests-full/dune +++ b/compiler/tests-full/dune @@ -48,6 +48,7 @@ (action (run %{bin:js_of_ocaml} + --load-shape %{dep:stdlib.cma.js} --pretty --debuginfo %{dep:shapes.cma} From 7460f5401139c27075b36abf7459b6759179aa9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Mon, 7 Jul 2025 13:57:02 +0200 Subject: [PATCH 2/5] Compiler: Fix shape loading --- compiler/lib/shape.ml | 2 +- compiler/tests-full/shapes.cma.expected.js | 16 +++------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/compiler/lib/shape.ml b/compiler/lib/shape.ml index 9337f46819..4a35bf87c2 100644 --- a/compiler/lib/shape.ml +++ b/compiler/lib/shape.ml @@ -139,7 +139,7 @@ module Store = struct let load' fn = let l = file_lines_bin fn in List.iter l ~f:(fun s -> - match String.drop_prefix ~prefix:"//#shape: " s with + match String.drop_prefix ~prefix:"//# shape: " s with | None -> () | Some name_n_shape -> ( match String.lsplit2 name_n_shape ~on:':' with diff --git a/compiler/tests-full/shapes.cma.expected.js b/compiler/tests-full/shapes.cma.expected.js index 736bf99039..39f52b2d9f 100644 --- a/compiler/tests-full/shapes.cma.expected.js +++ b/compiler/tests-full/shapes.cma.expected.js @@ -31,18 +31,13 @@ (function (globalThis){ "use strict"; - var runtime = globalThis.jsoo_runtime; - function caml_call1(f, a0){ - return (f.l >= 0 ? f.l : f.l = f.length) === 1 - ? f(a0) - : runtime.caml_call_gen(f, [a0]); - } var + runtime = globalThis.jsoo_runtime, global_data = runtime.caml_get_global_data(), cst = "", Stdlib = global_data.Stdlib; function f(param){ - /*<>*/ return caml_call1(Stdlib[46], cst) /*<>*/ ; + /*<>*/ return Stdlib[46].call(null, cst) /*<>*/ ; } var Shapes_M2 = /*<>*/ [0, f]; runtime.caml_register_global(2, Shapes_M2, "Shapes__M2"); @@ -57,11 +52,6 @@ (globalThis){ "use strict"; var runtime = globalThis.jsoo_runtime; - function caml_call1(f, a0){ - return (f.l >= 0 ? f.l : f.l = f.length) === 1 - ? f(a0) - : runtime.caml_call_gen(f, [a0]); - } function caml_call2(f, a0, a1){ return (f.l >= 0 ? f.l : f.l = f.length) === 2 ? f(a0, a1) @@ -74,7 +64,7 @@ Shapes_M1 = global_data.Shapes__M1; function f(param){ /*<>*/ return 1 - < caml_call1(Stdlib_Random[5], 2) + < Stdlib_Random[5].call(null, 2) ? Shapes_M1[1] : function (a, param){ From 2038a0a8416c89b5769aa49a993f9e4f128117b0 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Mon, 7 Jul 2025 14:42:45 +0200 Subject: [PATCH 3/5] Changes --- CHANGES.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index f117610bf8..d9f2b49285 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,8 @@ +# 6.1.dev + +## Bug fixes +* Compiler: Fix shape loading (#2074) + # 6.1.0 (2025-07-01) - Lille ## Features/Changes From 8354e230cf2cd861f7ed4f105e50dcf6b8ff35d3 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Mon, 7 Jul 2025 14:48:33 +0200 Subject: [PATCH 4/5] Examples: load shapes in separate compilation example --- examples/separate_compilation/dune | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/examples/separate_compilation/dune b/examples/separate_compilation/dune index 0874fa21fd..d31a2fe641 100644 --- a/examples/separate_compilation/dune +++ b/examples/separate_compilation/dune @@ -29,6 +29,8 @@ (action (run %{bin:js_of_ocaml} + --load-shape + %{dep:stdlib.cma.js} --pretty --source-map %{dep:lib1.cma} @@ -40,6 +42,8 @@ (action (run %{bin:js_of_ocaml} + --load-shape + %{dep:stdlib.cma.js} --pretty --source-map %{dep:module1.cmo} @@ -51,6 +55,12 @@ (action (run %{bin:js_of_ocaml} + --load-shape + %{dep:stdlib.cma.js} + --load-shape + %{dep:lib1.cma.js} + --load-shape + %{dep:module1.js} --pretty --source-map %{dep:module2.cmo} @@ -73,6 +83,8 @@ (action (run %{bin:js_of_ocaml} + --load-shape + %{dep:stdlib.cma.js} --pretty --source-map %{lib:stdlib:std_exit.cmo} From 104e924016a22ed91495fc776eba035b4dfca6f7 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Mon, 7 Jul 2025 15:04:26 +0200 Subject: [PATCH 5/5] Bump version --- CHANGES.md | 2 +- VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d9f2b49285..347d786ab6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -# 6.1.dev +# 6.1.1 (2025-07-07) - Lille ## Bug fixes * Compiler: Fix shape loading (#2074) diff --git a/VERSION b/VERSION index dfda3e0b4f..f3b5af39e4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.1.0 +6.1.1