Skip to content

Commit 8b3a3a4

Browse files
authored
Merge pull request #3835 from ulrikstrid/fix-esy-buildocaml
Fix buildocaml when using esy
2 parents 5d11fb0 + 2c09a59 commit 8b3a3a4

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

scripts/buildocaml.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,26 @@ exports.getVersionPrefix = getVersionPrefix;
5656
function build(config) {
5757
ensureOCamlExistsSync();
5858

59-
var prefix = path.normalize(
60-
path.join(__dirname, "..", "native", getVersionPrefix())
61-
);
62-
if (config) {
59+
var prefix =
60+
process.env.ESY === "true"
61+
? process.env.cur__install
62+
: path.normalize(
63+
path.join(__dirname, "..", "native", getVersionPrefix())
64+
);
65+
if (config && process.env.ESY !== "true") {
6366
cp.execSync(
6467
"./configure -prefix " +
6568
prefix +
6669
" -no-ocamlbuild -no-curses -no-graph -no-pthread -no-debugger && make clean",
67-
{ cwd: path.join(__dirname, "..", "ocaml"), stdio: [0, 1, 2] }
70+
{ cwd: ocamlSrcDir, stdio: [0, 1, 2] }
6871
);
6972
}
70-
cp.execSync("make -j9 world.opt && make install ", {
71-
cwd: path.join(__dirname, "..", "ocaml"),
72-
stdio: [0, 1, 2]
73-
});
73+
if (process.env.ESY !== "true") {
74+
cp.execSync("make -j9 world.opt && make install ", {
75+
cwd: ocamlSrcDir,
76+
stdio: [0, 1, 2]
77+
});
78+
}
7479
}
7580

7681
exports.build = build;

0 commit comments

Comments
 (0)