Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 412a9e7d7c89
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d95aebbe0e72
Choose a head ref
  • 2 commits
  • 37 files changed
  • 2 contributors

Commits on Jan 22, 2021

  1. lib: Clean up how linux and gcc config is specified

    The `platform` field is pointless nesting: it's just stuff that happens
    to be defined together, and that should be an implementation detail.
    
    This instead makes `linux-kernel` and `gcc` top level fields in platform
    configs. They join `rustc` there [all are optional], which was put there
    and not in `platform` in anticipation of a change like this.
    
    `linux-kernel.arch` in particular also becomes `linuxArch`, to match the
    other `*Arch`es.
    
    The next step after is this to combine the *specific* machines from
    `lib.systems.platforms` with `lib.systems.examples`, keeping just the
    "multiplatform" ones for defaulting.
    Ericson2314 committed Jan 22, 2021
    Copy the full SHA
    8929989 View commit details
  2. Merge pull request #107214 from Ericson2314/linux-config-cleanup

    lib: Clean up how linux and gcc config is specified
    Ericson2314 authored Jan 22, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d95aebb View commit details
Showing with 454 additions and 448 deletions.
  1. +10 −3 lib/systems/default.nix
  2. +10 −38 lib/systems/examples.nix
  3. +341 −329 lib/systems/platforms.nix
  4. +16 −0 nixos/doc/manual/release-notes/rl-2103.xml
  5. +4 −4 nixos/modules/hardware/device-tree.nix
  6. +1 −1 nixos/modules/installer/netboot/netboot.nix
  7. +4 −4 nixos/modules/services/misc/nix-daemon.nix
  8. +1 −1 nixos/modules/system/activation/top-level.nix
  9. +1 −1 nixos/modules/system/boot/loader/generations-dir/generations-dir.nix
  10. +1 −1 nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix
  11. +2 −2 nixos/release.nix
  12. +1 −1 pkgs/applications/audio/virtual-ans/default.nix
  13. +1 −1 pkgs/applications/virtualization/crosvm/default.nix
  14. +1 −1 pkgs/applications/virtualization/vpcs/default.nix
  15. +1 −1 pkgs/build-support/bintools-wrapper/default.nix
  16. +8 −8 pkgs/build-support/cc-wrapper/default.nix
  17. +2 −2 pkgs/build-support/kernel/make-initrd.nix
  18. +1 −1 pkgs/build-support/vm/default.nix
  19. +1 −1 pkgs/development/compilers/gcc/common/platform-flags.nix
  20. +1 −1 pkgs/development/compilers/julia/1.0.nix
  21. +1 −1 pkgs/development/compilers/julia/1.3.nix
  22. +1 −1 pkgs/development/compilers/julia/1.5.nix
  23. +1 −1 pkgs/development/libraries/glibc/common.nix
  24. +1 −1 pkgs/development/libraries/qt-5/modules/qtwebengine.nix
  25. +3 −3 pkgs/development/tools/poetry2nix/poetry2nix/pep425.nix
  26. +1 −1 pkgs/development/tools/poetry2nix/poetry2nix/pep508.nix
  27. +5 −6 pkgs/development/web/nodejs/nodejs.nix
  28. +1 −1 pkgs/os-specific/linux/exfat/default.nix
  29. +1 −1 pkgs/os-specific/linux/kernel-headers/default.nix
  30. +9 −9 pkgs/os-specific/linux/kernel/generic.nix
  31. +15 −15 pkgs/os-specific/linux/kernel/manual-config.nix
  32. +2 −2 pkgs/os-specific/linux/klibc/default.nix
  33. +1 −1 pkgs/os-specific/linux/rtl8723bs/default.nix
  34. +1 −1 pkgs/os-specific/linux/rtl8812au/default.nix
  35. +1 −1 pkgs/os-specific/linux/uclibc/default.nix
  36. +1 −1 pkgs/stdenv/generic/make-derivation.nix
  37. +1 −1 pkgs/top-level/all-packages.nix
13 changes: 10 additions & 3 deletions lib/systems/default.nix
Original file line number Diff line number Diff line change
@@ -24,8 +24,6 @@ rec {
# Either of these can be losslessly-extracted from `parsed` iff parsing succeeds.
system = parse.doubleFromSystem final.parsed;
config = parse.tripleFromSystem final.parsed;
# Just a guess, based on `system`
platform = platforms.select final;
# Determine whether we are compatible with the provided CPU
isCompatible = platform: parse.isCompatible final.parsed.cpu platform.parsed.cpu;
# Derived meta-data
@@ -79,7 +77,16 @@ rec {
};
isStatic = final.isWasm || final.isRedox;

kernelArch =
# Just a guess, based on `system`
inherit
({
linux-kernel = args.linux-kernel or {};
gcc = args.gcc or {};
rustc = args.rust or {};
} // platforms.select final)
linux-kernel gcc rustc;

linuxArch =
if final.isAarch32 then "arm"
else if final.isAarch64 then "arm64"
else if final.isx86_32 then "x86"
48 changes: 10 additions & 38 deletions lib/systems/examples.nix
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ let

riscv = bits: {
config = "riscv${bits}-unknown-linux-gnu";
platform = platforms.riscv-multiplatform;
};
in

@@ -17,84 +16,68 @@ rec {
#
powernv = {
config = "powerpc64le-unknown-linux-gnu";
platform = platforms.powernv;
};
musl-power = {
config = "powerpc64le-unknown-linux-musl";
platform = platforms.powernv;
};

sheevaplug = {
config = "armv5tel-unknown-linux-gnueabi";
platform = platforms.sheevaplug;
};
} // platforms.sheevaplug;

raspberryPi = {
config = "armv6l-unknown-linux-gnueabihf";
platform = platforms.raspberrypi;
};
} // platforms.raspberrypi;

remarkable1 = {
config = "armv7l-unknown-linux-gnueabihf";
platform = platforms.zero-gravitas;
};
} // platforms.zero-gravitas;

remarkable2 = {
config = "armv7l-unknown-linux-gnueabihf";
platform = platforms.zero-sugar;
};
} // platforms.zero-sugar;

armv7l-hf-multiplatform = {
config = "armv7l-unknown-linux-gnueabihf";
platform = platforms.armv7l-hf-multiplatform;
};

aarch64-multiplatform = {
config = "aarch64-unknown-linux-gnu";
platform = platforms.aarch64-multiplatform;
};

armv7a-android-prebuilt = {
config = "armv7a-unknown-linux-androideabi";
sdkVer = "29";
ndkVer = "21";
platform = platforms.armv7a-android;
useAndroidPrebuilt = true;
};
} // platforms.armv7a-android;

aarch64-android-prebuilt = {
config = "aarch64-unknown-linux-android";
sdkVer = "29";
ndkVer = "21";
platform = platforms.aarch64-multiplatform;
useAndroidPrebuilt = true;
};

scaleway-c1 = armv7l-hf-multiplatform // rec {
platform = platforms.scaleway-c1;
inherit (platform.gcc) fpu;
};
scaleway-c1 = armv7l-hf-multiplatform // platforms.scaleway-c1;

pogoplug4 = {
config = "armv5tel-unknown-linux-gnueabi";
platform = platforms.pogoplug4;
};
} // platforms.pogoplug4;

ben-nanonote = {
config = "mipsel-unknown-linux-uclibc";
platform = platforms.ben_nanonote;
};
} // platforms.ben_nanonote;

fuloongminipc = {
config = "mipsel-unknown-linux-gnu";
platform = platforms.fuloong2f_n32;
};
} // platforms.fuloong2f_n32;

muslpi = raspberryPi // {
config = "armv6l-unknown-linux-musleabihf";
};

aarch64-multiplatform-musl = aarch64-multiplatform // {
aarch64-multiplatform-musl = {
config = "aarch64-unknown-linux-musl";
};

@@ -110,13 +93,11 @@ rec {
riscv64-embedded = {
config = "riscv64-none-elf";
libc = "newlib";
platform = platforms.riscv-multiplatform;
};

riscv32-embedded = {
config = "riscv32-none-elf";
libc = "newlib";
platform = platforms.riscv-multiplatform;
};

mmix = {
@@ -136,13 +117,11 @@ rec {
vc4 = {
config = "vc4-elf";
libc = "newlib";
platform = {};
};

or1k = {
config = "or1k-elf";
libc = "newlib";
platform = {};
};

arm-embedded = {
@@ -204,7 +183,6 @@ rec {
xcodeVer = "11.3.1";
xcodePlatform = "iPhoneOS";
useiOSPrebuilt = true;
platform = {};
};

iphone32 = {
@@ -214,7 +192,6 @@ rec {
xcodeVer = "11.3.1";
xcodePlatform = "iPhoneOS";
useiOSPrebuilt = true;
platform = {};
};

iphone64-simulator = {
@@ -224,7 +201,6 @@ rec {
xcodeVer = "11.3.1";
xcodePlatform = "iPhoneSimulator";
useiOSPrebuilt = true;
platform = {};
};

iphone32-simulator = {
@@ -234,7 +210,6 @@ rec {
xcodeVer = "11.3.1";
xcodePlatform = "iPhoneSimulator";
useiOSPrebuilt = true;
platform = {};
};

#
@@ -245,15 +220,13 @@ rec {
mingw32 = {
config = "i686-w64-mingw32";
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
platform = {};
};

# 64 bit mingw-w64
mingwW64 = {
# That's the triplet they use in the mingw-w64 docs.
config = "x86_64-w64-mingw32";
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
platform = {};
};

# BSDs
@@ -275,6 +248,5 @@ rec {
# Ghcjs
ghcjs = {
config = "js-unknown-ghcjs";
platform = {};
};
}
Loading