-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Rust-overlay seem to confuse $NIX_LDFLAGS when cross-compiling? #40
Comments
This is the only change between the two outputs as well, nothing else changed. |
This was introduced in d3956f0 and it seems to be using a "targettarget" dependency, "A list of dependencies whose host platform matches the new derivation's target platform". This is not true for example for Shouldn't things like |
Furthermore, should the code really be using |
Actually, it doesn't matter. Since rustc is a cross compiler, which itself support multiple target. The only difference is what std libraries are packed in final derivation by us ( Consider: you are on darwin, you select both darwin's and linux's std, so that you can both compiling native binaries and cross compiling linux binaries. In this case, we can only decide whether to include BTW: the |
Hmm, but stdenv/setup seems to disagree. I have fixed the liviconv dependency on the build platform (darwin in my case) by adding it to depsBuildBuild (it is only needed when actually building for Darwin (or for build.rs) not when cross-compiling to for example Windows). And libiconv should not be in NIX_LDFLAGS, that is wrong. I.e. libiconv for macOS should not show up as a link argument to a windows binary, which it currently does! Unfortunately, the introduction of the cross compile fixes mentioned above renders this overlay unusable for us when it worked fine before that :( |
Do you mean to change this into:
Sorry I'm not an expert of cross compilation nor a mac user. If you already made it work, PR is welcome! |
Yes, that is what I meant. I can whip up a PR tomorrow :) |
In short, I think the platforms are mixed up here (and they do have confusing names, I agree). From the manual on cross-compilation: "In summary, build is the platform on which a package is being built, host is the platform on which it will run. The third attribute, target, is relevant only for certain specific compilers and build tools (read gcc, binutils)." Host is the one that tripped me up initially that it is not the platform we are currently on, instead it is the host platform of the new derivation. |
PR in #41 |
I have an issue that I cannot quite make sense of. We updated this overlay from 0bcf4e7 to be2d768 and that changed the content in $NIX_LDFLAGS somehow?
0bcf4e7:
be2d768:
The latter erroneously contains build platform dependencies. How can this overlay change that?
The text was updated successfully, but these errors were encountered: