Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 6.1.1 (2025-07-07) - Lille

## Bug fixes
* Compiler: Fix shape loading (#2074)

# 6.1.0 (2025-07-01) - Lille

## Features/Changes
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.1.0
6.1.1
2 changes: 1 addition & 1 deletion compiler/lib/shape.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions compiler/tests-full/dune
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
(action
(run
%{bin:js_of_ocaml}
--load-shape %{dep:stdlib.cma.js}
--pretty
--debuginfo
%{dep:shapes.cma}
Expand Down
16 changes: 3 additions & 13 deletions compiler/tests-full/shapes.cma.expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -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){
/*<<compiler/tests-full/m2.ml:1:11>>*/ return caml_call1(Stdlib[46], cst) /*<<compiler/tests-full/m2.ml:1:27>>*/ ;
/*<<compiler/tests-full/m2.ml:1:11>>*/ return Stdlib[46].call(null, cst) /*<<compiler/tests-full/m2.ml:1:27>>*/ ;
}
var Shapes_M2 = /*<<?>>*/ [0, f];
runtime.caml_register_global(2, Shapes_M2, "Shapes__M2");
Expand All @@ -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)
Expand All @@ -74,7 +64,7 @@
Shapes_M1 = global_data.Shapes__M1;
function f(param){
/*<<compiler/tests-full/m3.ml:1:14>>*/ return 1
< caml_call1(Stdlib_Random[5], 2)
< Stdlib_Random[5].call(null, 2)
? Shapes_M1[1]
: function
(a, param){
Expand Down
12 changes: 12 additions & 0 deletions examples/separate_compilation/dune
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
(action
(run
%{bin:js_of_ocaml}
--load-shape
%{dep:stdlib.cma.js}
--pretty
--source-map
%{dep:lib1.cma}
Expand All @@ -40,6 +42,8 @@
(action
(run
%{bin:js_of_ocaml}
--load-shape
%{dep:stdlib.cma.js}
--pretty
--source-map
%{dep:module1.cmo}
Expand All @@ -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}
Expand All @@ -73,6 +83,8 @@
(action
(run
%{bin:js_of_ocaml}
--load-shape
%{dep:stdlib.cma.js}
--pretty
--source-map
%{lib:stdlib:std_exit.cmo}
Expand Down
Loading