Skip to content

Commit 57c44b2

Browse files
committed
Scripts/vendored stuff cleanup
1 parent d19b31e commit 57c44b2

File tree

11 files changed

+20
-138
lines changed

11 files changed

+20
-138
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,6 @@ jobs:
153153
- name: Move artifacts
154154
run: ./scripts/moveArtifacts.sh
155155

156-
- name: Create ninja.tar.gz
157-
run: git -C ninja archive --format=tar.gz HEAD -o ../vendor/ninja.tar.gz
158-
159156
- name: Check artifact list
160157
run: node ./scripts/makeArtifactList.js -check
161158

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ ReScript is licensed under LGPL version 3, with relaxed rules about creating and
103103

104104
The ReScript parser (subdirectory `res_syntax`) is licensed under the [MIT License](res_syntax/LICENSE).
105105

106-
`vendor/ocaml.tar.gz` contains the official [OCaml](https://ocaml.org) compiler (version 4.14.0).
107-
Refer to its copyright and license notices for information about its licensing.
108-
109106
The `ninja` subdirectory contains the vendored [ninja](https://github.com/ninja-build/ninja) build system.
110107
Refer to its copyright and license notices for information about its licensing.
111108

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@
3838
"docs/docson/build-schema.json",
3939
"jscomp/stubs/ext_basic_hash_stubs.c",
4040
"lib",
41-
"scripts",
42-
"vendor/ninja.tar.gz",
43-
"vendor/ocaml.tar.gz"
41+
"scripts"
4442
],
4543
"repository": {
4644
"type": "git",

packages/artifacts.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -950,16 +950,13 @@ package.json
950950
rescript
951951
scripts/bin_path.js
952952
scripts/buildNinjaBinary.js
953-
scripts/buildocaml.js
954953
scripts/config.js
955954
scripts/install.js
956955
scripts/installUtils.js
957956
scripts/rescript_arg.js
958957
scripts/rescript_convert.js
959958
scripts/rescript_dump.js
960959
scripts/rescript_format.js
961-
vendor/ninja.tar.gz
962-
vendor/ocaml.tar.gz
963960
win32/bsb_helper.exe
964961
win32/bsc.exe
965962
win32/ninja.exe

scripts/.npmignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
*
44
!bin_path.js
55
!buildNinjaBinary.js
6-
!buildocaml.js
76
!config.js
87
!install.js
98
!installUtils.js

scripts/buildocaml.js

Lines changed: 0 additions & 102 deletions
This file was deleted.

scripts/ciTest.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,23 @@ if (all) {
4141
formatTest = true;
4242
}
4343

44+
function checkOCamlCompilerAvailable() {
45+
try {
46+
var o = cp.execSync(`ocamlopt.opt -version`, {
47+
encoding: "utf-8",
48+
});
49+
console.log("checking env compiler");
50+
console.log(o);
51+
return true;
52+
} catch (e) {
53+
console.log(e);
54+
return false;
55+
}
56+
}
57+
4458
function init() {
45-
if (!require("./buildocaml.js").checkEnvCompiler()) {
46-
// No compiler available on path.
47-
// Assume that we built the compiler from source beforehand and add it to the path.
48-
var vendorOCamlPath = path.join(
49-
__dirname,
50-
"..",
51-
"native",
52-
require("./buildocaml.js").getVersionPrefix(),
53-
"bin"
54-
);
55-
56-
process.env["PATH"] =
57-
vendorOCamlPath + path.delimiter + process.env["PATH"];
59+
if (!checkOCamlCompilerAvailable()) {
60+
throw new Error("OCaml compiler not found on path");
5861
}
5962

6063
var ninjaPath = require("./bin_path").ninja_exe;

scripts/install.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ var supported_os = ["darwin", "freebsd", "linux", "openbsd", "win32"];
2222
if (supported_os.indexOf(process.platform) < 0) {
2323
throw new Error("Not supported platform" + process.platform);
2424
}
25-
var is_windows = process.platform === "win32";
2625

2726
var bsc_exe = require("./bin_path").bsc_exe;
2827

29-
var ninja_bin_filename = process.platform === "win32" ? "ninja.exe" : "ninja";
3028
var ninja_bin_output = require("./bin_path").ninja_exe;
3129

3230
var force_lib_rebuild = process.argv.includes("-force-lib-rebuild");

scripts/makeArtifactList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function getFilesAddedByCI() {
4949
const platforms = ["darwin", "darwinarm64", "linux", "win32"];
5050
const exes = ["bsb_helper.exe", "bsc.exe", "ninja.exe", "rescript.exe"];
5151

52-
const files = ["ninja.COPYING", "vendor/ninja.tar.gz"];
52+
const files = ["ninja.COPYING"];
5353

5454
for (let platform of platforms) {
5555
for (let exe of exes) {

scripts/ninja.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,8 @@ var getVersionString = () => {
100100
.substring(output.indexOf(searcher) + searcher.length)
101101
.trim();
102102
} catch (err) {
103-
//
104-
console.error(`This error probably came from that you don't have our vendored ocaml installed
105-
If this is the first time you clone the repo
106-
try this
107-
git submodule init && git submodule update
108-
node ./scripts/buildocaml.js
109-
`);
103+
console.error(`This error probably came from that you don't have OCaml installed.
104+
Make sure you have the OCaml compiler available in your path.`);
110105
console.error(err.message);
111106
process.exit(err.status);
112107
}

0 commit comments

Comments
 (0)