Skip to content
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

mips64: bootstrap-files #161927

Closed
wants to merge 5 commits into from
Closed

mips64: bootstrap-files #161927

wants to merge 5 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Feb 26, 2022

It turns out that the bootstrap-files.tar.xz can be generated without this PR, and the remainder of this PR should wait until the Hydra-generated hash values for bootstrap-files.tar.xz are available, so I am closing this PR.

This PR is currently marked as "draft" while I check that everything still bootstraps properly.

Motivation for this change

To be able to use nixpkgs on mips64el. I intend to set up a Hydra instance. Western Semiconductor has offered to donate hardware (and hosting if desired).

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

Adam Joseph added 4 commits February 21, 2022 02:21
MIPS has an uncharacteristically-large space of permutations for
{architecture,abi,endianness}; this patch adds all of them to
lib/systems/platforms.nix so we can be done with it.

Currently lib/systems/inspect.nix has a single "isMips" predicate,
which is a bit ambiguous now that we will have both mips32 and mips64
support, with the latter having two ABIs.  Let's add four new
predicates (isMips32, isMips64, isMips64n32, and isMips64n64) and
treat the now-ambiguous isMips as deprecated in favor of the
more-specific predicates.  These predicates are used mainly for
enabling/disabling target-specific workarounds, and it is extremely
rare that a platform-specific workaround is needed, and both mips32
and mips64 need exactly the same workaround.

The separate predicates (isMips64n32 and isMips64n64) for ABI
distinctions are, unfortunately, useful.  Boost's user-scheduled
threading (used by nix) does does not currently supports mips64n32,
which is a very desirable ABI on routers since they rarely have
more than 2**32 bytes of DRAM.
This corrects a mistake made when transcribing the ABI coordinate of
the first two tuples from https://wiki.debian.org/Multiarch/Tuples
The predicate for isMips64n32 matches not only mips64el-*-gnuabin32,
but also mips64el-*-muslabin32.  This is the desired/expected
behavior.  However the definition of isMips64n32 mentions
abis.gnuabin32, which might mislead a reader into believing that the
predicate matches only glibc targets.

This commit inlines the definition of abis.gnuabin32, leaving the
predicate's behavior unchanged while avoiding potential confusion.

Likewise for isMips64n64.
This is used in the bootstrap process, which involves cross-compiling
a statically-linked nix binary.
@ghost ghost marked this pull request as draft February 26, 2022 06:44
@github-actions github-actions bot added 6.topic: stdenv Standard environment 6.topic: golang 6.topic: kernel The Linux kernel 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: printing 6.topic: python 6.topic: qt/kde 6.topic: vim 8.has: changelog 8.has: documentation This PR adds or changes documentation and removed 6.topic: kernel The Linux kernel 8.has: changelog 8.has: documentation This PR adds or changes documentation 6.topic: golang 6.topic: qt/kde 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: vim 6.topic: python 6.topic: printing labels Feb 26, 2022
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Feb 26, 2022
@ghost ghost closed this Feb 26, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: stdenv Standard environment 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants