Fix build with ocaml 4.04
ClosedPublic

Authored by joselema on Jul 17 2017, 1:12 PM.

Details

Summary

Hi,

kalzium doesn't build with ocaml 4.04, see:
https://bugs.kde.org/show_bug.cgi?id=372671

Test Plan

The proposed patch was tested in our work in progress kubuntu's packaging; it fixes the build with ocaml 4.04 and apparently it doesn't break compilation against earlier ocaml versions.

Diff Detail

Repository
R326 Kalzium
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
joselema created this revision.Jul 17 2017, 1:12 PM
joselema added a reviewer: KDE Developers.
joselema edited reviewers, added: KDE Edu; removed: KDE Developers.Jul 17 2017, 2:25 PM
apol added a subscriber: apol.Jul 17 2017, 2:29 PM

I'd gladly give you a +1 but I have no idea about ocaml, maybe you can point us to the documentation?
Apparently this is something that changed in ocaml eventually...

cfeck added a subscriber: cfeck.EditedJul 17 2017, 2:33 PM

The referenced bug report has a link that documents the ocaml change (in a rather too verbose way).

EDIT: What has to be tested is if this change still allows it to be built with previous ocaml versions. Test plan included this test.

arojas added a subscriber: arojas.Jul 17 2017, 3:48 PM

This seems to fix this specific error, but now the build fails with a different error (using ocaml 4.05)

File "/build/kalzium/src/kalzium-17.04.3/src/solver/chem.ml", line 1:
Error: The files /usr/lib/ocaml/pervasives.cmi

and /usr/lib/ocaml/facile/facile.cmi make inconsistent assumptions
over interface Pervasives

make[2]: * [src/CMakeFiles/kalzium.dir/build.make:182: src/chem.cmx] Error 2
make[2]:
* Waiting for unfinished jobs....
make[1]: * [CMakeFiles/Makefile2:3087: src/CMakeFiles/kalzium.dir/all] Error 2
make[1]:
* Waiting for unfinished jobs....

This seems to fix this specific error, but now the build fails with a different error (using ocaml 4.05)

File "/build/kalzium/src/kalzium-17.04.3/src/solver/chem.ml", line 1:
Error: The files /usr/lib/ocaml/pervasives.cmi

and /usr/lib/ocaml/facile/facile.cmi make inconsistent assumptions
over interface Pervasives

make[2]: * [src/CMakeFiles/kalzium.dir/build.make:182: src/chem.cmx] Error 2
make[2]:
* Waiting for unfinished jobs....
make[1]: * [CMakeFiles/Makefile2:3087: src/CMakeFiles/kalzium.dir/all] Error 2
make[1]:
* Waiting for unfinished jobs....

Have you tried to rebuild facile on top of your latest ocaml 4.05 before building kalzium?

Have you tried to rebuild facile on top of your latest ocaml 4.05 before building kalzium?

That was it, sorry for the noise. I can confirm that the patch fixes the build of the solver.

fixes the problem for me on gentoo using ocaml-4.04.2

cfeck accepted this revision.Jul 31 2017, 1:30 AM

Can you commit to 17.08 branch?

This revision is now accepted and ready to land.Jul 31 2017, 1:30 AM
cfeck added a comment.Aug 3 2017, 3:42 PM

No response. I will commit it for you.

This revision was automatically updated to reflect the committed changes.