[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#580041: FTBFS with OCaml 3.12 because of undeclared overridden methods



Package: src:sks
Version: 1.1.1-2
Severity: normal
User: debian-ocaml-maint@lists.debian.org
Usertags: ocaml312-ftbfs

Hello,

While rebuilding all packages with a SVN snapshot of OCaml (version
3.12.0+dev17, revision 10268), your package failed to build on amd64.

Relevant part:
> ocamlopt -I lib -I bdb -I +cryptokit  -ccopt -Lbdb -dtypes -ccopt -pthread -warn-error A -inline 40 unix.cmxa str.cmxa bdb.cmxa nums.cmxa bigarray.cmxa cryptokit.cmxa  -c channel.ml
> File "channel.ml", line 212, characters 2-36:
> Warning 7: the method read_string is overridden.
> File "channel.ml", line 253, characters 2-159:
> Warning 7: the method read_string is overridden.
> File "channel.ml", line 278, characters 2-145:
> Warning 7: the method read_byte is overridden.
> File "channel.ml", line 1, characters 0-1:
> Error: Error-enabled warnings (3 occurrences)
> make[1]: *** [channel.cmx] Error 2
> make[1]: Leaving directory `/tmp/sks-1.1.1/build-tree/sks-1.1.1'

The full build log is available at:
  http://debian.glondu.net/debian/ocaml31120dev17r10268/failures/sks_1.1.1-2%2B3.12.0%2Bdev17%2B10268_amd64.build

As said in the attached patch:

> OCaml 3.12 introduces a new warning for undeclared overridden methods,
> that makes sks FTBFS because of error-enabled warnings. This patch
> should fix the issue. However, it seems that camlp4o doesn't cope well
> with the new syntax (see [1]), so sks doesn't build yet with this
> patch.
>
> Note: I believe this is the "right" fix, but it is not
> backward-compatible with OCaml < 3.12. The only backward-compatible
> fix I can think of would be to disable error-enabled warnings
> (i.e. compile without -warn-error A).
>
> [1] http://caml.inria.fr/mantis/view.php?id=5042

I do not tag this bugreport with patch because sks doesn't build with
it, but I submit it nonetheless for future reference.


Best regards,

-- 
Stéphane


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
>From bc08b0b70f67a0673dde3db83d8d0671b13e702a Mon Sep 17 00:00:00 2001
From: Stephane Glondu <steph@glondu.net>
Date: Mon, 3 May 2010 11:50:34 +0200
Subject: [PATCH] Add 250_ocaml312

OCaml 3.12 introduces a new warning for undeclared overridden methods,
that makes sks FTBFS because of error-enabled warnings. This patch
should fix the issue. However, it seems that camlp4o doesn't cope well
with the new syntax (see [1]), so sks doesn't build yet with this
patch.

Note: I believe this is the "right" fix, but it is not
backward-compatible with OCaml < 3.12. The only backward-compatible
fix I can think of would be to disable error-enabled warnings
(i.e. compile without -warn-error A).

[1] http://caml.inria.fr/mantis/view.php?id=5042
---
 debian/patches/250_ocaml312 |   49 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 49 insertions(+), 0 deletions(-)
 create mode 100644 debian/patches/250_ocaml312

diff --git a/debian/patches/250_ocaml312 b/debian/patches/250_ocaml312
new file mode 100644
index 0000000..55a06d0
--- /dev/null
+++ b/debian/patches/250_ocaml312
@@ -0,0 +1,49 @@
+--- sks-1.1.1-old/channel.ml
++++ sks-1.1.1/channel.ml
+@@ -209,7 +209,7 @@ object (self)
+ 
+   method close = close_in cin
+   method read_all = read_all cin () 
+-  method read_string len = input len 
++  method! read_string len = input len 
+   method read_string_pos ~buf ~pos ~len = 
+     let s = input len in
+     String.blit ~src:s ~dst:buf ~src_pos:0 ~dst_pos:pos ~len
+@@ -250,7 +250,7 @@ object (self)
+   val slength = String.length string
+   val mutable pos = pos
+ 		      
+-  method read_string len = 
++  method! read_string len = 
+     if pos + len > slength then raise End_of_file;
+     let rval = String.sub string ~pos ~len in
+       pos <- pos + len;
+@@ -275,7 +275,7 @@ object (self)
+       pos <- pos + 1;
+       char
+ 
+-  method read_byte =
++  method! read_byte =
+     if pos + 1 > slength then raise End_of_file;
+     let byte = int_of_char string.[pos] in
+       pos <- pos + 1;
+--- sks-1.1.1-old/meteredChannel.ml
++++ sks-1.1.1/meteredChannel.ml
+@@ -47,7 +47,7 @@ object (self)
+     self#incr 1
+ 
+   method flush : unit = outc#flush
+-  method upcast = (self :> Channel.out_channel_obj)
++  method! upcast = (self :> Channel.out_channel_obj)
+   method reset = count <- 0
+   method bytes = count
+ 
+@@ -78,7 +78,7 @@ object (self)
+     self#incr 1;
+     inc#read_byte
+ 
+-  method upcast = (self :> Channel.in_channel_obj)
++  method! upcast = (self :> Channel.in_channel_obj)
+   method reset = count <- 0
+   method bytes = count
+ 
-- 
1.7.0


Reply to: