-
-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add libcxxStdenv attribute to recent llvm package sets #19859
Conversation
@bzizou You should be able to directly reference |
@copumpkin I think this removed darwin-unfriendly bits from libcxxStdenv, not sure how you guys are setting up to use libc++. |
Refs #19834 |
@shlevy I think we just do it via https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/darwin/default.nix#L280-L290 |
@shlevy : thank you! With that patch, I'ts now easy to reproduce the problem with boost: Build ok:
Build NOT ok:
Same errors as here: boost160libcxx.out.txt |
@bzizou perhaps diff that log against my successful build of 1.6 on darwin? http://hydra.nixos.org/build/42510536/nixlog/2/raw |
In a This command fails:
This one works (just added $NIX_CXXSTDLIB_COMPILE) :
It's just the path to the libcxx includes that is missing. Why does it occurs with clang > 3.7 ?
@copumpkin : thank you for the log, you have warnings that I don't have and vice versa. Unfortunately, your log does not show compilation commands like in my log (I think they are dumped only when errors occurs) |
I think that I found something! Here is a command issued by the clang wrapper, that fails:
If I start the same thing, but with the -isystem flag at the begining, then it works!:
|
Ugh that's terrible. @bzizou Can you open up an issue on the llvm tracker with those two command lines?This is almost certainly an llvm bug. |
I narrowed the problem and created a little bash script to reproduce the problem outside a specific environment:
I'm going to open an issue on llvm tracker... |
I'm wondering if it's really an llvm bug... or a feature. Maybe clang_37 didn't respect the order of the include paths declarations and clang_38 now does. It looks logical to load the c++ includes before the glibc ones... |
Unless there's a conflicting include in one vs the other, this definitely seems like a bug to me. the |
But it's probably a conflicting include... The error occurs when loading the
I asked an account to fill a bug report on llvm tracker (https://llvm.org/bugs/enter_bug.cgi), but no answer for now... |
Amazing, you need manual intervention to post a bug 😮 |
Well, I think it's a conflict with math.h: |
Hmm, it seems strange that libc++ has its own math.h. I wonder if that's a bug that's gone unnoticed because usually people use libc++ on OS X and maybe their libc just doesn't come with a math.h any more? It definitely doesn't seem right, I'd open the bug for that and see. |
But it has... since 3.8!!! Here we are!
|
Ah! libc++'s math.h has #include_next <math.h>. So it should come first. |
OK, then, so there's no bug into llvm... it's normal when we use "-isystem". |
|
I didn't say that -isystem is not correct. |
We should ensure libc++'s |
@copumpkin Any problem with putting NIX_CXXSTDLIB_COMPILE before the rest of the NIX_CFLAGS_COMPILE flags? |
I don't think so. You're going to get a full hydra build of the change before the merge to see if it breaks OSX? If not I can probably test it on my local Mac later. |
Wait, I'm confused. @bzizou Where did the |
Oh, I bet it's the cc wrapper setup hook finding the include dir, hmm. |
@shlevy : I got the |
Yeah, checking now and working on a fix. |
@bzizou Do you have a nixpkgs branch with |
@shlevy : no, but it's as simple as:
|
actually, I have a branch ;-) https://github.com/bzizou/nixpkgs/tree/irods4.2_libcxx_test |
Ah! This is because we have |
For the short term, Is there a way to override this or do we have to modify the boost package? |
OK, I found it: |
Well, if I understand, |
@bzizou See the logic where |
OK, sorry, so it's |
libiconv = if crossSystem != null then
(if crossSystem.libc == "glibc" then null
else if crossSystem.libc == "libSystem" then darwin.libiconv
else libiconvReal)
else if stdenv.isGlibc then null
else if stdenv.isDarwin then darwin.libiconv
else libiconvReal; |
Amazing! Very proud to be a NIX contributor! I finally managed to make iRods packages without modifications to boost and avro-c++. Thank you very much @shlevy @copumpkin for your precious help! |
Yeah 3.8 added a bunch of include_next calls that were painful for a while. For me it caused a bunch of pain a while back due to a bug in the cc-wrapper. Not sure if this is similar...
|
There's still the ongoing mystery of why it works on Darwin :) perhaps it's
|
Because libiconv is not glibc on darwin, so glibc is not added to buildinputs, so we get no isystem flag for the libc (we have the idirafter flag hard-coded into the cc wrapper) |
Yeah, sorry for those last two replies. I sent the emails ages ago and they only just showed up. GitHub weirdness. |
No description provided.