Skip to content

Commit

Permalink
refactor(boot): remove unused variables (#10527)
Browse files Browse the repository at this point in the history
Some options are interpreted by `bootstrap.ml`, other ones by
`duneboot.ml`. They need to be parsed, but can be ignored instead of
setting a dummy reference.

Signed-off-by: Etienne Millon <me@emillon.org>
  • Loading branch information
emillon committed May 15, 2024
1 parent f1255f0 commit 5904a00
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
10 changes: 4 additions & 6 deletions boot/bootstrap.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,21 @@ open Printf

let min_supported_natively = 4, 08, 0

let _verbose, keep_generated_files, _debug =
let keep_generated_files =
let anon s = raise (Arg.Bad (sprintf "don't know what to do with %s\n" s)) in
let verbose = ref false in
let keep_generated_files = ref false in
let debug = ref false in
Arg.parse
[ "-j", Arg.Int ignore, "JOBS Concurrency"
; "--verbose", Arg.Set verbose, " Set the display mode"
; "--verbose", Arg.Unit ignore, " Set the display mode"
; "--keep-generated-files", Arg.Set keep_generated_files, " Keep generated files"
; "--debug", Arg.Set debug, " Enable various debugging options"
; "--debug", Arg.Unit ignore, " Enable various debugging options"
; ( "--force-byte-compilation"
, Arg.Unit ignore
, " Force bytecode compilation even if ocamlopt is available" )
]
anon
"Usage: ocaml bootstrap.ml <options>\nOptions are:";
!verbose, !keep_generated_files, !debug
!keep_generated_files
;;

let modules = [ "boot/libs"; "boot/duneboot" ]
Expand Down
12 changes: 3 additions & 9 deletions boot/duneboot.ml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
(** {2 Command line} *)

let concurrency, verbose, _keep_generated_files, debug, secondary, force_byte_compilation =
let concurrency, verbose, debug, secondary, force_byte_compilation =
let anon s = raise (Arg.Bad (Printf.sprintf "don't know what to do with %s\n" s)) in
let concurrency = ref None in
let verbose = ref false in
let keep_generated_files = ref false in
let prog = Filename.basename Sys.argv.(0) in
let debug = ref false in
let secondary = ref false in
let force_byte_compilation = ref false in
Arg.parse
[ "-j", Int (fun n -> concurrency := Some n), "JOBS Concurrency"
; "--verbose", Set verbose, " Set the display mode"
; "--keep-generated-files", Set keep_generated_files, " Keep generated files"
; "--keep-generated-files", Unit ignore, " Keep generated files"
; "--debug", Set debug, " Enable various debugging options"
; "--secondary", Set secondary, " Use the secondary compiler installation"
; ( "--force-byte-compilation"
Expand All @@ -21,12 +20,7 @@ let concurrency, verbose, _keep_generated_files, debug, secondary, force_byte_co
]
anon
(Printf.sprintf "Usage: %s <options>\nOptions are:" prog);
( !concurrency
, !verbose
, !keep_generated_files
, !debug
, !secondary
, !force_byte_compilation )
!concurrency, !verbose, !debug, !secondary, !force_byte_compilation
;;

(** {2 General configuration} *)
Expand Down

0 comments on commit 5904a00

Please sign in to comment.