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
R: add libcxx to default LDFLAGS and CPPFLAGS on Darwin #34651
Conversation
@@ -61,6 +61,12 @@ stdenv.mkDerivation rec { | |||
echo >>etc/Renviron.in "TZDIR=${tzdata}/share/zoneinfo" | |||
''; | |||
|
|||
postBuild = stdenv.lib.optionalString stdenv.isDarwin '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you make that change post build? Shouldn't that be post configure?
@@ -61,6 +61,12 @@ stdenv.mkDerivation rec { | |||
echo >>etc/Renviron.in "TZDIR=${tzdata}/share/zoneinfo" | |||
''; | |||
|
|||
postBuild = stdenv.lib.optionalString stdenv.isDarwin '' | |||
sed -i etc/Makeconf \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does R not have some configure
flag that allows us to configure those paths? Messing with the internals of the build state feels somewhat fragile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes R does. ./configure --help
says
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
51713dd
to
f4a031c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange that this is necessary since libc++ is part of the darwin stdenv, but the fix looks good.
@GrahamcOfBorg build R rPackages.rstan |
Failure on aarch64-linux (full log) Partial log (click to expand)
|
Success on x86_64-linux (full log) Partial log (click to expand)
|
Success on x86_64-darwin (full log) Partial log (click to expand)
|
Is it better to add |
No, I think that would be worse. I'd try to stay away from these magic hidden variables as much as possible. If you run R's configure script with |
Ah, I see you changed the PR already to do exactly that. Very cool, thank you. |
Motivation for this change
I am not sure this is the best solution for #34615 but it is sufficient to change LDFLAGS and CPPFLAGS in
lib/R/etc/Makeconf
:Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)