Summary: | =sys-devel/llvm-3.7.0[ocaml] fails to build with an older version of llvm[ocaml] installed - Error: The files ... make inconsistent assumptions over interface CamlinternalFormatBasics | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Olivier Huber <oli.huber> |
Component: | [OLD] Core system | Assignee: | Bernard Cafarelli <voyageur> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bkohler, kripton, mgorny, ml, rose |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | build.log |
Description
Olivier Huber
2015-09-05 05:31:33 UTC
Created attachment 411018 [details]
build.log
I had to compress the log because of the size (6.5 Mo)
Thanks for the report, looks like the USE=ocaml support is not good enough yet :(
The root cause is probably before the compile error, like in the lines:
> findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm
*** Bug 559940 has been marked as a duplicate of this bug. *** (In reply to Bernard Cafarelli from comment #2) > Thanks for the report, looks like the USE=ocaml support is not good enough > yet :( > > The root cause is probably before the compile error, like in the lines: > > findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm I agree that the cause is related to this findlib warning. Most likely ocamlfind uses the files found in the system instead of the one just built. Those warnings appear also earlier in the log, but the next command still works. I'm fine closing this bug as WONTFIX. I need to update llvm since it's blocking some other updates (mesa, wine, ...) and I'd like to use the latest clang for my code too. I think I'll update my llvm by the end of this week. If this is not fixed I'm just going to remove /usr/lib64/ocaml/llvm* before launching emerge again. Unfortunately I'm unable to provide any help. My ocaml knowledge is pretty limited ... My guess is that manpower is limited and this looks both non-trivial and not that important. Feel free to close it. Let's ask the ml people for help. Well, this is a valid bug: if llvm ocaml stuff builds against its installed ocaml stuff, it will never be able to be rebuilt, while it needs to be rebuilt to fix its ocaml stuf... Those errors happen when e.g. you update dev-lang/ocaml, or even an ocaml "library" used by your package. The ocaml compiler then considers having "libraries" linked against non matching versions as an error and you get what you see here. Correct fix is to make llvm[ocaml] link against the libraries it just built, not system ones, and is probably something to fix in their build system. (In reply to Alexis Ballier from comment #6) > > Correct fix is to make llvm[ocaml] link against the libraries it just built, > not system ones, and is probably something to fix in their build system. Do you have some hints to help finding the root cause ? The issue here is that some files are found in both a build dir and a system one. We want the ocaml stuff to use the ones in the build dir. By inspecting the build.log file, I found that findlib was complaining about having found *.cmi files in several directories before: $ xzgrep 'WARNING' build.log.xz findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm findlib: [WARNING] Interface llvm_CppBackend.cmi occurs in several directories: /usr/lib64/ocaml, . findlib: [WARNING] Interface llvm.cmi occurs in several directories: /usr/lib64/ocaml, /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm findlib: [WARNING] Interface llvm_CppBackend.cmi occurs in several directories: /usr/lib64/ocaml, . findlib: [WARNING] Interface llvm.cmi occurs in several directories: /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/llvm, /usr/lib64/ocaml findlib: [WARNING] Interface llvm_target.cmi occurs in several directories: /var/tmp/portage/sys-devel/llvm-3.7.0/work/llvm-3.7.0.src-abi_x86_64.amd64/bindings/ocaml/target, /usr/lib64/ocaml The command following this warning from findlib failed only for the last 2 instances. So my naive hypothesis is that whenever it finds several directories, it uses the last one. I tried to look for the behaviour of the ocaml tools in that case, but could not find where it was documented. Alexis could you shed some light on this ? I'd like to take a stab at it. Ah, but something I had overseen is that it finds llvm.cmi in /usr/lib64/ocaml! There is nothing you can do about this, ocaml will always find it there. This directory is more or less reserved for ocaml standard library (for this reason). Since it seems llvm installs a META file (for findlib), it should install it to a subdir of it (e.g. /usr/lib64/ocaml/llvm), which would prevent ocaml from using installed files since the build system doesn't seem to do anything wrong in that regard. llvm-3.7.0-ocaml-multilib.patch can be altered to fit that need. then, after properly scoping llvm ocaml bindings, 'ocamlfind list | grep llvm' should still list it, and packages using them (are there any?) should continue to work without any change. (In reply to Alexis Ballier from comment #8) > Ah, but something I had overseen is that it finds llvm.cmi in > /usr/lib64/ocaml! > There is nothing you can do about this, ocaml will always find it there. > This directory is more or less reserved for ocaml standard library (for this > reason). Since it seems llvm installs a META file (for findlib), it should > install it to a subdir of it (e.g. /usr/lib64/ocaml/llvm), which would > prevent ocaml from using installed files since the build system doesn't seem > to do anything wrong in that regard. > > llvm-3.7.0-ocaml-multilib.patch can be altered to fit that need. > > then, after properly scoping llvm ocaml bindings, 'ocamlfind list | grep > llvm' should still list it, and packages using them (are there any?) should > continue to work without any change. Thanks for the input. I've modified llvm-3.7.0-ocaml-multilib.patch to install into ${CMAKE_INSTALL_LIBDIR}/ocaml/llvm I removed every file that llvm had installed in /usr/lib64/ocaml and saved them. My plan was to update llvm, then test if this fixes the issue by replacing temporarily the new ocaml files with the old ones and recompile llvm. But I was stopped by this (unrelated) issue: https://bugs.gentoo.org/show_bug.cgi?id=561994 Just to be clear, are you able to build with USE=doc and the altered patch? I'd prefer fixing issues one at a time, especially when it comes to something I have almost no knowledge of :-). Well, let me change my question. Does it work after being installed like this? :-P (In reply to Michał Górny from comment #11) > Well, let me change my question. Does it work after being installed like > this? :-P I was able to "force merge" with the altered patch. It failed in the install phase because of https://bugs.gentoo.org/show_bug.cgi?id=562008 , but after removing one offending line I was able to resume the install with a emerge llvm-3.7.0-r1.ebuild merge and it was successful. Now since my computing time is limited, I'd rather do one merge to 1. try a fix for the aforementioned bug as well as testing 2. test if it can build with (out-of-date) ocaml bindings on ${ROOT}. and (finger crossed) it should work. Thanks for doing this. When you're done, please provide your final diff or pull request, and I'll gladly merge it. I'll probably update the patch along with 3.7.0-r2 bump (currently masked). The big question, though, do the bindings still work OK when moved to /usr/libXx/ocaml/llvm ? I do not use them and only can check that compilation is OK OK, can you test llvm-3.7.0-r2? ocaml files are now installed in /usr/libXx/ocaml/llvm Sadly for older installs, it will still exhibit the problem, so the ebuild now has this blocker: ocaml? ( !!<=sys-devel/llvm-3.7.0-r2[ocaml] ) I retested by going back to 3.6.2, and had to remove it to let 3.7.0-r2 compile. If ocaml bindings in their new location work fine for you, I'll unmask the -r2 ebuild (as it also includes some other fixes) (In reply to Bernard Cafarelli from comment #15) > OK, can you test llvm-3.7.0-r2? ocaml files are now installed in > /usr/libXx/ocaml/llvm > > Sadly for older installs, it will still exhibit the problem, so the ebuild > now has this blocker: > ocaml? ( !!<=sys-devel/llvm-3.7.0-r2[ocaml] ) > > I retested by going back to 3.6.2, and had to remove it to let 3.7.0-r2 > compile. > > If ocaml bindings in their new location work fine for you, I'll unmask the > -r2 ebuild (as it also includes some other fixes) Tested and approved. I did the following: I already had the ocaml bindings installed in /usr/lib64/ocaml/llvm/, so I created a local copy of 3.7.0-r2 to remove the blocker ocaml? ( !!<=sys-devel/llvm-3.7.0-r2[ocaml] ). I replaced the "good" ocaml files in /usr/lib64/ocaml/llvm/ with the ones from 3.6.1 that I had previously saved. It compiled just fine. I didn't find time last week to finish this. I wanted to mimic the LLVM_ENABLE_SPHINX logic for #562008, but it didn't happened ... Thanks to mgorny and you for handling this. (In reply to Olivier Huber from comment #16) > > Thanks to mgorny and you for handling this. And also Alexis :) Thanks for testing and helping here, 3.7.0-r2 is unmasked now :) |