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
Various small crossDrv fixes #24871
Various small crossDrv fixes #24871
Conversation
@elitak, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @vcunat and @DavidEGrayson to be potential reviewers. |
I have more mass-rebuild triggering cross-build fixes to glibc, gcc, etc that I've yet to stage. Should I make an effort to include them all here at once? |
As far as I can see, none of these actually cause mass rebuilds (for non-cross packages). So better to get them separately. |
In the coreutils package, I'm pretty sure you can simplify For kmod, I assume the reason you had to add the native xz to the front of the path was so you could hide the cross-built xz. I am kind of surprised that cross-built inputs have their binaries added to the PATH. Seems like you would almost never want that, and fixing the root of that problem in another pull request would be cool. Overall, the pull request seems fine to me. I'm not the best person to review this though, @Ericson2314 would be better. |
I made the coreutils change. Stdenv does need some rework to fix the general issue of having its PATH clobbered by crossDrv buildInputs. I've already opened an issue for this, but didn't get any input. I've just now added some proposals for fixing the issue: #21191 |
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.
Right idea, but in 2 places there's a more idiomatic way to acomplish the same thing --- sorry these idioms aren't very obvious in the future it should be better.
@@ -66,6 +66,6 @@ runCommand name | |||
passAsFile = if builtins.stringLength pkgs >= 128*1024 then [ "pkgs" ] else null; | |||
} | |||
'' | |||
${perl}/bin/perl -w ${./builder.pl} | |||
${perl.nativeDrv or perl}/bin/perl -w ${./builder.pl} |
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.
Use buildPackages.perl
.
@@ -14,13 +14,17 @@ in stdenv.mkDerivation rec { | |||
}; | |||
|
|||
nativeBuildInputs = [ autoreconfHook pkgconfig libxslt ]; | |||
buildInputs = [ xz /* zlib */ ]; | |||
buildInputs = [ xz ]; |
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.
Use nativeBuildInputs = [ xz ]
and no crossAttrs
.
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.
This derivation requires liblzma.so
from xz.crossDrv.out
, so I don't think that will work.
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec { | |||
++ optional aclSupport acl.crossDrv | |||
++ optional attrSupport attr.crossDrv | |||
++ optionals selinuxSupport [ libselinux.crossDrv libsepol.crossDrv ] | |||
++ optional (stdenv.ccCross.libc ? libiconv) | |||
++ optional (stdenv.ccCross or {} ? libc.libiconv) |
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.
Nice trick :)
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.
@DavidEGrayson's is nice too. I have no idea whether it works. These sort of "utility attrs" aren't very consistent in nixpkgs, sadly.
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.
The or {}
part is not needed. If you think ccCross
might not exist, you can do:
stdenv ? ccCross.libc.libiconv
I think that is just part of Nix syntax.
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.
I can't really remember, but I think the issue I originally ran into was that some part of that expression had a null
instead of just being absent, so that's what I came up with. I don't think I had considered putting more than 0 dots on the rhs of the ?
, though. I will just go with your last suggestion, if it works.
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.
I think the Nix or
operator doesn't help you when an attribute is set to null, unlike the "or" operations in a lot of other languages. The or
is just used to specify a backup value in case the attribute path you specified to the left cannot be evaluated because one of the attributes is missing. Anyway, I'm sure you are able to play around with it and find a simple expression that works.
Right this is aweful and should indeed be fixed, but would cause a mass rebuild. @elitak |
@Ericson2314, your branch's commits subsume commits from what branch? Do you mean you want to coordinate the native-mass-rebuild-triggering changes? I've got some small (but crucial to crossDrv) changes to glibc, I think, as well as some fixing the very broken mingw32 target platforms. I'll try to extricate these from my backlog and make it my next PR. Also take a look at the proposals on issue #21191 and tell me which you feel is best and I may PR a fix. |
Ooh, feel free to mention me with an @-sign when you make pull requests about cross-compiling for MinGW. I've done a lot of work in that area on a separate project. |
27d52ea
to
6d4ad0c
Compare
Okay, I think everything has been addressed and tested now. |
@elitak I mean most of those commits canned squashed as they are themselves broken and fixed by later commits. That makes the overall doff not so bad. And yeah, I want to first merge my "platform normalization PR", second rebase that non-breaking "ghc-android" branch, and third do the mass rebuild. If you have anything to stage with any of those three, I'm all ears! :) The first should be very interesting for you because windows target triples are subtle and I do not yet handle that complexity. |
Motivation for this change
Fixed and tested for armv5 cross builds.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)