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
Make gcc5 a nativeBuildInput for OpenCV. #27694
Conversation
Are you sure this has any effect? |
That's not the case, it's just badly named.
See the manual: https://nixos.org/nixpkgs/manual/#ssec-stdenv-attributes
…On Jul 28, 2017 12:08, "Tuomas Tynkkynen" ***@***.***> wrote:
Are you sure this has any effect? nativeBuildInputs should only have a
difference when cross compiling.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#27694 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAy0zx-48UuUZHTYCsSKy_RBG7MoXMk-ks5sSbMCgaJpZM4OlrPg>
.
|
@chpatrick the runtime/buildtime distinction has to do with where the code is supposed to be executed. If it is build-time only it must be compatible with the build machine; if it is run-time it must be compatible with the host machine (using gnu terminology). If |
I get that, but surely the native/cross distinction comes up much more
rarely (only cross compiling) than build time/runtime (any build,
especially important with nixops where closure size matters).
I think the naming contributes to people putting things in buildInputs
unnecessarily, as in this case. If buildInputs was called
runTimeDependencies people would think twice about putting gcc in there.
…On Jul 28, 2017 16:49, "Joachim F." ***@***.***> wrote:
@chpatrick <https://github.com/chpatrick> the runtime/buildtime
distinction has to do with where the code is supposed to be executed. If it
is build-time only it must be compatible with the build machine; if it is
run-time it must be compatible with the host machine (using gnu
terminology). If build=host, then buildInputs=nativeBuildInputs.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#27694 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAy0z3Co8_LKK-eFZhnyp65QVWWT6LxNks5sSfUMgaJpZM4OlrPg>
.
|
Absent enforcement, it makes no difference except for cross compilation. I agree with putting things in the correct variable, however, I was just elaborating on what I assumed @dezgeg was referring to. |
If you're building for the exact same architecture but a different physical machine, I don't believe that's considered cross compilation. However, This means that in the the most common case where you aren't cross compiling, |
That's not what I'm saying ... In that case Consider { stdenv, bc }:
stdenv.mkDerivation rec {
name = "native-capture";
nativeBuildInputs = [ bc ];
buildCommand = ''
echo $nativeBuildInputs >$out
'';
} The closure of the result will contain |
Anyway, more to the point, cc @mdaiter to review the change itself. |
This will most probably not change anything as @joachifm and @dezgeg have tried to explain, probably the resulting executable has a reference to gcc itself. That might possibly be needed, possibly only in a string. You might want to look at |
Motivation for this change
Previously
gcc5
was a runtime dependency ofopencv
if CUDA was enabled, this fixes that.Things done
Please check what applies. Note that these are not hard requirements but mereley serve as information for reviewers.
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)