Skip to content

Commit

Permalink
Always use a bytecode boot.exe
Browse files Browse the repository at this point in the history
Fix #446
  • Loading branch information
Jeremie Dimino committed Jan 30, 2018
1 parent f6cefa4 commit c57b049
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@

- Display a warning for invalid lines in jbuild-ignore (#389)

- Always build `boot.exe` as a bytecode program. It makes the build of
jbuilder faster and fix the build on some architectures (#463, fixes #446)

1.0+beta16 (05/11/2017)
-----------------------

Expand Down
18 changes: 4 additions & 14 deletions bootstrap.ml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ let prog_not_found prog =
eprintf "Program %s not found in PATH" prog;
exit 2

type mode = Native | Byte

let best_prog dir prog =
let fn = dir ^/ prog ^ ".opt" ^ exe in
if Sys.file_exists fn then
Expand All @@ -134,13 +132,10 @@ let get_prog dir prog =
| None -> prog_not_found prog
| Some fn -> fn

let bin_dir, mode, compiler =
let bin_dir, compiler =
match find_prog "ocamlc" with
| None -> prog_not_found "ocamlc"
| Some (bin_dir, prog) ->
match best_prog bin_dir "ocamlopt" with
| Some prog -> (bin_dir, Native, prog)
| None -> (bin_dir, Byte, prog)
| Some x -> x

let ocamllex = get_prog bin_dir "ocamllex"
let ocamldep = get_prog bin_dir "ocamldep"
Expand Down Expand Up @@ -429,14 +424,9 @@ let cleanup ~keep_ml_file =
()

let () =
let lib_ext =
match mode with
| Native -> "cmxa"
| Byte -> "cma"
in
let n =
try exec "%s -w -40 -o boot.exe unix.%s %s"
(Filename.quote compiler) lib_ext generated_file
try exec "%s -w -40 -o boot.exe unix.cma %s"
(Filename.quote compiler) generated_file
with e -> cleanup ~keep_ml_file:true; raise e
in
cleanup ~keep_ml_file:(n <> 0);
Expand Down

0 comments on commit c57b049

Please sign in to comment.