Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

lib = import ./lib;

systems = lib.systems.supported.hydra;
systems = lib.platforms.all;
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep!

Copy link
Contributor

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Member

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).

Copy link
Member

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.


forAllSystems = f: lib.genAttrs systems (system: f system);

Expand Down
21 changes: 14 additions & 7 deletions lib/systems/doubles.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ let
"x86_64-darwin" "i686-darwin" "aarch64-darwin" "armv7a-darwin"

# FreeBSD
"i686-freebsd" "x86_64-freebsd"
"aarch64-freebsd" "armv5tel-freebsd" "armv6l-freebsd"
"armv7l-freebsd" "i686-freebsd" "mipsel-freebsd"
"powerpc64-freebsd" "riscv64-freebsd" "sparc64-freebsd"
"x86_64-freebsd"

# Genode
"aarch64-genode" "i686-genode" "x86_64-genode"
Expand All @@ -28,24 +31,26 @@ let
"aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux"
"armv7l-linux" "i686-linux" "m68k-linux" "mipsel-linux"
"powerpc64-linux" "powerpc64le-linux" "riscv32-linux"
"riscv64-linux" "s390-linux" "s390x-linux" "x86_64-linux"
"riscv64-linux" "s390-linux" "s390x-linux" "sparc64-linux"
"x86_64-linux"

# MMIXware
"mmix-mmixware"

# NetBSD
"aarch64-netbsd" "armv6l-netbsd" "armv7a-netbsd" "armv7l-netbsd"
"i686-netbsd" "m68k-netbsd" "mipsel-netbsd" "powerpc-netbsd"
"riscv32-netbsd" "riscv64-netbsd" "x86_64-netbsd"
"riscv32-netbsd" "riscv64-netbsd" "sparc64-netbsd" "x86_64-netbsd"

# none
"aarch64-none" "arm-none" "armv6l-none" "avr-none" "i686-none"
"msp430-none" "or1k-none" "m68k-none" "powerpc-none"
"riscv32-none" "riscv64-none" "s390-none" "s390x-none" "vc4-none"
"x86_64-none"
"riscv32-none" "riscv64-none" "s390-none" "s390x-none" "sparc64-none"
"vc4-none" "x86_64-none"

# OpenBSD
"i686-openbsd" "x86_64-openbsd"
"aarch64-openbsd" "armv7l-openbsd" "i686-openbsd" "powerpc64-openbsd"
"riscv64-openbsd" "sparc64-openbsd" "x86_64-openbsd"

# Redox
"x86_64-redox"
Expand All @@ -54,7 +59,7 @@ let
"wasm64-wasi" "wasm32-wasi"

# Windows
"x86_64-windows" "i686-windows"
"x86_64-windows" "i686-windows" "aarch64-windows"
];

allParsed = map parse.mkSystemFromString all;
Expand All @@ -78,6 +83,8 @@ in {
or1k = filterDoubles predicates.isOr1k;
m68k = filterDoubles predicates.isM68k;
s390 = filterDoubles predicates.isS390;
sparc = filterDoubles predicates.isSparc;
sparc64 = filterDoubles predicates.isSparc64;
js = filterDoubles predicates.isJavaScript;

bigEndian = filterDoubles predicates.isBigEndian;
Expand Down
4 changes: 4 additions & 0 deletions lib/systems/examples.nix
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ rec {
config = "s390x-unknown-linux-gnu";
};

sparc64-linux = {
config = "sparc64-unknown-linux-gnu";
};

arm-embedded = {
config = "arm-none-eabi";
libc = "newlib";
Expand Down
1 change: 1 addition & 0 deletions lib/systems/inspect.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ rec {
isMmix = { cpu = { family = "mmix"; }; };
isRiscV = { cpu = { family = "riscv"; }; };
isSparc = { cpu = { family = "sparc"; }; };
isSparc64 = { cpu = { family = "sparc"; bits = 64; }; };
isWasm = { cpu = { family = "wasm"; }; };
isMsp430 = { cpu = { family = "msp430"; }; };
isVc4 = { cpu = { family = "vc4"; }; };
Expand Down
18 changes: 9 additions & 9 deletions lib/tests/systems.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ in
with lib.systems.doubles; lib.runTests {
testall = mseteq all (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos ++ wasi ++ windows ++ embedded ++ mmix ++ js ++ genode ++ redox);

testarm = mseteq arm [ "armv5tel-linux" "armv6l-linux" "armv6l-netbsd" "armv6l-none" "armv7a-linux" "armv7a-netbsd" "armv7l-linux" "armv7l-netbsd" "arm-none" "armv7a-darwin" ];
testi686 = mseteq i686 [ "i686-linux" "i686-freebsd" "i686-genode" "i686-netbsd" "i686-openbsd" "i686-cygwin" "i686-windows" "i686-none" "i686-darwin" ];
testmips = mseteq mips [ "mipsel-linux" "mipsel-netbsd" ];
testarm = mseteq arm [ "armv7a-darwin" "armv5tel-freebsd" "armv6l-freebsd" "armv7l-freebsd" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "armv6l-netbsd" "armv7a-netbsd" "armv7l-netbsd" "arm-none" "armv6l-none" "armv7l-openbsd" ];
testi686 = mseteq i686 [ "i686-cygwin" "i686-darwin" "i686-freebsd" "i686-genode" "i686-linux" "i686-netbsd" "i686-none" "i686-openbsd" "i686-windows" ];
testmips = mseteq mips [ "mipsel-freebsd" "mipsel-linux" "mipsel-netbsd" ];
testmmix = mseteq mmix [ "mmix-mmixware" ];
testx86_64 = mseteq x86_64 [ "x86_64-linux" "x86_64-darwin" "x86_64-freebsd" "x86_64-genode" "x86_64-redox" "x86_64-openbsd" "x86_64-netbsd" "x86_64-cygwin" "x86_64-solaris" "x86_64-windows" "x86_64-none" ];
testx86_64 = mseteq x86_64 [ "x86_64-cygwin" "x86_64-darwin" "x86_64-freebsd" "x86_64-genode" "x86_64-solaris" "x86_64-linux" "x86_64-netbsd" "x86_64-none" "x86_64-openbsd" "x86_64-redox" "x86_64-windows" ];

testcygwin = mseteq cygwin [ "i686-cygwin" "x86_64-cygwin" ];
testdarwin = mseteq darwin [ "x86_64-darwin" "i686-darwin" "aarch64-darwin" "armv7a-darwin" ];
testfreebsd = mseteq freebsd [ "i686-freebsd" "x86_64-freebsd" ];
testfreebsd = mseteq freebsd [ "aarch64-freebsd" "armv5tel-freebsd" "armv6l-freebsd" "armv7l-freebsd" "i686-freebsd" "mipsel-freebsd" "powerpc64-freebsd" "riscv64-freebsd" "sparc64-freebsd" "x86_64-freebsd" ];
testgenode = mseteq genode [ "aarch64-genode" "i686-genode" "x86_64-genode" ];
testredox = mseteq redox [ "x86_64-redox" ];
testgnu = mseteq gnu (linux /* ++ kfreebsd ++ ... */);
testillumos = mseteq illumos [ "x86_64-solaris" ];
testlinux = mseteq linux [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "i686-linux" "mipsel-linux" "riscv32-linux" "riscv64-linux" "x86_64-linux" "powerpc64-linux" "powerpc64le-linux" "m68k-linux" "s390-linux" "s390x-linux" ];
testnetbsd = mseteq netbsd [ "aarch64-netbsd" "armv6l-netbsd" "armv7a-netbsd" "armv7l-netbsd" "i686-netbsd" "m68k-netbsd" "mipsel-netbsd" "powerpc-netbsd" "riscv32-netbsd" "riscv64-netbsd" "x86_64-netbsd" ];
testopenbsd = mseteq openbsd [ "i686-openbsd" "x86_64-openbsd" ];
testwindows = mseteq windows [ "i686-cygwin" "x86_64-cygwin" "i686-windows" "x86_64-windows" ];
testlinux = mseteq linux [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "i686-linux" "m68k-linux" "mipsel-linux" "powerpc64-linux" "powerpc64le-linux" "riscv32-linux" "riscv64-linux" "s390-linux" "s390x-linux" "sparc64-linux" "x86_64-linux" ];
testnetbsd = mseteq netbsd [ "aarch64-netbsd" "armv6l-netbsd" "armv7a-netbsd" "armv7l-netbsd" "i686-netbsd" "m68k-netbsd" "mipsel-netbsd" "powerpc-netbsd" "riscv32-netbsd" "riscv64-netbsd" "sparc64-netbsd" "x86_64-netbsd" ];
testopenbsd = mseteq openbsd [ "aarch64-openbsd" "armv7l-openbsd" "i686-openbsd" "powerpc64-openbsd" "riscv64-openbsd" "sparc64-openbsd" "x86_64-openbsd" ];
testwindows = mseteq windows [ "i686-cygwin" "x86_64-cygwin" "x86_64-windows" "i686-windows" "aarch64-windows" ];
testunix = mseteq unix (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos ++ cygwin ++ redox);
}
2 changes: 1 addition & 1 deletion pkgs/development/libraries/pcre/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ in stdenv.mkDerivation {
outputs = [ "bin" "dev" "out" "doc" "man" ];

# Disable jit on Apple Silicon, https://github.com/zherczeg/sljit/issues/51
configureFlags = optional (!stdenv.hostPlatform.isRiscV && !(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64)) "--enable-jit" ++ [
configureFlags = optional (!stdenv.hostPlatform.isRiscV && !stdenv.hostPlatform.isSparc && !(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64)) "--enable-jit" ++ [
"--enable-unicode-properties"
"--disable-cpp"
]
Expand Down
2 changes: 1 addition & 1 deletion pkgs/os-specific/linux/busybox/sandbox-shell.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ busybox}:
{ busybox }:

# Minimal shell for use as basic /bin/sh in sandbox builds
busybox.override {
Expand Down
1 change: 1 addition & 0 deletions pkgs/stdenv/linux/make-bootstrap-tools-cross.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ in lib.mapAttrs (n: make) (with lib.systems.examples; {
powerpc64-musl = ppc64-musl;
powerpc64le = powernv;
powerpc64le-musl = musl-power;
sparc64 = sparc64;
})
2 changes: 1 addition & 1 deletion pkgs/stdenv/linux/make-bootstrap-tools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ in with pkgs; rec {
tarMinimal = gnutar.override { acl = null; };

busyboxMinimal = busybox.override {
useMusl = !stdenv.targetPlatform.isRiscV;
useMusl = !stdenv.targetPlatform.isSparc;
enableStatic = true;
enableMinimal = true;
extraConfig = ''
Expand Down
3 changes: 1 addition & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21451,8 +21451,7 @@ with pkgs;

busybox = callPackage ../os-specific/linux/busybox { };
busybox-sandbox-shell = callPackage ../os-specific/linux/busybox/sandbox-shell.nix {
# musl roadmap has RISC-V support projected for 1.1.20
busybox = if !stdenv.hostPlatform.isRiscV && stdenv.hostPlatform.libc != "bionic"
busybox = if !stdenv.hostPlatform.isSparc && stdenv.hostPlatform.libc != "bionic"
then pkgsStatic.busybox
else busybox;
};
Expand Down