WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] tools: ocaml build error

To: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] tools: ocaml build error
From: Christoph Egger <Christoph.Egger@xxxxxxx>
Date: Thu, 12 May 2011 14:53:51 +0200
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 12 May 2011 05:55:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1305201541.26692.487.camel@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4DCA5B85.7000500@xxxxxxx> <1305108976.26692.384.camel@xxxxxxxxxxxxxxxxxxxxxx> <4DCBBC27.3060506@xxxxxxx> <1305197840.26692.484.camel@xxxxxxxxxxxxxxxxxxxxxx> <4DCBC450.70805@xxxxxxx> <1305201541.26692.487.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; NetBSD amd64; en-US; rv:1.9.2.13) Gecko/20110202 Lightning/1.0b3pre Thunderbird/3.1.7
On 05/12/11 13:59, Ian Campbell wrote:
On Thu, 2011-05-12 at 12:28 +0100, Christoph Egger wrote:
With attached xen_tools_ocaml.diff  a xl.ml file is generated w/o
having sed complaining.

Thanks.

xl.mli is not generated at all.

I think that's a different issue to do with creating the file when the
sed actually failed. Fixed by creating a temporary and moving it into
place...

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

Looks correct to me.

Acked-by: Christoph Egger <Christoph.Egger@xxxxxxx>


8<---------------------------

# HG changeset patch
# User Ian Campbell<ian.campbell@xxxxxxxxxx>
# Date 1305201511 -3600
# Node ID 50728eaf50735b58d83484845312fe5467f6420c
# Parent  1e7ebf81f49d43b1a972ff31a284b80ac68f6f1b
tools: ocaml: remove non-posix-ism from sed script.

Christoph Egger reported than on NetBSD the build fails with

        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'

The following was tested by Christoph on NetBSD and also with GNU-sed
with and without the --posix flag.

In addition when sed fails will still create the output file, which confuses
subsequent make invocations. Generate to a temporary file and move into place
only on success.

Signed-off-by: Ian Campbell<ian.campbell@xxxxxxxxxx>

diff -r 1e7ebf81f49d -r 50728eaf5073 tools/ocaml/libs/xl/Makefile
--- a/tools/ocaml/libs/xl/Makefile      Thu May 12 11:39:55 2011 +0100
+++ b/tools/ocaml/libs/xl/Makefile      Thu May 12 12:58:31 2011 +0100
@@ -17,29 +17,33 @@ xl_C_OBJS = xl_stubs

  OCAML_LIBRARY = xl

-GENERATED_FILES += xl.ml xl.mli
+GENERATED_FILES += xl.ml xl.ml.tmp xl.mli xl.mli.tmp
  GENERATED_FILES += _libxl_types.ml.in _libxl_types.mli.in
  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\
   *)\
  ' \
            -e '/^(\* @@LIBXL_TYPES@@ \*)$$/r_libxl_types.ml.in' \
-       <  xl.ml.in>  xl.ml
+       <  xl.ml.in>  xl.ml.tmp
+       $(Q)mv xl.ml.tmp 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\
   *)\
  ' \
            -e '/^(\* @@LIBXL_TYPES@@ \*)$$/r_libxl_types.mli.in' \
-       <  xl.mli.in>  xl.mli
+       <  xl.mli.in>  xl.mli.tmp
+       $(Q)mv xl.mli.tmp xl.mli

  _libxl_types.ml.in _libxl_types.mli.in _libxl_types.inc: genwrap.py 
$(XEN_ROOT)/tools/libxl/libxl.idl \
                  $(XEN_ROOT)/tools/libxl/libxltypes.py





--
---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


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