Test problems with ocaml 4.01.0

26 views
Skip to first unread message

Ignas Vyšniauskas

unread,
Mar 27, 2014, 7:52:09 AM3/27/14
to pi...@googlegroups.com
Hi,

We updated from ocaml 3.11 to 4.01 and I'm now seeing weird piqi test failures on our build machines as part of the piqi RPM package build.
Unfortunately, I can *not* reproduce this locally with exactly the same versions of ocaml / camlp4, so I have no idea what is actually going wrong.

All tests seem to pass, except for the ones that need to parse piq data without "constructors", e.g. these are the failures:

From test_getopt:

    + piqi getopt --type bool -- true
    argv:0:1: a scalar value expected for type "bool"

    + piqi getopt --type int -- -10
    argv:0:1: int constant expected
   
    + piqi getopt --type complex/t -- 0 0
    argv:0:1: missing field "im"

and possibly more, but I disabled test_getopt completely at this point.

Then got failures from test_piqi_server:

    + piqi call 'piqi server/add-piqi' -- --format pb --data @t.piqi.pb
    argv:0:1: missing field "format"

All the other tests pass. The tests fail with both a version of piqi that used to build fine and the latest master and the only thing that changed are the ocaml versions.

Any clue what could be happening here? Something I could try to further debug this? I'm kind of in the dark, because I can't reproduce it locally.
The only difference is that my env is Debian and the build env is RPM based. Though the ocaml versions are identical.

Thanks,
Ignas

Anton Lavrik

unread,
Mar 28, 2014, 1:57:31 AM3/28/14
to pi...@googlegroups.com
Hi Ignas,

I have no idea... You may want to step/printf through the code to see what is actually going on. This should be easy -- it should take only a couple of steps in these cases. Another thing to try is running it with --debug 3 or --trace. It may help you to spot the differences.

Also, errors like 'a scalar value expected' are clearly from some older version. You definitely want to use master for this exercise.

Would be curios to know what causes it. Please share your findings.

Anton



--
You received this message because you are subscribed to the Google Groups "piqi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to piqi+uns...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ignas Vyšniauskas

unread,
Mar 28, 2014, 7:56:16 AM3/28/14
to pi...@googlegroups.com
Hi Anton,

After a long battle, I believe I found the issue.

I realised that, for some reason, the first argument after `--` was simply skipped in all `getopt`-related functionality under this specific RPM package of ocaml. I added some debug prints[1] and found out that, with the Debian ocaml 4.01.0 package I get this output:

$ piqi getopt --type bool -- true
rest_fun: i: 5 true
DEBUG: argv_start_index: 5
argv[0]: ./bin/piqi
argv[1]: getopt
argv[2]: --type
argv[3]: bool
argv[4]: --
argv[5]: true
:bool true

while with the RPM package I get this:

$ piqi getopt --type bool -- true
rest_fun: i: 6 true
DEBUG: argv_start_index: 6
argv[0]: piqi
argv[1]: getopt
argv[2]: --type
argv[3]: bool
argv[4]: --
argv[5]: true
argv:0:1: boolean constant expected

Apparently, RPM maintainers decided to include a custom patch to Ocaml's Arg library[2]:
* Thu Nov 21 2013 Richard W.M. Jones <rjo...@redhat.com> - 4.01.0-4
 - Add NON-upstream (but being sent upstream) patch to allow --flag=arg as an alternative to --flag arg (RHBZ#1028650).
RHBZ issue: https://bugzilla.redhat.com/show_bug.cgi?id=1028650
Ocaml issue: http://caml.inria.fr/mantis/view.php?id=5197

I'll try rolling back to something <4.01.0-4 and confirm that this is indeed the root cause.

Not sure how this should be handled and whether some workaround in piqi is viable.
Maybe the custom RPM patch is just buggy and should be rejected, did not investigate any further.

Regards,
Ignas

Anton Lavrik

unread,
Mar 29, 2014, 7:31:00 PM3/29/14
to pi...@googlegroups.com
Hi Ignas,

Wow. This looks like a bug in the OCaml patch to me. I emailed the patch author, Richard Jones, to confirm and asked him if there is a workaround. Let's see what he thinks.

As a possible solution, you can build the RPM package on Ubuntu/Debian instead of doing this on Fedora. For instance, the RPM-building scripts from https://github.com/piqi/piqi-rpm work on Debian if you use rpmbuild --nodeps flag. I usually uncomment it here: https://github.com/piqi/piqi-rpm/blob/master/Makefile#L17

Anton



--

Anton Lavrik

unread,
Apr 1, 2014, 5:07:58 AM4/1/14
to pi...@googlegroups.com
On Sat, Mar 29, 2014 at 4:31 PM, Anton Lavrik <ala...@piqi.org> wrote:
Hi Ignas,

Wow. This looks like a bug in the OCaml patch to me. I emailed the patch author, Richard Jones, to confirm and asked him if there is a workaround. Let's see what he thinks.

Reply all
Reply to author
Forward
0 new messages