Skip to content

Commit

Permalink
Merge pull request #336 from avsm/2.1-bump
Browse files Browse the repository at this point in the history
Bump to 2.1.0 and add `--target` instead of `--no-macosx`
  • Loading branch information
avsm committed Dec 7, 2014
2 parents c4b23aa + 7839f88 commit ac29376
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 24 deletions.
8 changes: 5 additions & 3 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
2.0.2 (2014-12-01):
2.1.0 (2014-12-07):
* Add specific support for `MacOSX` as a platform, which enables network bridging
on Yosemite (#329). If this breaks for you due to being on an older version of
MacOS X, then pass the new `--no-macosx` flag to the `mirage configure` command.
on Yosemite (#329). The `--unix` flag will automatically activate the new target
if run on a MacOS X host. If this breaks for you due to being on an older version of
MacOS X, then use the new `--target` flag to set either Unix, MacOSX or Xen to the
`mirage configure` command.
* Add `mirage.runtime` findlib library and corresponding Mirage_runtime module (#327).
* If net driver in STACKV4_direct can't initialize, print a helpful error (#164).
* [xen]: fixed link order in generated Makefile (#322).
Expand Down
2 changes: 1 addition & 1 deletion _oasis
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
OASISFormat: 0.3
Name: mirage
Version: 2.0.2
Version: 2.1.0
Synopsis: Mirage configuration tool
Authors: Thomas Gazagnaire, Anil Madhavapeddy
License: ISC
Expand Down
6 changes: 3 additions & 3 deletions lib/META
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OASIS_START
# DO NOT EDIT (digest: 540a230a25619641fb858d3d6354e61c)
version = "2.0.2"
# DO NOT EDIT (digest: 8afb77d9899adc7dc5d5c7c4e9ed93ff)
version = "2.1.0"
description = "Mirage configuration tool"
requires = "ipaddr unix dynlink lwt mirage-types mirage-types.lwt"
archive(byte) = "mirage.cma"
Expand All @@ -9,7 +9,7 @@ archive(native) = "mirage.cmxa"
archive(native, plugin) = "mirage.cmxs"
exists_if = "mirage.cma"
package "runtime" (
version = "2.0.2"
version = "2.1.0"
description = "Mirage configuration tool"
archive(byte) = "mirage-runtime.cma"
archive(byte, plugin) = "mirage-runtime.cma"
Expand Down
38 changes: 24 additions & 14 deletions lib/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,38 @@ let arg_list name doc conv =
Arg.(value & pos_all conv [] & doc)

let no_opam =
mk_flag ["no-opam"] "Do not manage the OPAM configuration."
mk_flag ["no-opam"] "Do not manage the OPAM configuration. This will result in dependent libraries not being automatically installed during the configuration phase."
let xen =
mk_flag ["xen"] "Generate a Xen unikernel. Do not use in conjunction with --unix."
let unix =
mk_flag ["unix"] "Use Unix backend. Do not use in conjunction with --xen."
let no_macosx =
mk_flag ["no-macosx"] "On MacOSX, force use of the Unix backend instead of OSX-specific libraries (advanced use only)."
mk_flag ["unix"] "Use Unix backend. Do not use in conjunction with --xen. On MacOS X, this will use platform-specific code to be generated. To force pure Unix mode on MacOS X, set the $(b,-t) flag to $(i,macosx) instead."

let target =
let doc = "Target platform to compile the unikernel for. Valid values are: $(i,xen), $(i,unix), $(i,macosx). There are short forms available via $(b,--xen) and $(b,--unix) as well." in
let e = Arg.enum [ "unix", `Unix; "macosx", `MacOSX; "xen", `Xen ] in
Arg.(value & opt (some e) None & info ["t";"target"] ~docv:"TARGET" ~doc)

(* Select the operating mode from command line flags *)
let mode unix xen no_macosx =
match xen,unix with
| true , true -> failwith "Cannot specify --unix and --xen together."
| true , false -> `Xen
| false, _ -> begin
match Mirage_misc.uname_s (), no_macosx with
| Some "Darwin", false -> `MacOSX
| _ -> `Unix
let mode unix xen target =
let default_unix =
match Mirage_misc.uname_s () with
| Some "Darwin" -> `MacOSX
| _ -> `Unix
in
(** Specifying --target takes priority over other flags *)
match target with
| Some t -> t
| None -> begin
(** For legacy reasons, Unix maps to either Unix or MacOS X *)
match xen, unix with
| true , true -> failwith "Cannot specify --unix and --xen together."
| true , false -> `Xen
| false, _ -> default_unix
end

let file =
let doc = Arg.info ~docv:"FILE"
~doc:"Configuration file for Mirage. If not specified, the current directory will be scanned.\
~doc:"Configuration file for Mirage. If not specified, the current directory will be scanned. \
If one file named $(b,config.ml) is found, that file will be used. If no files \
or multiple configuration files are found, this will result in an error unless one \
is explicitly specified on the command line." [] in
Expand All @@ -78,7 +88,7 @@ let configure =
Mirage.set_mode (mode unix xen no_macosx);
let t = Mirage.load file in
`Ok (Mirage.configure t)) in
Term.(ret (pure configure $ unix $ xen $ no_macosx $ no_opam $ file)),
Term.(ret (pure configure $ unix $ xen $ target $ no_opam $ file)),
term_info "configure" ~doc ~man

(* BUILD *)
Expand Down
6 changes: 3 additions & 3 deletions setup.ml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(* setup.ml generated for the first time by OASIS v0.4.5 *)

(* OASIS_START *)
(* DO NOT EDIT (digest: 8c38b4bcde0aba91cc33b72107e43e05) *)
(* DO NOT EDIT (digest: deeea94812d8568218f68d097e17df26) *)
(*
Regenerated by OASIS v0.4.5
Visit http://oasis.forge.ocamlcore.org for more information and
Expand Down Expand Up @@ -6673,7 +6673,7 @@ let setup_t =
alpha_features = [];
beta_features = [];
name = "mirage";
version = "2.0.2";
version = "2.1.0";
license =
OASISLicense.DEP5License
(OASISLicense.DEP5Unit
Expand Down Expand Up @@ -6829,7 +6829,7 @@ let setup_t =
};
oasis_fn = Some "_oasis";
oasis_version = "0.4.5";
oasis_digest = Some "Öo¿Ô\149aÆ¥ø\003\132í/Ï}¹";
oasis_digest = Some "àö\139ãy\005\tÞu\021 \002ÿ\n\ri";
oasis_exec = None;
oasis_setup_args = [];
setup_update = false
Expand Down

0 comments on commit ac29376

Please sign in to comment.