Forgot to attach the patch... Thanks, Euan
On Tue, Apr 08, 2014 at 03:45:40PM +0100, Euan Harris wrote: > Hi, > > > I once asked Zheng Li for help. Thanks for Zheng's help.:) > > Zheng told me that we could build xenserver-core probject > > (https://github.com/xenserver/xenserver-core), with which we should be > > able to build most xenserver components (including xapi) on a vanilla > > CentOS. > > > > We tried this way, and xenserver-core could be built smoothly on CentOS6.5 > > or Ubuntu1304. But after that, XenAPI could not be built successfully, and > > said some packages could not be found (stdext, xml-light2, uuid, etc..) > > This is happening because building and installing xenserver-core does > not install xen-api's build dependencies. xenserver-core builds RPMs > in temporary chroot environments, using mock, so even though you have > build xen-api as part of xenserver-core, its dependencies were not > installed on your machine. You can use 'yum-builddep' to install > them from your xenserver-core repository, but if you want to build > trunk xen-api you will need to install a couple of other dependencies > which are not yet packaged in xenserver-core. > > This should do the trick: > > # install the packaged dependencies > sudo yum-builddep xapi > > # build and install ocaml-ctypes, needed by ocaml-opasswd below > sudo yum install libffi-devel > curl -OL > https://github.com/ocamllabs/ocaml-ctypes/archive/ocaml-ctypes-0.2.3.tar.gz > tar zxvf ocaml-ctypes-0.2.3.tar.gz > cd ocaml-ctypes-ocaml-ctypes-0.2.3 > make > make install > cd .. > > # build and install ocaml-passwd > # ocaml-opasswd must be patched to build with the version of ocaml used by > # xenserver-core > git clone https://github.com/xapi-project/ocaml-opasswd > sudo yum install oasis > cd ocaml-opasswd > patch -p1 < ocaml-opasswd.patch > oasis setup > make > sudo make install > cd .. > > # build xen-api > git clone https://github.com/xapi-project/xen-api > cd xen-api > make > > Thanks, > Euan
diff --git a/_oasis b/_oasis index 3cd8782..c1d7c9e 100644 --- a/_oasis +++ b/_oasis @@ -18,10 +18,10 @@ Library oPasswd Pack: true Modules: Passwd, Shadow, Common BuildDepends: unix, ctypes, ctypes.foreign - ByteOpt: -warn-error +a -bin-annot -short-paths + ByteOpt: -warn-error +a -bin-annot if flag(extra_debugging) ByteOpt+: -g -runtime-variant d -verbose - NativeOpt: -warn-error +a -bin-annot -short-paths + NativeOpt: -warn-error +a -bin-annot if flag(extra_debugging) NativeOpt+: -g -runtime-variant d -verbose @@ -30,7 +30,7 @@ Executable opasswd_test BuildTools: ocamlbuild MainIs: opasswd_test.ml BuildDepends: oPasswd - NativeOpt: -warn-error +a -bin-annot -short-paths + NativeOpt: -warn-error +a -bin-annot if flag(extra_debugging) NativeOpt+: -g -runtime-variant d -verbose CompiledObject: best diff --git a/lib/common.ml b/lib/common.ml index c0e9771..835adac 100644 --- a/lib/common.ml +++ b/lib/common.ml @@ -1,3 +1,5 @@ +let ( |> ) a b = b a + let get_password name = if Shadow.shadow_enabled () then Shadow.(with_lock (fun () -> diff --git a/lib/passwd.ml b/lib/passwd.ml index 5ecca7c..d000587 100644 --- a/lib/passwd.ml +++ b/lib/passwd.ml @@ -2,6 +2,8 @@ open Ctypes open Foreign open PosixTypes +let ( |> ) a b = b a + type file_descr = unit ptr let file_descr : file_descr typ = ptr void diff --git a/lib/shadow.ml b/lib/shadow.ml index a960e30..0ec2521 100644 --- a/lib/shadow.ml +++ b/lib/shadow.ml @@ -2,6 +2,8 @@ open Ctypes open Foreign open PosixTypes +let ( |> ) a b = b a + type t = { name : string; passwd : string; diff --git a/test/opasswd_test.ml b/test/opasswd_test.ml index 55db0c8..7988e79 100644 --- a/test/opasswd_test.ml +++ b/test/opasswd_test.ml @@ -2,6 +2,9 @@ open Unix open OPasswd +let ( |> ) a b = b a +let ( @@ ) f g = f g + let tmp_shadow_file = Unix.getcwd () ^ "/dummy-shadow" let tmp_passwd_file = Unix.getcwd () ^ "/dummy-passwd"
_______________________________________________ Xen-api mailing list Xen-api@lists.xen.org http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api