Skip to content

Commit 5276cd7

Browse files
committed
snapshot
1 parent 0c6af8b commit 5276cd7

File tree

4 files changed

+881
-698
lines changed

4 files changed

+881
-698
lines changed

lib/4.06.1/bsb.ml

Lines changed: 100 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5092,6 +5092,7 @@ module Bsb_config : sig
50925092
val ocaml_bin_install_prefix : string -> string
50935093
val proj_rel : string -> string
50945094

5095+
val lib_lit : string
50955096
val lib_js : string
50965097
val lib_bs : string
50975098
val lib_es6 : string
@@ -9862,6 +9863,81 @@ let walk_all_deps dir cb =
98629863
let visited = Hash_string.create 0 in
98639864
walk_all_deps_aux visited [] true dir cb
98649865

9866+
end
9867+
module Bsb_global_backend : sig
9868+
#1 "bsb_global_backend.mli"
9869+
(* Copyright (C) 2019 - Authors of BuckleScript
9870+
*
9871+
* This program is free software: you can redistribute it and/or modify
9872+
* it under the terms of the GNU Lesser General Public License as published by
9873+
* the Free Software Foundation, either version 3 of the License, or
9874+
* (at your option) any later version.
9875+
*
9876+
* In addition to the permissions granted to you by the LGPL, you may combine
9877+
* or link a "work that uses the Library" with a publicly distributed version
9878+
* of this file to produce a combined library or application, then distribute
9879+
* that combined work under the terms of your choosing, with no requirement
9880+
* to comply with the obligations normally placed on you by section 4 of the
9881+
* LGPL version 3 (or the corresponding section of a later version of the LGPL
9882+
* should you choose to use a later version).
9883+
*
9884+
* This program is distributed in the hope that it will be useful,
9885+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9886+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9887+
* GNU Lesser General Public License for more details.
9888+
*
9889+
* You should have received a copy of the GNU Lesser General Public License
9890+
* along with this program; if not, write to the Free Software
9891+
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
9892+
9893+
val cmdline_backend : Bsb_config_types.compilation_kind_t option ref
9894+
9895+
val backend : Bsb_config_types.compilation_kind_t Lazy.t
9896+
9897+
val lib_artifacts_dir : string Lazy.t
9898+
9899+
end = struct
9900+
#1 "bsb_global_backend.ml"
9901+
(* Copyright (C) 2019 - Authors of BuckleScript
9902+
*
9903+
* This program is free software: you can redistribute it and/or modify
9904+
* it under the terms of the GNU Lesser General Public License as published by
9905+
* the Free Software Foundation, either version 3 of the License, or
9906+
* (at your option) any later version.
9907+
*
9908+
* In addition to the permissions granted to you by the LGPL, you may combine
9909+
* or link a "work that uses the Library" with a publicly distributed version
9910+
* of this file to produce a combined library or application, then distribute
9911+
* that combined work under the terms of your choosing, with no requirement
9912+
* to comply with the obligations normally placed on you by section 4 of the
9913+
* LGPL version 3 (or the corresponding section of a later version of the LGPL
9914+
* should you choose to use a later version).
9915+
*
9916+
* This program is distributed in the hope that it will be useful,
9917+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9918+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9919+
* GNU Lesser General Public License for more details.
9920+
*
9921+
* You should have received a copy of the GNU Lesser General Public License
9922+
* along with this program; if not, write to the Free Software
9923+
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
9924+
9925+
9926+
let backend = lazy Bsb_config_types.Js
9927+
9928+
(* No cost of using this variable below when compiled in JS mode. *)
9929+
let cmdline_backend = ref (Some Bsb_config_types.Js)
9930+
9931+
9932+
let (//) = Ext_path.combine
9933+
9934+
let lib_artifacts_dir = lazy
9935+
begin match Lazy.force backend with
9936+
| Bsb_config_types.Js -> Bsb_config.lib_bs
9937+
| Bsb_config_types.Native -> Bsb_config.lib_lit // "native"
9938+
| Bsb_config_types.Bytecode -> Bsb_config.lib_lit // "bytecode"
9939+
end
9940+
98659941
end
98669942
module Bsb_global_paths : sig
98679943
#1 "bsb_global_paths.mli"
@@ -10527,6 +10603,7 @@ let prune_staled_bs_js_files
1052710603
(context : cxt)
1052810604
(cur_sources : _ Map_string.t )
1052910605
: unit =
10606+
(* Doesn't need to use Bsb_global_backend.lib_artifacts_dir because this is only for JS. *)
1053010607
let lib_parent =
1053110608
Filename.concat (Filename.concat context.root Bsb_config.lib_bs)
1053210609
context.cwd in
@@ -11029,7 +11106,8 @@ let (//) = Ext_path.combine
1102911106
let ninja_clean proj_dir =
1103011107
try
1103111108
let cmd = Bsb_global_paths.vendor_ninja in
11032-
let cwd = proj_dir // Bsb_config.lib_bs in
11109+
let lib_artifacts_dir = Lazy.force Bsb_global_backend.lib_artifacts_dir in
11110+
let cwd = proj_dir // lib_artifacts_dir in
1103311111
if Sys.file_exists cwd then
1103411112
let eid =
1103511113
Bsb_unix.run_command_execv {cmd ; args = [|cmd; "-t"; "clean"|] ; cwd} in
@@ -11763,8 +11841,9 @@ let output_merlin_namespace buffer ns=
1176311841
match ns with
1176411842
| None -> ()
1176511843
| Some x ->
11844+
let lib_artifacts_dir = Lazy.force Bsb_global_backend.lib_artifacts_dir in
1176611845
Buffer.add_string buffer merlin_b ;
11767-
Buffer.add_string buffer Bsb_config.lib_bs ;
11846+
Buffer.add_string buffer lib_artifacts_dir ;
1176811847
Buffer.add_string buffer merlin_flg ;
1176911848
Buffer.add_string buffer "-open ";
1177011849
Buffer.add_string buffer x
@@ -11858,13 +11937,14 @@ let merlin_file_gen ~per_proj_dir:(per_proj_dir:string)
1185811937
Buffer.add_string buffer merlin_b;
1185911938
Buffer.add_string buffer path ;
1186011939
);
11940+
let lib_artifacts_dir = Lazy.force Bsb_global_backend.lib_artifacts_dir in
1186111941
Ext_list.iter res_files.files (fun x ->
1186211942
if not (Bsb_file_groups.is_empty x) then
1186311943
begin
1186411944
Buffer.add_string buffer merlin_s;
1186511945
Buffer.add_string buffer x.dir ;
1186611946
Buffer.add_string buffer merlin_b;
11867-
Buffer.add_string buffer (Bsb_config.lib_bs//x.dir) ;
11947+
Buffer.add_string buffer (lib_artifacts_dir//x.dir) ;
1186811948
end
1186911949
) ;
1187011950
Buffer.add_string buffer "\n";
@@ -13434,8 +13514,8 @@ let output_ninja_and_namespace_map
1343413514
number_of_dev_groups;
1343513515
} : Bsb_config_types.t) : unit
1343613516
=
13437-
13438-
let cwd_lib_bs = per_proj_dir // Bsb_config.lib_bs in
13517+
let lib_artifacts_dir = Lazy.force Bsb_global_backend.lib_artifacts_dir in
13518+
let cwd_lib_bs = per_proj_dir // lib_artifacts_dir in
1343913519
let ppx_flags = Bsb_build_util.ppx_flags ppx_files in
1344013520
let oc = open_out_bin (cwd_lib_bs // Literals.build_ninja) in
1344113521
let g_pkg_flg , g_ns_flg =
@@ -13556,7 +13636,7 @@ let output_ninja_and_namespace_map
1355613636

1355713637
Ext_option.iter namespace (fun ns ->
1355813638
let namespace_dir =
13559-
per_proj_dir // Bsb_config.lib_bs in
13639+
per_proj_dir // lib_artifacts_dir in
1356013640
Bsb_namespace_map_gen.output
1356113641
~dir:namespace_dir ns
1356213642
bs_file_groups;
@@ -13983,7 +14063,8 @@ let regenerate_ninja
1398314063
~forced ~per_proj_dir
1398414064
: Bsb_config_types.t option =
1398514065
let toplevel = toplevel_package_specs = None in
13986-
let lib_bs_dir = per_proj_dir // Bsb_config.lib_bs in
14066+
let lib_artifacts_dir = Lazy.force Bsb_global_backend.lib_artifacts_dir in
14067+
let lib_bs_dir = per_proj_dir // lib_artifacts_dir in
1398714068
let output_deps = lib_bs_dir // bsdeps in
1398814069
let check_result =
1398914070
Bsb_ninja_check.check
@@ -16444,17 +16525,18 @@ let install_targets cwd ({files_to_install; namespace; package_name = _} : Bsb_c
1644416525
let install ~destdir file =
1644516526
Bsb_file.install_if_exists ~destdir file |> ignore
1644616527
in
16528+
let lib_artifacts_dir = Lazy.force Bsb_global_backend.lib_artifacts_dir in
1644716529
let install_filename_sans_extension destdir namespace x =
1644816530
let x =
1644916531
Ext_namespace.make ?ns:namespace x in
1645016532
install ~destdir (cwd // x ^ Literals.suffix_ml) ;
1645116533
install ~destdir (cwd // x ^ Literals.suffix_re) ;
1645216534
install ~destdir (cwd // x ^ Literals.suffix_mli) ;
1645316535
install ~destdir (cwd // x ^ Literals.suffix_rei) ;
16454-
install ~destdir (cwd // Bsb_config.lib_bs//x ^ Literals.suffix_cmi) ;
16455-
install ~destdir (cwd // Bsb_config.lib_bs//x ^ Literals.suffix_cmj) ;
16456-
install ~destdir (cwd // Bsb_config.lib_bs//x ^ Literals.suffix_cmt) ;
16457-
install ~destdir (cwd // Bsb_config.lib_bs//x ^ Literals.suffix_cmti) ;
16536+
install ~destdir (cwd // lib_artifacts_dir//x ^ Literals.suffix_cmi) ;
16537+
install ~destdir (cwd // lib_artifacts_dir//x ^ Literals.suffix_cmj) ;
16538+
install ~destdir (cwd // lib_artifacts_dir//x ^ Literals.suffix_cmt) ;
16539+
install ~destdir (cwd // lib_artifacts_dir//x ^ Literals.suffix_cmti) ;
1645816540
in
1645916541
let destdir = cwd // Bsb_config.lib_ocaml in (* lib is already there after building, so just mkdir [lib/ocaml] *)
1646016542
if not @@ Sys.file_exists destdir then begin Unix.mkdir destdir 0o777 end;
@@ -16478,6 +16560,7 @@ let build_bs_deps cwd (deps : Bsb_package_specs.t) (ninja_args : string array) =
1647816560
if Ext_array.is_empty ninja_args then [|vendor_ninja|]
1647916561
else Array.append [|vendor_ninja|] ninja_args
1648016562
in
16563+
let lib_artifacts_dir = Lazy.force Bsb_global_backend.lib_artifacts_dir in
1648116564
Bsb_build_util.walk_all_deps cwd (fun {top; proj_dir} ->
1648216565
if not top then
1648316566
begin
@@ -16488,7 +16571,7 @@ let build_bs_deps cwd (deps : Bsb_package_specs.t) (ninja_args : string array) =
1648816571
~per_proj_dir:proj_dir in (* set true to force regenrate ninja file so we have [config_opt]*)
1648916572
let command =
1649016573
{Bsb_unix.cmd = vendor_ninja;
16491-
cwd = proj_dir // Bsb_config.lib_bs;
16574+
cwd = proj_dir // lib_artifacts_dir;
1649216575
args
1649316576
} in
1649416577
let eid =
@@ -16518,6 +16601,7 @@ let make_world_deps cwd (config : Bsb_config_types.t option) (ninja_args : strin
1651816601
Bsb_config_parse.package_specs_from_bsconfig ()
1651916602
| Some config -> config.package_specs in
1652016603
build_bs_deps cwd deps ninja_args
16604+
1652116605
end
1652216606
module Bsb_main : sig
1652316607
#1 "bsb_main.mli"
@@ -16622,20 +16706,21 @@ let exec_command_then_exit command =
1662216706
(* Execute the underlying ninja build call, then exit (as opposed to keep watching) *)
1662316707
let ninja_command_exit ninja_args =
1662416708
let ninja_args_len = Array.length ninja_args in
16709+
let lib_artifacts_dir = Lazy.force Bsb_global_backend.lib_artifacts_dir in
1662516710
if Ext_sys.is_windows_or_cygwin then
1662616711
let path_ninja = Filename.quote Bsb_global_paths.vendor_ninja in
1662716712
exec_command_then_exit
1662816713
(if ninja_args_len = 0 then
1662916714
Ext_string.inter3
16630-
path_ninja "-C" Bsb_config.lib_bs
16715+
path_ninja "-C" lib_artifacts_dir
1663116716
else
1663216717
let args =
1663316718
Array.append
16634-
[| path_ninja ; "-C"; Bsb_config.lib_bs|]
16719+
[| path_ninja ; "-C"; lib_artifacts_dir|]
1663516720
ninja_args in
1663616721
Ext_string.concat_array Ext_string.single_space args)
1663716722
else
16638-
let ninja_common_args = [|"ninja.exe"; "-C"; Bsb_config.lib_bs |] in
16723+
let ninja_common_args = [|"ninja.exe"; "-C"; lib_artifacts_dir |] in
1663916724
let args =
1664016725
if ninja_args_len = 0 then ninja_common_args else
1664116726
Array.append ninja_common_args ninja_args in

lib/4.06.1/bsb.ml.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../lib/4.06.1/bsb.ml: ./bsb/bsb_build_schemas.ml ./bsb/bsb_build_util.ml ./bsb/bsb_build_util.mli ./bsb/bsb_clean.ml ./bsb/bsb_clean.mli ./bsb/bsb_config.ml ./bsb/bsb_config.mli ./bsb/bsb_config_parse.ml ./bsb/bsb_config_parse.mli ./bsb/bsb_config_types.ml ./bsb/bsb_db_encode.ml ./bsb/bsb_db_encode.mli ./bsb/bsb_db_util.ml ./bsb/bsb_db_util.mli ./bsb/bsb_exception.ml ./bsb/bsb_exception.mli ./bsb/bsb_file.ml ./bsb/bsb_file.mli ./bsb/bsb_file_groups.ml ./bsb/bsb_file_groups.mli ./bsb/bsb_global_paths.ml ./bsb/bsb_global_paths.mli ./bsb/bsb_log.ml ./bsb/bsb_log.mli ./bsb/bsb_merlin_gen.ml ./bsb/bsb_merlin_gen.mli ./bsb/bsb_namespace_map_gen.ml ./bsb/bsb_namespace_map_gen.mli ./bsb/bsb_ninja_check.ml ./bsb/bsb_ninja_check.mli ./bsb/bsb_ninja_file_groups.ml ./bsb/bsb_ninja_file_groups.mli ./bsb/bsb_ninja_gen.ml ./bsb/bsb_ninja_gen.mli ./bsb/bsb_ninja_global_vars.ml ./bsb/bsb_ninja_regen.ml ./bsb/bsb_ninja_regen.mli ./bsb/bsb_ninja_rule.ml ./bsb/bsb_ninja_rule.mli ./bsb/bsb_ninja_targets.ml ./bsb/bsb_ninja_targets.mli ./bsb/bsb_package_specs.ml ./bsb/bsb_package_specs.mli ./bsb/bsb_parse_sources.ml ./bsb/bsb_parse_sources.mli ./bsb/bsb_pkg.ml ./bsb/bsb_pkg.mli ./bsb/bsb_pkg_types.ml ./bsb/bsb_pkg_types.mli ./bsb/bsb_real_path.ml ./bsb/bsb_real_path.mli ./bsb/bsb_regex.ml ./bsb/bsb_regex.mli ./bsb/bsb_templates.ml ./bsb/bsb_templates.mli ./bsb/bsb_theme_init.ml ./bsb/bsb_theme_init.mli ./bsb/bsb_unix.ml ./bsb/bsb_unix.mli ./bsb/bsb_warning.ml ./bsb/bsb_warning.mli ./bsb/bsb_watcher_gen.ml ./bsb/bsb_watcher_gen.mli ./bsb/bsb_world.ml ./bsb/bsb_world.mli ./bsb/oCamlRes.ml ./common/bs_version.ml ./common/bs_version.mli ./ext/bsb_db.ml ./ext/bsb_db.mli ./ext/bsb_dir_index.ml ./ext/bsb_dir_index.mli ./ext/bsc_warnings.ml ./ext/ext_array.ml ./ext/ext_array.mli ./ext/ext_buffer.ml ./ext/ext_buffer.mli ./ext/ext_bytes.ml ./ext/ext_bytes.mli ./ext/ext_color.ml ./ext/ext_color.mli ./ext/ext_digest.ml ./ext/ext_digest.mli ./ext/ext_filename.ml ./ext/ext_filename.mli ./ext/ext_fmt.ml ./ext/ext_io.ml ./ext/ext_io.mli ./ext/ext_json.ml ./ext/ext_json.mli ./ext/ext_json_noloc.ml ./ext/ext_json_noloc.mli ./ext/ext_json_parse.ml ./ext/ext_json_parse.mli ./ext/ext_json_types.ml ./ext/ext_list.ml ./ext/ext_list.mli ./ext/ext_namespace.ml ./ext/ext_namespace.mli ./ext/ext_option.ml ./ext/ext_option.mli ./ext/ext_path.ml ./ext/ext_path.mli ./ext/ext_pervasives.ml ./ext/ext_pervasives.mli ./ext/ext_position.ml ./ext/ext_position.mli ./ext/ext_string.ml ./ext/ext_string.mli ./ext/ext_sys.ml ./ext/ext_sys.mli ./ext/ext_util.ml ./ext/ext_util.mli ./ext/hash.ml ./ext/hash.mli ./ext/hash_gen.ml ./ext/hash_set_gen.ml ./ext/hash_set_string.ml ./ext/hash_set_string.mli ./ext/hash_string.ml ./ext/hash_string.mli ./ext/literals.ml ./ext/literals.mli ./ext/map_gen.ml ./ext/map_string.ml ./ext/map_string.mli ./ext/set_gen.ml ./ext/set_string.ml ./ext/set_string.mli ./main/bsb_main.ml ./main/bsb_main.mli ./stubs/bs_hash_stubs.ml
1+
../lib/4.06.1/bsb.ml: ./bsb/bsb_build_schemas.ml ./bsb/bsb_build_util.ml ./bsb/bsb_build_util.mli ./bsb/bsb_clean.ml ./bsb/bsb_clean.mli ./bsb/bsb_config.ml ./bsb/bsb_config.mli ./bsb/bsb_config_parse.ml ./bsb/bsb_config_parse.mli ./bsb/bsb_config_types.ml ./bsb/bsb_db_encode.ml ./bsb/bsb_db_encode.mli ./bsb/bsb_db_util.ml ./bsb/bsb_db_util.mli ./bsb/bsb_exception.ml ./bsb/bsb_exception.mli ./bsb/bsb_file.ml ./bsb/bsb_file.mli ./bsb/bsb_file_groups.ml ./bsb/bsb_file_groups.mli ./bsb/bsb_global_backend.ml ./bsb/bsb_global_backend.mli ./bsb/bsb_global_paths.ml ./bsb/bsb_global_paths.mli ./bsb/bsb_log.ml ./bsb/bsb_log.mli ./bsb/bsb_merlin_gen.ml ./bsb/bsb_merlin_gen.mli ./bsb/bsb_namespace_map_gen.ml ./bsb/bsb_namespace_map_gen.mli ./bsb/bsb_ninja_check.ml ./bsb/bsb_ninja_check.mli ./bsb/bsb_ninja_file_groups.ml ./bsb/bsb_ninja_file_groups.mli ./bsb/bsb_ninja_gen.ml ./bsb/bsb_ninja_gen.mli ./bsb/bsb_ninja_global_vars.ml ./bsb/bsb_ninja_regen.ml ./bsb/bsb_ninja_regen.mli ./bsb/bsb_ninja_rule.ml ./bsb/bsb_ninja_rule.mli ./bsb/bsb_ninja_targets.ml ./bsb/bsb_ninja_targets.mli ./bsb/bsb_package_specs.ml ./bsb/bsb_package_specs.mli ./bsb/bsb_parse_sources.ml ./bsb/bsb_parse_sources.mli ./bsb/bsb_pkg.ml ./bsb/bsb_pkg.mli ./bsb/bsb_pkg_types.ml ./bsb/bsb_pkg_types.mli ./bsb/bsb_real_path.ml ./bsb/bsb_real_path.mli ./bsb/bsb_regex.ml ./bsb/bsb_regex.mli ./bsb/bsb_templates.ml ./bsb/bsb_templates.mli ./bsb/bsb_theme_init.ml ./bsb/bsb_theme_init.mli ./bsb/bsb_unix.ml ./bsb/bsb_unix.mli ./bsb/bsb_warning.ml ./bsb/bsb_warning.mli ./bsb/bsb_watcher_gen.ml ./bsb/bsb_watcher_gen.mli ./bsb/bsb_world.ml ./bsb/bsb_world.mli ./bsb/oCamlRes.ml ./common/bs_version.ml ./common/bs_version.mli ./ext/bsb_db.ml ./ext/bsb_db.mli ./ext/bsb_dir_index.ml ./ext/bsb_dir_index.mli ./ext/bsc_warnings.ml ./ext/ext_array.ml ./ext/ext_array.mli ./ext/ext_buffer.ml ./ext/ext_buffer.mli ./ext/ext_bytes.ml ./ext/ext_bytes.mli ./ext/ext_color.ml ./ext/ext_color.mli ./ext/ext_digest.ml ./ext/ext_digest.mli ./ext/ext_filename.ml ./ext/ext_filename.mli ./ext/ext_fmt.ml ./ext/ext_io.ml ./ext/ext_io.mli ./ext/ext_json.ml ./ext/ext_json.mli ./ext/ext_json_noloc.ml ./ext/ext_json_noloc.mli ./ext/ext_json_parse.ml ./ext/ext_json_parse.mli ./ext/ext_json_types.ml ./ext/ext_list.ml ./ext/ext_list.mli ./ext/ext_namespace.ml ./ext/ext_namespace.mli ./ext/ext_option.ml ./ext/ext_option.mli ./ext/ext_path.ml ./ext/ext_path.mli ./ext/ext_pervasives.ml ./ext/ext_pervasives.mli ./ext/ext_position.ml ./ext/ext_position.mli ./ext/ext_string.ml ./ext/ext_string.mli ./ext/ext_sys.ml ./ext/ext_sys.mli ./ext/ext_util.ml ./ext/ext_util.mli ./ext/hash.ml ./ext/hash.mli ./ext/hash_gen.ml ./ext/hash_set_gen.ml ./ext/hash_set_string.ml ./ext/hash_set_string.mli ./ext/hash_string.ml ./ext/hash_string.mli ./ext/literals.ml ./ext/literals.mli ./ext/map_gen.ml ./ext/map_string.ml ./ext/map_string.mli ./ext/set_gen.ml ./ext/set_string.ml ./ext/set_string.mli ./main/bsb_main.ml ./main/bsb_main.mli ./stubs/bs_hash_stubs.ml

0 commit comments

Comments
 (0)