Skip to content

Commit a2b4a46

Browse files
committed
Make repl.js more reliable with missing .mli files
1 parent b472bce commit a2b4a46

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/repl.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,15 @@ function prepare(isDev, targetCompilerFile) {
6464
? ["development", "-g ", "--pretty "]
6565
: ["production", "", ""];
6666
console.log(`building byte code version of the compiler [${env}]`);
67+
68+
const mliFile = path.join(sourceDir, targetCompilerFile + ".mli")
69+
const mlFile = path.join(sourceDir, targetCompilerFile + ".ml")
70+
71+
// There may be a situation where the .mli file doesn't exist (mostly when
72+
// the snapshot hasn't been checked into `lib/4.06.1/unstable`
73+
e(`touch ${mliFile}`)
6774
e(
68-
`${OCAMLC} ${ocamlFlag}-w -30-40 -no-check-prims -I ${sourceDir} ${sourceDir}/${targetCompilerFile}.mli ${sourceDir}/${targetCompilerFile}.ml -o jsc.byte `
75+
`${OCAMLC} ${ocamlFlag}-w -30-40 -no-check-prims -I ${sourceDir} ${mliFile} ${mlFile} -o jsc.byte `
6976
);
7077
console.log("building js version");
7178
e(`${JSOO} compile jsc.byte ${jsooFlag}-o exports.js`);

0 commit comments

Comments
 (0)