-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
stdenv: add pure Linux stdenv support for powerpc64le and sparc64 #141448
base: master
Are you sure you want to change the base?
stdenv: add pure Linux stdenv support for powerpc64le and sparc64 #141448
Conversation
Cool, I'm glad there are others interested in exotic platforms. Feel free to ping me for review on any related PRs. W.r.t. bootstrap tools, see also #115406. These always get held up because it's hard to verify that the bootstrap tools are reproducible - how do you do that for native bootstrap tools on a platform we don't support yet? But on the other hand, cross-compiled bootstrap tools won't build stdenv because of #113977, so I'm not really sure how to proceed here. Your first commit (b8eebed) looks pretty noncontroversial, if you'd like to split that off into a separate PR we could probably get that merged quickly and start playing around with cross-compiled sparc64 packages. |
Very true... it seems like there are three stages to building bootstrap tools:
Maybe there should be more automation around building these - like, on a system with qemu-binfmt, you have a derivation that runs through all three stages, though that requires having a way to inject the newly built bootstrap tools into nixpkgs. The first approach that comes to mind would be adding an argument to nixpkgsFun for the seeds, which probably wouldn't be a bad idea in general. I'd love to hear other people's thoughts on that though. |
d45e137
to
aba619a
Compare
stdenv = self.makeStaticLibraries self.stdenv; | ||
}).overrideAttrs (oa: { | ||
# Work around faulty stackprotector support in cross bootstrap tools | ||
hardeningDisable = (oa.hardeningDisable or []) ++ [ "stackprotector" ]; |
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.
See #113977 / #113977 (comment)
58f75c4
to
c1997a4
Compare
020ac9e
to
9468c68
Compare
9468c68
to
ad6841c
Compare
I have no clue if this is the right value, but it seems like it probably is
ad6841c
to
1e268db
Compare
platforms = [ | ||
"i386-linux" "x86_64-linux" | ||
"armv5tel-linux" "armv6l-linux" "armv7l-linux" "armv7a-linux" "aarch64-linux" | ||
"mipsel-linux" | ||
"powerpc64-linux" "powerpc64le-linux" | ||
"or1k-linux" | ||
"s390x-linux" | ||
"riscv64-linux" | ||
]; |
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 is basically platforms.linux? Or which platform is not supported? I can't tell. It would be way cleaner to substract the one or two not working platforms from platforms.linux or just write them into meta.broken.
@@ -1,5 +1,5 @@ | |||
{ lib | |||
, localSystem, crossSystem, config, overlays, crossOverlays ? [] | |||
, localSystem, crossSystem, config, overlays, crossOverlays ? [], ... |
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 we suddenly need to accept any input here and in the other files below? I don't think that is a good idea because it swallows mistakes like typos and makes.
@@ -0,0 +1,18 @@ | |||
# Stage 1 is to cross-compile seeds. |
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 and the 3 files below are very similar. Could we combine them?
@@ -0,0 +1,9 @@ | |||
# Usage: nix-build ./default.nix --argstr to powerpc64le-linux -A dist | |||
{ from ? builtins.currentSystem, to, nixpkgs ? import ../../../.. }: |
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.
That could break with flakes because currentSystem is not defined there.
if crossSystem == null | ||
then "-${localSystem.system}" | ||
else "-${localSystem.system}-to-${crossSystem.system}"; | ||
stageSuffix = if stage == null then "" else "-${stage}"; |
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.
stageSuffix = if stage == null then "" else "-${stage}"; | |
stageSuffix = lib.optionalString (stage != null) "-${stage}"; |
systemSuffix = | ||
if crossSystem == null | ||
then "-${localSystem.system}" | ||
else "-${localSystem.system}-to-${crossSystem.system}"; |
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.
systemSuffix = | |
if crossSystem == null | |
then "-${localSystem.system}" | |
else "-${localSystem.system}-to-${crossSystem.system}"; | |
systemSuffix = "-${localSystem.system}" + lib.optionalString (crossSystem != null) "-to-${crossSystem.system}"; |
Motivation for this change
I have a sparc64 system I want to try to get NixOS running on, and if I can get NixOS working well in a powerpc64le emulator, I'll consider getting a ppc64le server to play around with (and probably use as a Hydra buildbox so I can add ppc64le to my binary cache).
I've been building things for this branch on my Hydra instance as part of my nixfiles project/jobset: https://hydra.piperswe.me/jobset/nixfiles/main
The results of basically all of my builds go into my binary cache, so if you want to play around with this branch you can use my binary cache to speed things up:
Since changing stdenv requires rebuilding the world, I might also add a few more interesting architectures to this PR so that we have bootstrap tools for most architectures out there at the cost of one world rebuild.
Fixes #113977. Depends on #141451.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)