Skip to content

Commit

Permalink
Merge pull request #34 from djs55/release.1.2.0
Browse files Browse the repository at this point in the history
Release 1.2.0
  • Loading branch information
djs55 committed Oct 3, 2014
2 parents e6ce49a + e55a45e commit f84f16d
Show file tree
Hide file tree
Showing 6 changed files with 387 additions and 261 deletions.
2 changes: 1 addition & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
trunk (unreleased)
1.2.0 (3-Oct-2014)
* blkback: add 'force_close' to more forcibly tear down the device
* blkback: make 'destroy' idempotent
* blkback: measure ring utilisation; segments per request; total
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-block-xen
Version: 1.1.0
Version: 1.2.0
Synopsis: Xen block frontend and backend driver implementation
Authors: Jonathan Ludlam, Anil Madhavapeddy, David Scott
License: ISC
Expand Down
8 changes: 4 additions & 4 deletions _tags
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# OASIS_START
# DO NOT EDIT (digest: 7981770ee519b9660a36595f77f128c1)
# DO NOT EDIT (digest: d02f21f6203a697a3781518ec94d0798)
# Ignore VCS directories, you can use the same kind of rule outside
# OASIS_START/STOP if you want to exclude directories that contains
# useless stuff for the build process
Expand All @@ -21,17 +21,17 @@
<lib/*.ml{,i}>: pkg_mirage-xen
# Library mirage_block_xen_back
"lib/mirage_block_xen_back.cmxs": use_mirage_block_xen_back
<lib/*.ml{,i}>: use_mirage_block_xen
<lib/*.ml{,i}>: pkg_lwt
<lib/*.ml{,i}>: pkg_lwt.syntax
<lib/*.ml{,i}>: pkg_cstruct
<lib/*.ml{,i}>: pkg_cstruct.syntax
<lib/*.ml{,i}>: pkg_io-page
<lib/*.ml{,i}>: pkg_lwt
<lib/*.ml{,i}>: pkg_lwt.syntax
<lib/*.ml{,i}>: pkg_shared-memory-ring
<lib/*.ml{,i}>: pkg_shared-memory-ring.lwt
<lib/*.ml{,i}>: pkg_xen-evtchn
<lib/*.ml{,i}>: pkg_xen-gnt
<lib/*.ml{,i}>: pkg_xenstore
<lib/*.ml{,i}>: use_mirage_block_xen
# OASIS_STOP
<configure.*>: not_hygienic
<*/*>: syntax_camlp4o, pkg_lwt.syntax, pkg_cstruct.syntax
8 changes: 4 additions & 4 deletions lib/META
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OASIS_START
# DO NOT EDIT (digest: 27204f6b69a9bf33645a4ebca78d53f0)
version = "1.1.0"
# DO NOT EDIT (digest: ef2563e00b0437fbbf4ee7999f4628e5)
version = "1.2.0"
description = "Xen block frontend and backend driver implementation"
requires = "cstruct cstruct.syntax"
archive(byte) = "mirage_block_xen.cma"
Expand All @@ -9,7 +9,7 @@ archive(native) = "mirage_block_xen.cmxa"
archive(native, plugin) = "mirage_block_xen.cmxs"
exists_if = "mirage_block_xen.cma"
package "front" (
version = "1.1.0"
version = "1.2.0"
description = "Xen block frontend and backend driver implementation"
requires =
"lwt lwt.syntax cstruct cstruct.syntax mirage-types io-page shared-memory-ring shared-memory-ring.lwt mirage-block-xen xen-evtchn xen-gnt mirage-xen"
Expand All @@ -21,7 +21,7 @@ package "front" (
)

package "back" (
version = "1.1.0"
version = "1.2.0"
description = "Xen block frontend and backend driver implementation"
requires =
"lwt lwt.syntax cstruct cstruct.syntax io-page shared-memory-ring shared-memory-ring.lwt mirage-block-xen xen-evtchn xen-gnt xenstore"
Expand Down
146 changes: 93 additions & 53 deletions myocamlbuild.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(* OASIS_START *)
(* DO NOT EDIT (digest: e8ea6270f31e32d71f8ac993dca23c82) *)
(* DO NOT EDIT (digest: 35406e9c83bbe811163a3c1eaa885295) *)
module OASISGettext = struct
(* # 22 "src/oasis/OASISGettext.ml" *)

Expand Down Expand Up @@ -39,10 +39,10 @@ module OASISExpr = struct
open OASISGettext


type test = string
type test = string


type flag = string
type flag = string


type t =
Expand All @@ -52,10 +52,10 @@ module OASISExpr = struct
| EOr of t * t
| EFlag of flag
| ETest of test * string



type 'a choices = (t * 'a) list

type 'a choices = (t * 'a) list


let eval var_get t =
Expand Down Expand Up @@ -204,26 +204,27 @@ module BaseEnvLight = struct
end


let var_get name env =
let rec var_expand str =
let buff =
Buffer.create ((String.length str) * 2)
in
Buffer.add_substitute
buff
(fun var ->
try
var_expand (MapString.find var env)
with Not_found ->
failwith
(Printf.sprintf
"No variable %s defined when trying to expand %S."
var
str))
str;
Buffer.contents buff
let rec var_expand str env =
let buff =
Buffer.create ((String.length str) * 2)
in
var_expand (MapString.find name env)
Buffer.add_substitute
buff
(fun var ->
try
var_expand (MapString.find var env) env
with Not_found ->
failwith
(Printf.sprintf
"No variable %s defined when trying to expand %S."
var
str))
str;
Buffer.contents buff


let var_get name env =
var_expand (MapString.find name env) env


let var_choose lst env =
Expand All @@ -233,7 +234,7 @@ module BaseEnvLight = struct
end


# 236 "myocamlbuild.ml"
# 237 "myocamlbuild.ml"
module MyOCamlbuildFindlib = struct
(* # 22 "src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" *)

Expand All @@ -258,6 +259,31 @@ module MyOCamlbuildFindlib = struct
Ocamlbuild_pack.Lexers.blank_sep_strings


let exec_from_conf exec =
let exec =
let env_filename = Pathname.basename BaseEnvLight.default_filename in
let env = BaseEnvLight.load ~filename:env_filename ~allow_empty:true () in
try
BaseEnvLight.var_get exec env
with Not_found ->
Printf.eprintf "W: Cannot get variable %s\n" exec;
exec
in
let fix_win32 str =
if Sys.os_type = "Win32" then begin
let buff = Buffer.create (String.length str) in
(* Adapt for windowsi, ocamlbuild + win32 has a hard time to handle '\\'.
*)
String.iter
(fun c -> Buffer.add_char buff (if c = '\\' then '/' else c))
str;
Buffer.contents buff
end else begin
str
end
in
fix_win32 exec

let split s ch =
let buf = Buffer.create 13 in
let x = ref [] in
Expand Down Expand Up @@ -285,17 +311,7 @@ module MyOCamlbuildFindlib = struct
with Not_found -> s

(* ocamlfind command *)
let ocamlfind x =
let ocamlfind_prog =
let env_filename = Pathname.basename BaseEnvLight.default_filename in
let env = BaseEnvLight.load ~filename:env_filename ~allow_empty:true () in
try
BaseEnvLight.var_get "ocamlfind" env
with Not_found ->
Printf.eprintf "W: Cannot get variable ocamlfind";
"ocamlfind"
in
S[Sh ocamlfind_prog; x]
let ocamlfind x = S[Sh (exec_from_conf "ocamlfind"); x]

(* This lists all supported packages. *)
let find_packages () =
Expand All @@ -306,9 +322,25 @@ module MyOCamlbuildFindlib = struct
let find_syntaxes () = ["camlp4o"; "camlp4r"]


let well_known_syntax = [
"camlp4.quotations.o";
"camlp4.quotations.r";
"camlp4.exceptiontracer";
"camlp4.extend";
"camlp4.foldgenerator";
"camlp4.listcomprehension";
"camlp4.locationstripper";
"camlp4.macro";
"camlp4.mapgenerator";
"camlp4.metagenerator";
"camlp4.profiler";
"camlp4.tracer"
]


let dispatch =
function
| Before_options ->
| After_options ->
(* By using Before_options one let command line options have an higher
* priority on the contrary using After_options will guarantee to have
* the higher priority override default commands by ocamlfind ones *)
Expand All @@ -331,13 +363,17 @@ module MyOCamlbuildFindlib = struct
List.iter
begin fun pkg ->
let base_args = [A"-package"; A pkg] in
(* TODO: consider how to really choose camlp4o or camlp4r. *)
let syn_args = [A"-syntax"; A "camlp4o"] in
let args =
(* Heuristic to identify syntax extensions: whether they end in
* ".syntax"; some might not *)
if Filename.check_suffix pkg "syntax"
then syn_args @ base_args
else base_args
(* Heuristic to identify syntax extensions: whether they end in
".syntax"; some might not.
*)
if Filename.check_suffix pkg "syntax" ||
List.mem pkg well_known_syntax then
syn_args @ base_args
else
base_args
in
flag ["ocaml"; "compile"; "pkg_"^pkg] & S args;
flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S args;
Expand Down Expand Up @@ -394,10 +430,10 @@ module MyOCamlbuildBase = struct
module OC = Ocamlbuild_pack.Ocaml_compiler


type dir = string
type file = string
type name = string
type tag = string
type dir = string
type file = string
type name = string
type tag = string


(* # 62 "src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
Expand All @@ -412,7 +448,7 @@ module MyOCamlbuildBase = struct
* directory.
*)
includes: (dir * dir list) list;
}
}


let env_filename =
Expand Down Expand Up @@ -455,7 +491,7 @@ module MyOCamlbuildBase = struct
try
opt := no_trailing_dot (BaseEnvLight.var_get var env)
with Not_found ->
Printf.eprintf "W: Cannot get variable %s" var)
Printf.eprintf "W: Cannot get variable %s\n" var)
[
Options.ext_obj, "ext_obj";
Options.ext_lib, "ext_lib";
Expand Down Expand Up @@ -531,10 +567,14 @@ module MyOCamlbuildBase = struct
(* Add flags *)
List.iter
(fun (tags, cond_specs) ->
let spec =
BaseEnvLight.var_choose cond_specs env
let spec = BaseEnvLight.var_choose cond_specs env in
let rec eval_specs =
function
| S lst -> S (List.map eval_specs lst)
| A str -> A (BaseEnvLight.var_expand str env)
| spec -> spec
in
flag tags & spec)
flag tags & (eval_specs spec))
t.flags
| _ ->
()
Expand All @@ -551,7 +591,7 @@ module MyOCamlbuildBase = struct
end


# 554 "myocamlbuild.ml"
# 594 "myocamlbuild.ml"
open Ocamlbuild_plugin;;
let package_default =
{
Expand All @@ -569,6 +609,6 @@ let package_default =

let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;

# 573 "myocamlbuild.ml"
# 613 "myocamlbuild.ml"
(* OASIS_STOP *)
Ocamlbuild_plugin.dispatch dispatch_default;;
Loading

0 comments on commit f84f16d

Please sign in to comment.