xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Egger <Christoph.Egger@amd.com>
To: Ian Campbell <Ian.Campbell@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: tools: ocaml build error
Date: Thu, 12 May 2011 13:28:16 +0200	[thread overview]
Message-ID: <4DCBC450.70805@amd.com> (raw)
In-Reply-To: <1305197840.26692.484.camel@zakaz.uk.xensource.com>

[-- Attachment #1: Type: text/plain, Size: 1972 bytes --]

On 05/12/11 12:57, Ian Campbell wrote:
> On Thu, 2011-05-12 at 11:53 +0100, Christoph Egger wrote:
>> On 05/11/11 12:16, Ian Campbell wrote:
>>> On Wed, 2011-05-11 at 10:48 +0100, Christoph Egger wrote:
>>>> Hi,
>>>>
>>>> Compiling the ocaml fails:
>>>>
>>>> Parsing tools/ocaml/libs/xl/../../../../tools/libxl/libxl.idl
>>>> sed: 1: "1i(*\
>>>>     * AUTO-GENERATED ...": command i expects \ followed by test
>>>> gmake[7]: Leaving directory `tools/ocaml/libs/xl'
>>>
>>> I guess the sed script in tools/ocaml/libs/xl/Makefile has some
>>> non-posix-ism in it.
>>>
>>> Using gnu sed with --posix the following works for me (I dropped the
>>> --posix). Does it help ?
>>
>> I have to widthdraw my previous ack. The sed script didn't run because
>> of empty xm.ml and xm.mli files.
>>
>> After running gmake dist-clean and recompile I get this error:
>>
>> Parsing tools/ocaml/libs/xl/../../../../tools/libxl/libxl.idl
>> sed: 1: "1i\(*\
>>       * AUTO-GENERATED ...": extra characters after \ at the end of i command
>> gmake[7]: Leaving directory `tools/ocaml/libs/xl'
>
> Can you play a bit with your version of sed and see what makes it happy?
>
> Perhaps \n (suitable quoted) orjust a raw linefeed will work? If not
> maybe just stick the whole autogenerated tag on a single line, or use
> multiple i commands, or ....
>
> I guess it wouldn't be the end of the world to do:
> 	echo "(* AUTO GEN... mummble etc *)">  xl.ml
> 	sed -e '/^(\* @@LIBXL_TYPES@@ \*)$$/r_libxl_types.ml.in'<bla>>xl.ml
>

With attached xen_tools_ocaml.diff  a xl.ml file is generated w/o
having sed complaining.
xl.mli is not generated at all.

I attached xl.ml. Can you check if this is the expected result, please?

Christoph


-- 
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632

[-- Attachment #2: xen_tools_ocaml.diff --]
[-- Type: text/plain, Size: 691 bytes --]

diff -r 802b55c073e5 tools/ocaml/libs/xl/Makefile
--- a/tools/ocaml/libs/xl/Makefile	Thu May 12 12:13:10 2011 +0200
+++ b/tools/ocaml/libs/xl/Makefile	Thu May 12 13:26:54 2011 +0200
@@ -24,7 +24,8 @@ GENERATED_FILES += _libxl_types.inc
 all: $(INTF) $(LIBS)
 
 xl.ml: xl.ml.in _libxl_types.ml.in
-	$(Q)sed -e '1i(*\
+	$(Q)sed -e '1i\
+(*\
  * AUTO-GENERATED FILE DO NOT EDIT\
  * Generated from xl.ml.in and _libxl_types.ml.in\
  *)\
@@ -33,7 +34,8 @@ xl.ml: xl.ml.in _libxl_types.ml.in
 	  < xl.ml.in > xl.ml
 
 xl.mli: xl.mli.in _libxl_types.mli.in
-	$(Q)sed -e '1i(*\
+	$(Q)sed -e '1i\
+(*\
  * AUTO-GENERATED FILE DO NOT EDIT\
  * Generated from xl.mli.in and _libxl_types.mli.in\
  *)\

[-- Attachment #3: xl.ml --]
[-- Type: text/plain, Size: 6405 bytes --]

(*
 * AUTO-GENERATED FILE DO NOT EDIT
 * Generated from xl.ml.in and _libxl_types.ml.in
 *)
(*
 * Copyright (C) 2009-2011 Citrix Ltd.
 * Author Vincent Hanquez <vincent.hanquez@eu.citrix.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation; version 2.1 only. with the special
 * exception on linking described in file LICENSE.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *)

exception Error of string

type domid = int

(* @@LIBXL_TYPES@@ *)
(* AUTO-GENERATED FILE DO NOT EDIT *)
(* autogenerated by 
   genwrap.py /data/xen/xen-staging-netbsd.hg/tools/ocaml/libs/xl/../../../../tools/libxl/libxl.idl _libxl_types.mli.in _libxl_types.ml.in _libxl_types.inc
 *)

type domain_type = 
	 | DOMAIN_TYPE_FV
	 | DOMAIN_TYPE_PV

type device_model_version = 
	 | DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL
	 | DEVICE_MODEL_VERSION_QEMU_XEN

type console_type = 
	 | CONSOLE_TYPE_SERIAL
	 | CONSOLE_TYPE_PV

type console_backend = 
	 | CONSOLE_BACKEND_XENCONSOLED
	 | CONSOLE_BACKEND_IOEMU

type disk_format = 
	 | DISK_FORMAT_UNKNOWN
	 | DISK_FORMAT_QCOW
	 | DISK_FORMAT_QCOW2
	 | DISK_FORMAT_VHD
	 | DISK_FORMAT_RAW
	 | DISK_FORMAT_EMPTY

type disk_backend = 
	 | DISK_BACKEND_UNKNOWN
	 | DISK_BACKEND_PHY
	 | DISK_BACKEND_TAP
	 | DISK_BACKEND_QDISK

type nic_type = 
	 | NIC_TYPE_IOEMU
	 | NIC_TYPE_VIF

type action_on_shutdown = 
	 | ACTION_ON_SHUTDOWN_DESTROY
	 | ACTION_ON_SHUTDOWN_RESTART
	 | ACTION_ON_SHUTDOWN_RESTART_RENAME
	 | ACTION_ON_SHUTDOWN_PRESERVE
	 | ACTION_ON_SHUTDOWN_COREDUMP_DESTROY
	 | ACTION_ON_SHUTDOWN_COREDUMP_RESTART

type event_type = 
	 | EVENT_TYPE_DOMAIN_DEATH
	 | EVENT_TYPE_DISK_EJECT

type button = 
	 | BUTTON_POWER
	 | BUTTON_SLEEP

module Dominfo = struct
	type t =
	{
		uuid : int array;
		domid : domid;
		running : bool;
		blocked : bool;
		paused : bool;
		shutdown : bool;
		dying : bool;
		shutdown_reason : int;
		current_memkb : int64;
		max_memkb : int64;
		cpu_time : int64;
		vcpu_max_id : int32;
		vcpu_online : int32;
	}
end

module Vminfo = struct
	type t =
	{
		uuid : int array;
		domid : domid;
	}
end

module Version_info = struct
	type t =
	{
		xen_version_major : int;
		xen_version_minor : int;
		xen_version_extra : string;
		compiler : string;
		compile_by : string;
		compile_domain : string;
		compile_date : string;
		capabilities : string;
		changeset : string;
		virt_start : int64;
		pagesize : int;
		commandline : string;
	}
end

module Device_vfb = struct
	type t =
	{
		backend_domid : domid;
		devid : int;
		vnc : bool;
		vnclisten : string;
		vncpasswd : string;
		vncdisplay : int;
		vncunused : bool;
		keymap : string;
		sdl : bool;
		opengl : bool;
		display : string;
		xauthority : string;
	}
	external add : t -> domid -> unit = "stub_xl_device_vfb_add"
	external clean_shutdown : domid -> unit = "stub_xl_device_vfb_clean_shutdown"
	external hard_shutdown : domid -> unit = "stub_xl_device_vfb_hard_shutdown"
end

module Device_vkb = struct
	type t =
	{
		backend_domid : domid;
		devid : int;
	}
	external add : t -> domid -> unit = "stub_xl_device_vkb_add"
	external clean_shutdown : domid -> unit = "stub_xl_device_vkb_clean_shutdown"
	external hard_shutdown : domid -> unit = "stub_xl_device_vkb_hard_shutdown"
end

module Device_console = struct
	type t =
	{
		backend_domid : domid;
		devid : int;
		consback : console_backend;
		output : string;
	}
	external add : t -> domid -> unit = "stub_xl_device_console_add"
end

module Device_disk = struct
	type t =
	{
		backend_domid : domid;
		pdev_path : string;
		vdev : string;
		backend : disk_backend;
		format : disk_format;
		unpluggable : int;
		readwrite : int;
		is_cdrom : int;
	}
	external add : t -> domid -> unit = "stub_xl_device_disk_add"
	external del : t -> domid -> unit = "stub_xl_device_disk_del"
end

module Device_nic = struct
	type t =
	{
		backend_domid : domid;
		devid : int;
		mtu : int;
		model : string;
		mac : int array;
		ip : string;
		bridge : string;
		ifname : string;
		script : string;
		nictype : nic_type;
	}
	external add : t -> domid -> unit = "stub_xl_device_nic_add"
	external del : t -> domid -> unit = "stub_xl_device_nic_del"
end

module Device_pci = struct
	type t =
	{
		func : int;
		dev : int;
		bus : int;
		domain : int;
		vdevfn : int32;
		vfunc_mask : int32;
		msitranslate : bool;
		power_mgmt : bool;
	}
	external add : t -> domid -> unit = "stub_xl_device_pci_add"
	external remove : t -> domid -> unit = "stub_xl_device_pci_remove"
	external shutdown : domid -> unit = "stub_xl_device_pci_shutdown"
end

module Diskinfo = struct
	type t =
	{
		backend : string;
		backend_id : int32;
		frontend : string;
		frontend_id : int32;
		devid : int;
		state : int;
		evtch : int;
		rref : int;
	}
end

module Nicinfo = struct
	type t =
	{
		backend : string;
		backend_id : int32;
		frontend : string;
		frontend_id : int32;
		devid : int;
		state : int;
		script : string;
		mac : int array;
		evtch : int;
		rref_tx : int;
		rref_rx : int;
	}
end

module Physinfo = struct
	type t =
	{
		threads_per_core : int32;
		cores_per_socket : int32;
		max_cpu_id : int32;
		nr_cpus : int32;
		cpu_khz : int32;
		total_pages : int64;
		free_pages : int64;
		scrub_pages : int64;
		nr_nodes : int32;
		hw_cap : int32 array;
		phys_cap : int32;
	}
	external get : unit -> t = "stub_xl_physinfo_get"
end

module Sched_credit = struct
	type t =
	{
		weight : int;
		cap : int;
	}
	external domain_get : domid -> t = "stub_xl_sched_credit_domain_get"
	external domain_set : domid -> t -> unit = "stub_xl_sched_credit_domain_set"
end

(* END OF AUTO-GENERATED CODE *)

module Topologyinfo = struct
	type t =
	{
		core : int;
		socket : int;
		node : int;
	}
	external get : unit -> t = "stub_xl_topologyinfo"
end

external button_press : domid -> button -> unit = "stub_xl_button_press"


external send_trigger : domid -> string -> int -> unit = "stub_xl_send_trigger"
external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
external send_debug_keys : domid -> string -> unit = "stub_xl_send_debug_keys"

let _ = Callback.register_exception "xl.error" (Error "register_callback")

[-- Attachment #4: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

  reply	other threads:[~2011-05-12 11:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-11  9:48 tools: ocaml build error Christoph Egger
2011-05-11 10:16 ` Ian Campbell
2011-05-11 10:14   ` Christoph Egger
2011-05-11 10:45     ` Ian Campbell
2011-05-11 11:26       ` Christoph Egger
2011-05-11 11:45       ` Christoph Egger
2011-05-12 10:53   ` Christoph Egger
2011-05-12 10:57     ` Ian Campbell
2011-05-12 11:28       ` Christoph Egger [this message]
2011-05-12 11:59         ` Ian Campbell
2011-05-12 12:53           ` Christoph Egger
2011-05-18  8:32             ` Christoph Egger
2011-05-18  8:49               ` Ian Campbell
2011-05-24 10:08                 ` Christoph Egger
2011-05-24 10:46                   ` Ian Jackson
2011-05-24 16:52             ` tools: ocaml build error [and 1 more messages] Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DCBC450.70805@amd.com \
    --to=christoph.egger@amd.com \
    --cc=Ian.Campbell@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).