LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 2886 - 2.4 pre-release test failures: ocaml bindings
Summary: 2.4 pre-release test failures: ocaml bindings
Status: RESOLVED FIXED
Alias: None
Product: new-bugs
Classification: Unclassified
Component: new bugs (show other bugs)
Version: unspecified
Hardware: PC Linux
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on: 2847 2931
Blocks:
  Show dependency tree
 
Reported: 2008-10-12 03:40 PDT by Török Edwin
Modified: 2008-10-23 00:54 PDT (History)
5 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Török Edwin 2008-10-12 03:40:54 PDT
+++ This bug was initially created as a clone of Bug #2847 +++

Some of these affect the 2.4 pre-release.

This bug is for the .ml test failures (all of them fail)

FAIL: /home/edwin/llvm2.4/llvm-2.4/test/Bindings/Ocaml/analysis.ml
Failed with unknown error (or has stderr output) at line 1
while running: /usr/bin/ocamlc.opt -cc g++ -I /home/edwin/llvm2.4/llvm-2.4/Release//lib/ocaml -warn-error A llvm.cma llvm_analysis.cma /home/edwin/llvm2.4/llvm-2.4/test/Bindings/Ocaml/analysis.ml -o analysis.ml.tmp
/tmp/camlprim60e068.c:914: warning: deprecated conversion from string constant to ‘char*’
/tmp/camlprim60e068.c:914: warning: deprecated conversion from string constant to ‘char*’
/tmp/camlprim60e068.c:914: warning: deprecated conversion from string constant to ‘char*’
/tmp/camlprim60e068.c:914: warning: deprecated conversion from string constant to ‘char*’
/tmp/camlprim60e068.c:914: warning: deprecated conversion from string constant to ‘char*’
/tmp/camlprim60e068.c:914: warning: deprecated conversion from string constant to ‘char*
...

$ ocamlc.opt -v
The Objective Caml compiler, version 3.10.2
Standard library directory: /usr/lib/ocaml/3.10.2

The test fails due to those warnings being output, otherwise the exitcode of that command is 0.
Those warnings are an ocaml issue, but the test shouldn't fail due to them.
Thoughts?
Comment 1 Török Edwin 2008-10-12 13:48:45 PDT
On TOT I now get this:

Failed with posix(ENOENT,no such file or directory) at line 1
while running: /usr/bin/ocamlc. opt -cc g++ -I /home/edwin/llvm-svn/llvm/Release//lib/ocaml -warn-error A llvm.cma llvm_bitreader.cma llvm_bitwriter.cma /home/edwin/llvm-svn/llvm/test/Bindings/Ocaml/bitreader.ml -o bitreader.ml.tmp
couldn't execute "/usr/bin/ocamlc.": no such file or directory


Notice the space between "ocamlc. opt", it is not supposed to be there, the program is called ocamlc.opt!
Comment 2 Gordon Henriksen 2008-10-14 02:33:14 PDT
The former is a bug in ocaml. Try upgrading to the latest from Inria; I think it's been fixed in more recent revisions. If that doesn't work, it might be possible to suppress the warnings by passing some extra -ccopt's to ocamlc.

The "ocaml .opt" problem is mysterious to me. First, check 'head config.log' to make sure you didn't misconfigure those by hand. Second, try modifying autoconf/configure.ac as below, regenerating, and seeing whether it results in improvement:

 DJ_AC_PATH_TCLSH
 AC_PATH_PROG(ZIP, [zip])
 AC_PATH_PROGS(OCAMLC, [ocamlc.opt ocamlc])
-AC_PATH_PROGS(OCAMLOPT, [ocamlopt])
-AC_PATH_PROGS(OCAMLDEP, [ocamldep])
-AC_PATH_PROGS(OCAMLDOC, [ocamldoc])
+AC_PATH_PROGS(OCAMLOPT, [ocamlopt.opt ocamlopt])
+AC_PATH_PROGS(OCAMLDEP, [ocamldep.opt ocamldep])
+AC_PATH_PROGS(OCAMLDOC, [ocamldoc.opt ocamldoc])
 
 dnl Determine if the linker supports the -R option.

That's the only point we look for .opt executables. I can't see how the above would introduce white space prior to the period, though. If it works after that change, we'll patch accordingly.
Comment 3 Gordon Henriksen 2008-10-14 02:34:20 PDT
My pseudo-patch is of course reversed. It should read:

 DJ_AC_PATH_TCLSH
 AC_PATH_PROG(ZIP, [zip])
 AC_PATH_PROGS(OCAMLC, [ocamlc.opt ocamlc])
-AC_PATH_PROGS(OCAMLOPT, [ocamlopt.opt ocamlopt])
-AC_PATH_PROGS(OCAMLDEP, [ocamldep.opt ocamldep])
-AC_PATH_PROGS(OCAMLDOC, [ocamldoc.opt ocamldoc])
+AC_PATH_PROGS(OCAMLOPT, [ocamlopt])
+AC_PATH_PROGS(OCAMLDEP, [ocamldep])
+AC_PATH_PROGS(OCAMLDOC, [ocamldoc])

 dnl Determine if the linker supports the -R option.
Comment 4 Török Edwin 2008-10-14 13:54:31 PDT
(In reply to comment #3)
> My pseudo-patch is of course reversed. It should read:
> 
>  DJ_AC_PATH_TCLSH
>  AC_PATH_PROG(ZIP, [zip])
>  AC_PATH_PROGS(OCAMLC, [ocamlc.opt ocamlc])
> -AC_PATH_PROGS(OCAMLOPT, [ocamlopt.opt ocamlopt])
> -AC_PATH_PROGS(OCAMLDEP, [ocamldep.opt ocamldep])
> -AC_PATH_PROGS(OCAMLDOC, [ocamldoc.opt ocamldoc])
> +AC_PATH_PROGS(OCAMLOPT, [ocamlopt])
> +AC_PATH_PROGS(OCAMLDEP, [ocamldep])
> +AC_PATH_PROGS(OCAMLDOC, [ocamldoc])
> 
>  dnl Determine if the linker supports the -R option.
> 

I tried applying that to configure.ac, but then I got all the wrong versions of autoconf/aclocal/libtool. I tried to upgrade the scripts with autoupdate, but then configure complained that it cannot find LLVM_PERL or something, so I gave up on that.

So I hacked configure, and removed ocamlopt.opt, which is what should have happened if I would have had the correct autoconf versions.
Could you apply the configure.ac patch, and regenerate configure please?

Now the failure message is back to the initial one.

(In reply to comment #2)
> The former is a bug in ocaml. Try upgrading to the latest from Inria; I think
> it's been fixed in more recent revisions. If that doesn't work, it might be
> possible to suppress the warnings by passing some extra -ccopt's to ocamlc.

I have the latest:
"The most recent version of Objective Caml is 3.10.2. It was released on 2008-02-29. "
$ ocamlc -v
The Objective Caml compiler, version 3.10.2
Standard library directory: /usr/lib/ocaml/3.10.2

> 
> The "ocaml .opt" problem is mysterious to me. First, check 'head config.log' to
> make sure you didn't misconfigure those by hand.

I have these:
ac_cv_path_OCAMLC=/usr/bin/ocamlc.opt
ac_cv_path_OCAMLDEP=/usr/bin/ocamldep.opt
ac_cv_path_OCAMLDOC=/usr/bin/ocamldoc.opt
ac_cv_path_OCAMLOPT=/usr/bin/ocamlopt.opt

maybe it is dejagnu not handling the . correctly, but then why does it work for you?
Comment 5 Tanya Lattner 2008-10-17 15:51:45 PDT
Gordon - Any more thoughts on this? I'd like to get a patch in (by 19th).

Comment 6 Chris Lattner 2008-10-21 22:56:48 PDT
2.3 had ocaml bindings, so we don't have the option of just disabling them in the release, right?
Comment 7 Chris Lattner 2008-10-22 00:55:31 PDT
Edwin, also did this work for you in 2.3?  Did these tests exist in 2.3?
Comment 8 Gordon Henriksen 2008-10-22 07:51:05 PDT
Remove the .opt executables from configure.ac.
http://llvm.org/viewvc/llvm-project?rev=57975&view=rev

Regenerate configure.
http://llvm.org/viewvc/llvm-project?rev=57976&view=rev

Redirect stderr from ocamlc to /dev/null.
http://llvm.org/viewvc/llvm-project?rev=57977&view=rev

Edwin, can you please check whether these resolve your issues?
Comment 9 Török Edwin 2008-10-22 09:56:25 PDT
(In reply to comment #8)
> Remove the .opt executables from configure.ac.
> http://llvm.org/viewvc/llvm-project?rev=57975&view=rev
> 
> Regenerate configure.
> http://llvm.org/viewvc/llvm-project?rev=57976&view=rev
> 
> Redirect stderr from ocamlc to /dev/null.
> http://llvm.org/viewvc/llvm-project?rev=57977&view=rev
> 
> Edwin, can you please check whether these resolve your issues?
> 

I assume you mean commits 57974, 57975, 57976. (yours numbers are off by one!).

Note that 57974 has to be manually applied because it conflicts on the 2.4 release branch, same for 57975 (I've regenerated configure myself).
[blame me, I've commited the solaris patch to trunk]

The latest release branch doesn't build for me (Bug 2931), once that is fixed I'll try this again.

(In reply to comment #7)
> Edwin, also did this work for you in 2.3?  Did these tests exist in 2.3?
> 

Yes it worked in 2.3. I had those warnings, but the checks didn't fail because of them.
Comment 10 Török Edwin 2008-10-22 10:05:53 PDT
(In reply to comment #9)
> The latest release branch doesn't build for me (Bug 2931), once that is fixed
> I'll try this again.

I've to SVN r57297 (just a random release in the past), and applied your patch.
Make check works on the Ocaml bindings now, thanks!

Should I close this bug or wait till the patch is merged to the prerelease branch.
Comment 11 Chris Lattner 2008-10-22 10:20:44 PDT
Awesome, please wait until the release branch is updated and verify from it.  Many thanks Edwin!
Comment 12 Tanya Lattner 2008-10-23 00:54:30 PDT
Merged into 2.4.