-
-
Notifications
You must be signed in to change notification settings - Fork 18k
stdenv: add sparc64 cross-compilation support #141451
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
base: master
Are you sure you want to change the base?
Conversation
|
@r-burns here's the trivial changes from the other pr! |
| lib = import ./lib; | ||
|
|
||
| systems = lib.systems.supported.hydra; | ||
| systems = lib.platforms.all; |
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 the only part I'm not sure about, because I don't use flakes. does this just mean that you're allowed to evaluate nixpkgs on all platforms?
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.
yep!
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.
Hmm, well I guess I don't understand why this would ever be limited in the first place. So platforms.all seems sensible
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.
cc @zimbatm
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.
If a flakes person can confirm this is OK, this PR looks good to me. Or we can just punt on this, because I AFIAK this the thing the about flakes in general that's being debated right now.
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'm testing this through my personal github:piperswe/nixfiles flake on my personal Hydra instance, so I need flake support for this arch for those Hydra jobs to evaluate. I suppose I could add a non-flake jobset for these arches, but that is an added level of complexity that seems unnecessary if we can just export all platforms.
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.
OK then we should not change this for now.
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'm 90% sure that this should not be changed. systems is like the system field of derivations (= the system/localSystem argument to nixpkgs) meaning the platform the derivation is built on. Consequently lib.systems.supported.hydra is Tier 3 and above, meaning all platforms for which a native stdenv is available.
For a jobset system can't be sparc64-linux atm anyways, as a native stdenv is not available, but rather pkgsCross needs to be used or crossSystem passed (which is not possible with flakes however as far as I know).
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 change doesn't seem necessary given that sparc64-linux is only built using pkgsCross as @sternenseemann said.
The main thing you want to check is to see if nix flakes check keeps working after the change. It might also cause more/slower evaluation to have all the systems available.
|
This looks great to me, I was able to build the cross bootstrap tools and cross-compile some basic packages. Once this is merged the cross-trunk job will start building cross bootstrap tools for this platform so we'll have the cross stdenv in the cache. cc @NixOS/exotic-platform-maintainers |
alyssais
left a comment
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.
Hi! It's always nice to see new platforms being added. I've reviewed the changes in lib (I'm not an expert on the other parts of Nixpkgs being changed here), and I have some changes to request.
-
Please maintain the alphabetical sorting in doubles.nix.
-
When adding new architectures, we should add them to doubles.nix for all operating systems that support that architecture. FreeBSD, OpenBSD, and NetBSD all appear to support sparc64.
-
Please add a
filterDoublesline in doubles.nix for sparc64. -
Going forward, I think platform examples contain the operating system name, because we support multiple operating systems (and hopefully increasingly so in future). So I think "sparc64-linux" would be a better name than "sparc64".
|
Cross-compiling GNU Hello on darwin works ( |
|
Great work on the doubles, thanks! I'm still hoping we can get some clarity on the flakes thing — setting it to the tier3 platforms only happened recently, and I'd like to understand why that was done (which required that list to be created in the first place) instead of the much simpler solution of platforms.all. |
Ah, I didn't notice that was a recent change. @zimbatm is there a reason why the flake doesn't export every platform? |
|
Thank you @piperswe for making this PR! I'm excited to see sparc64 support in Nixpkgs |
|
This is GTG apart from the flake.nix change, right? Could we just drop that for now, merge this, and have a separate PR for that change where it might be easier to get the attention of flakes experts? |
|
Bumping: Can we get this rebased and the flake change dropped? |
Motivation for this change
These are the trivial changes from #141448.
nix build 'github:piperswe/nixpkgs/piper/add-sparc64#pkgsCross.sparc64-linux.hello'Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)