From c57b04923e4894b0ae1b02b8958d6f613d165186 Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Tue, 30 Jan 2018 14:33:54 +0000 Subject: [PATCH] Always use a bytecode boot.exe Fix #446 --- CHANGES.md | 3 +++ bootstrap.ml | 18 ++++-------------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a7d08d7408d..49267deb67d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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) ----------------------- diff --git a/bootstrap.ml b/bootstrap.ml index 5ce303ae82b..42345f678de 100644 --- a/bootstrap.ml +++ b/bootstrap.ml @@ -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 @@ -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" @@ -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);