Skip to content

Commit 2bdf271

Browse files
authored
Merge pull request #1023 from bloomberg/bump
bump version and address #1019
2 parents dc18e61 + 801ac08 commit 2bdf271

File tree

14 files changed

+41
-23
lines changed

14 files changed

+41
-23
lines changed

jscomp/bin/bsb.ml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7560,9 +7560,11 @@ let bs_file_groups = ref []
75607560

75617561
let sourcedirs_meta = ".sourcedirs"
75627562
let merlin = ".merlin"
7563-
let merlin_header = "\n####{BSB GENERATED: NO EDIT\n"
7564-
let merlin_trailer = "\n####BSB GENERATED: NO EDIT}\n"
7563+
let merlin_header = "####{BSB GENERATED: NO EDIT"
7564+
let merlin_trailer = "####BSB GENERATED: NO EDIT}"
75657565
let merlin_trailer_length = String.length merlin_trailer
7566+
7567+
(** [new_content] should start end finish with newline *)
75667568
let revise_merlin new_content =
75677569
if Sys.file_exists merlin then
75687570
let merlin_chan = open_in_bin merlin in
@@ -7572,27 +7574,33 @@ let revise_merlin new_content =
75727574

75737575
let header = Ext_string.find s ~sub:merlin_header in
75747576
let tail = Ext_string.find s ~sub:merlin_trailer in
7575-
if header < 0 && tail < 0 then
7577+
if header < 0 && tail < 0 then (* locked region not added yet *)
75767578
let ochan = open_out_bin merlin in
75777579
output_string ochan s ;
7580+
output_string ochan "\n";
75787581
output_string ochan merlin_header;
75797582
Buffer.output_buffer ochan new_content;
75807583
output_string ochan merlin_trailer ;
7584+
output_string ochan "\n";
75817585
close_out ochan
7582-
else if header >=0 && tail >= 0 then
7586+
else if header >=0 && tail >= 0 then
7587+
(* there is one, hit it everytime,
7588+
should be fixed point
7589+
*)
75837590
let ochan = open_out_bin merlin in
75847591
output_string ochan (String.sub s 0 header) ;
75857592
output_string ochan merlin_header;
75867593
Buffer.output_buffer ochan new_content;
75877594
output_string ochan merlin_trailer ;
75887595
output_string ochan (Ext_string.tail_from s (tail + merlin_trailer_length));
75897596
close_out ochan
7590-
else assert false
7597+
else failwith ("the .merlin is corrupted, locked region by bsb is not consistent ")
75917598
else
75927599
let ochan = open_out_bin merlin in
75937600
output_string ochan merlin_header ;
75947601
Buffer.output_buffer ochan new_content;
75957602
output_string ochan merlin_trailer ;
7603+
output_string ochan "\n";
75967604
close_out ochan
75977605
(*TODO: it is a little mess that [cwd] and [project dir] are shared*)
75987606
(** *)
@@ -7616,11 +7624,12 @@ let write_ninja_file bsc_dir cwd =
76167624
let () =
76177625
Bsb_default.get_ppx_flags ()
76187626
|> List.iter (fun x ->
7619-
Buffer.add_string buffer (Printf.sprintf "FLG -ppx %s\n" x )
7627+
Buffer.add_string buffer (Printf.sprintf "\nFLG -ppx %s" x )
76207628
)
76217629
in
76227630
let () = Buffer.add_string buffer
7623-
(Printf.sprintf "S %s\n\
7631+
(Printf.sprintf "\n\
7632+
S %s\n\
76247633
B %s\n\
76257634
FLG -ppx %s\n\
76267635
" lib_ocaml_dir lib_ocaml_dir bsppx
@@ -7630,7 +7639,7 @@ let write_ninja_file bsc_dir cwd =
76307639
| [] -> ()
76317640
| xs ->
76327641
Buffer.add_string buffer
7633-
(Printf.sprintf "FLG %s\n" (String.concat " " xs) ) in
7642+
(Printf.sprintf "\nFLG %s" (String.concat " " xs) ) in
76347643
let () =
76357644
Bsb_default.get_bs_dependencies ()
76367645
|> List.iter (fun package ->
@@ -7646,7 +7655,7 @@ let write_ninja_file bsc_dir cwd =
76467655
in
76477656
res.files |> List.iter
76487657
(fun (x : Bsb_build_ui.file_group) ->
7649-
output_string ochan x.dir;
7658+
output_string ochan x.dir; (* to [.sourcedirs] *)
76507659
output_string ochan "\n" ;
76517660
Buffer.add_string buffer "\nS ";
76527661
Buffer.add_string buffer x.dir ;

jscomp/bin/bsb.win

15.2 KB
Binary file not shown.

jscomp/bin/bsb_helper.win

14.2 KB
Binary file not shown.

jscomp/bin/bsc.win

27 KB
Binary file not shown.

jscomp/bin/bsdep.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ val version : string
55

66
end = struct
77
#1 "bs_version.ml"
8-
let version = "1.3.4"
8+
let version = "1.4.0"
99

1010
end
1111
module Terminfo : sig

jscomp/bin/bsdep.win

84.7 KB
Binary file not shown.

jscomp/bin/bspack.win

641 KB
Binary file not shown.

jscomp/bin/bspp.win

0 Bytes
Binary file not shown.

jscomp/bin/bsppx.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7801,7 +7801,7 @@ val version : string
78017801

78027802
end = struct
78037803
#1 "bs_version.ml"
7804-
let version = "1.3.4"
7804+
let version = "1.4.0"
78057805

78067806
end
78077807
module Ext_pervasives : sig

jscomp/bin/bsppx.win

84.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)