Skip to content

Commit 5fef8d3

Browse files
authored
Remove cmij cache (#6192)
1 parent c04cbba commit 5fef8d3

18 files changed

+152
-305
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@ jobs:
198198
- name: Check for changes in lib folder
199199
run: git diff --exit-code lib/js lib/es6
200200

201+
- name: Populate lib/ocaml
202+
run: ./scripts/prebuilt.js
203+
201204
- name: Run tests
202205
if: runner.os != 'Windows'
203206
run: node scripts/ciTest.js -all
@@ -207,9 +210,7 @@ jobs:
207210
run: node scripts/ciTest.js -mocha -theme -format
208211

209212
- name: Prepare artifact upload
210-
run: |
211-
./scripts/prebuilt.js
212-
node .github/workflows/get_artifact_info.js
213+
run: node .github/workflows/get_artifact_info.js
213214

214215
- name: "Upload artifacts: binaries"
215216
uses: actions/upload-artifact@v3
@@ -224,15 +225,6 @@ jobs:
224225
name: lib-ocaml
225226
path: lib/ocaml
226227

227-
- name: "Upload artifacts: cmi cache"
228-
if: runner.os == 'Linux'
229-
uses: actions/upload-artifact@v3
230-
with:
231-
name: cmij-cache
232-
path: |
233-
lib/cmi_cache.bin
234-
lib/cmj_cache.bin
235-
236228
package:
237229
needs: build
238230
runs-on: ubuntu-latest

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ reanalyze:
4848
lib: build node_modules/.bin/semver
4949
node scripts/ninja.js config
5050
node scripts/ninja.js build
51+
./scripts/prebuilt.js
5152

5253
artifacts: lib
53-
./scripts/prebuilt.js
5454
./scripts/makeArtifactList.js
5555

5656
format:

jscomp/cmij/cmij_cache.ml

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

jscomp/cmij/cmij_cache.mli

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

jscomp/cmij/cmij_main.ml

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

jscomp/cmij/cmij_main.mli

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

jscomp/cmij/dune

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
(:standard -ccopt -static))))
55

66
(executables
7-
(names cmij_main cmjdump_main)
8-
(public_names cmij cmjdump)
7+
(names cmjdump_main)
8+
(public_names cmjdump)
99
(flags
1010
(:standard -w +a-4-9-40-42-69))
1111
(libraries core))

jscomp/core/bs_cmi_load.ml

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -22,44 +22,7 @@
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2424

25-
#ifdef RELEASE
26-
(*true *)
27-
28-
let cmi_cache_path =
29-
let ( // ) = Filename.concat in
30-
Filename.dirname Sys.executable_name
31-
// Filename.parent_dir_name // "lib" // "cmi_cache.bin"
32-
33-
let load_cmi_cache () =
34-
let channel = open_in_bin cmi_cache_path in
35-
let cache: Cmij_cache.t = Marshal.from_channel channel in
36-
close_in channel;
37-
cache
38-
39-
let cmi_cache = lazy (load_cmi_cache ())
40-
41-
let load_cmi ~unit_name : Env.Persistent_signature.t option =
42-
match Config_util.find_opt (unit_name ^".cmi") with
43-
| Some filename -> Some {filename; cmi = Cmi_format.read_cmi filename}
44-
| None ->
45-
if !Js_config.no_stdlib then None
46-
else
47-
let {Cmij_cache.module_names; module_data} = Lazy.force cmi_cache in
48-
match Ext_string_array.find_sorted module_names unit_name with
49-
| Some index ->
50-
if !Js_config.diagnose then
51-
Format.fprintf Format.err_formatter ">Cmi: %s@." unit_name;
52-
let cmi = Cmij_cache.unmarshal_cmi_data module_data.(index) in
53-
if !Js_config.diagnose then
54-
Format.fprintf Format.err_formatter "<Cmi: %s@." unit_name;
55-
Some {filename = Sys.executable_name ;
56-
cmi }
57-
| None -> None
58-
59-
#else
60-
6125
let load_cmi ~unit_name : Env.Persistent_signature.t option =
6226
match Config_util.find_opt (unit_name ^".cmi") with
6327
| Some filename -> Some {filename; cmi = Cmi_format.read_cmi filename}
64-
| None -> None
65-
#endif
28+
| None -> None

jscomp/core/dune

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,3 @@
77
(flags
88
(:standard -w +a-4-9-27-30-40-41-42-48-70))
99
(libraries depends frontend gentype js_parser outcome_printer))
10-
11-
; There exist cyclic dependencies between core and frontend, therefore include frontend files here:
12-
13-
(copy_files# ../cmij/cmij_cache.{ml,mli})

jscomp/core/js_cmj_load.ml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,7 @@ let load_unit_with_file unit_name : Js_cmj_format.cmj_load_info =
5252
(* hacking relying on the convention of pkg/lib/ocaml/xx.cmj*)
5353
Filename.dirname (Filename.dirname (Filename.dirname f));
5454
cmj_table = Js_cmj_format.from_file f}
55-
| None ->
56-
if !Js_config.no_stdlib then Bs_exception.error (Cmj_not_found unit_name)
57-
else
58-
#ifdef RELEASE
59-
Js_cmj_load_builtin_unit.load_builin_unit unit_name
60-
#else
61-
Bs_exception.error (Cmj_not_found unit_name)
62-
#endif
63-
55+
| None -> Bs_exception.error (Cmj_not_found unit_name)
6456

6557
(* we can disable loading from file for troubleshooting
6658
Note in dev mode we still allow loading from file is to

jscomp/core/js_cmj_load_builtin_unit.ml

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

jscomp/core/res_compmisc.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ let init_path () =
2727
let exp_dirs =
2828
List.map (Misc.expand_directory Config.standard_library) dirs
2929
in
30-
Config.load_path := List.rev_append exp_dirs [];
30+
Config.load_path := List.rev_append exp_dirs [Config.standard_library];
3131
Env.reset_cache ()
3232

3333
(* Return the initial environment in which compilation proceeds. *)

lib/.gitignore

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

0 commit comments

Comments
 (0)