-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation failure on centos 7 #761
Comments
Probably a duplicate of #760. Is this in a container or other environment I could easily access to reproduce it? |
I was not able to reproduce this in |
I did 100 installs inside the container, and wasn't able to observe this. Is this a sporadic failure, or does it happen consistently for you? |
The issue happens consistently with the 5.* versions. |
I can't seem to eyeball it, nor reproduce it (if you can, please describe your setup or environment). I was also installing without conf-libev. Here are some links. The immediate code: Lines 90 to 104 in 7be56db
Changes between 4.5.0 and 5.0.0 (nothing looks directly related to me): f38996e#diff-e278928a82c89ddd5ca43ac7ec7e08c8. The commit in that range that seems most relevant to me, though still likely a red herring: 047e01a#diff-1573f3888bdb422f2109b0c08ffff260 Recent changes to
Have you tested specifically with 5.0.0, which is what I am taking the mention of 5.* to imply? |
The issue only happens when installing lwt with opam. It seems to be related to sandboxing. This is the command ran by opam:
|
I've tested all versions with major version 5. |
I think I've figured out the issue. In my setup, the opam sandbox make opam (the binary) unavailable. |
It must be caused by this change: 17e04a9#diff-e278928a82c89ddd5ca43ac7ec7e08c8R401-R402. Thinking about the best course of action... |
However, I still can't eyeball why that would affect pthread detection, so perhaps that is not the cause. But I would suggest to start there debugging the discover script. |
Currently, I reproduced it with a Docker container |
I just cannot seem to be able to reproduce this. I created a fresh VM and installed Docker in it, then:
This works. Can you try this? Do you see a difference between what I am doing and your commands? Is there something I should show or try? |
Ok, I tried to reproduce the result with a truly sandboxed OPAM - Currently: $ docker run -it --rm --privileged --cap-add=CAP_SYS_ADMIN ocaml/opam2:ubuntu-18.04
# rm -r ~/.opam
# rm ~/.opamrc
# sudo sysctl kernel.unprivileged_userns_clone=1
# opam init
# opam install lwt I did the same things on |
@dinosaure, it's not clear to me from your post, do those commands trigger the Lwt install failure, or result in no failure? (edit: or something else?) |
Results in no failure, but if the problem is related to |
The code in test.c is about pthread, but the actual compiler commandline includes a trailing '-lev'. --- a/src/unix/config/discover.ml
+++ b/src/unix/config/discover.ml
@@ -446,7 +446,7 @@ struct
C_library_flags.add_link_flags ["-lev"];
Some true
| _ ->
- C_library_flags.detect context ~library:"ev";
+ C_library_flags.detect context ~library:"dl";
compiles context code
end
} |
AFAICT the entire surrounding code, including the C code, is about libev: lwt/src/unix/config/discover.ml Lines 434 to 450 in 679f92c
What |
--- a/src/unix/config/discover.ml
+++ b/src/unix/config/discover.ml
@@ -255,7 +255,7 @@ struct
["-I" ^ (path // "include")]
["-L" ^ (path // "lib"); "-l" ^ library]
with Not_found ->
- extend [] ["-l" ^ library]
+ extend [] [] (*["-l" ^ library]*)
let ws2_32_lib context =
if Configurator.ocaml_config_var_exn context "os_type" = "Win32" then |
The arguments are indeed accumulated and applied to further tests at the moment. However, I am unable to follow the rest of the description. Which |
Also, are you observing this specific issue? If so, could you describe your environment or what steps you take to reproduce it, as I haven't been able to do so myself? |
This is with dune 1.11.4 and ocaml-4.05. According to my strace of |
Is there a libev.so on your system, which would mask the bug? |
No, the reason this bug is masked (I haven't yet confirmed it, but I am starting to see what you mean), is that almost everyone is using opam, and we have |
...or perhaps it the same. I would really appreciate a direct answer to whether you are observing the problem in this specific issue, or else a paste of your output, as it helps me to reason about the other messages.
|
Yes, also for me compilation fails because pthread is not detected, which leads to |
Thanks :) I'm about to try your command in a container, and I've started to see what the bug likely is. Hopefully, I'll soon have reproduced it, and, if so, I'll probably fix it with the rewrite/refactor over the weekend or at the start of next week. |
I wasn't able to reproduce this. I did:
The build succeeded. I saw in the output that I checked using I have enough from your comments to look into how else to trigger this for now, I think. And In the meantime, can you tell me more about your environment? I understand that you are installing dependencies manually and not through opam. Is there a reasonable way for me to access the state before the |
Ah, right after writing that, it occurred to me to delete the |
This patch is a variant of the one in #761 (comment) See #760, #761.
@olafhering I applied your patch (with slight edit) from #761 (comment), and it seems to have fixed the issue. Once I started looking into refactoring I assume you've already confirmed that this fixes it for you. If not, please try the I will merge this shortly and do a release. As for why the broken call to That it was broken was masked by several factors, but other recent changes to |
There will still be the problem (not yet reported) that if |
This change works for me. Thanks! |
Instead, pass information about the presence of conf-libev down from opam on the discover.ml command line. See #761 (comment).
The fix was released in Lwt 5.1.2 about a week ago. |
Note that I can install lwt.4.5 without issue
The text was updated successfully, but these errors were encountered: