Skip to content
Closed
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
5 changes: 5 additions & 0 deletions lib/systems/doubles.nix
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ let
"aarch64-windows"
"x86_64-windows"
"i686-windows"
"x86_64-mingw"
"i686-mingw"
"aarch64-mingw"
Copy link
Member

Choose a reason for hiding this comment

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

These are supposed to match the doubles Nix would use for builtins.currentSystem when built for that platform, so this is only correct if that would report mingw on mingw.

But that raises another problem I hadn't noticed before: @Ericson2314, it doesn't look like any attempt to preserve compatibility was made when the double generation logic was ported to Meson. For example, power64-linux will now be detected as ppc64-linux, and then not recognised by Nixpkgs. That seems not good! Now a Nix built on that platform won't be able to do anything useful with Nixpkgs, so I think that probably needs to be addressed in Nix to restore the old behaviour, which shouldn't have been changed and shouldn't change again in future…

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we don't support MinGW, or windows at all yet, that seems fine.

Copy link
Member

Choose a reason for hiding this comment

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

@alyssais See NixOS/nix#13520, we noticed more recently, fixed it (in two PRs), and did a bunch of backports.

Copy link
Member

Choose a reason for hiding this comment

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

Since we don't support MinGW, or windows at all yet, that seems fine.

Note that the main, core use of the doubles is "what derivations are allowed to run there". I don't think there are MSVC-only or MinGW-only builders, so xxx-windows is probably fine?

];

allParsed = map parse.mkSystemFromString all;
Expand Down Expand Up @@ -187,6 +190,8 @@ in
wasi = filterDoubles predicates.isWasi;
redox = filterDoubles predicates.isRedox;
windows = filterDoubles predicates.isWindows;
mingw = filterDoubles predicates.isMinGW;
msvc = filterDoubles predicates.isMsvc;
genode = filterDoubles predicates.isGenode;

embedded = filterDoubles predicates.isNone;
Expand Down
8 changes: 8 additions & 0 deletions lib/systems/parse.nix
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,12 @@ rec {
kernel = "windows";
abi = "msvc";
}
else if elemAt l 1 == "mingw" then
{
cpu = elemAt l 0;
kernel = "windows";
abi = "gnu";
}
else if (elemAt l 1) == "elf" then
{
cpu = elemAt l 0;
Expand Down Expand Up @@ -935,6 +941,8 @@ rec {
}:
if abi == abis.cygnus then
"${cpu.name}-cygwin"
else if kernel == kernels.windows && abi == abis.gnu then
"${cpu.name}-mingw"
else if kernel.families ? darwin then
"${cpu.name}-darwin"
else
Expand Down
2 changes: 1 addition & 1 deletion pkgs/os-specific/windows/libgnurx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
downloadPage = "https://sourceforge.net/projects/mingw/files/Other/UserContributed/regex/";
description = "Regex functionality from glibc extracted into a separate library for win32";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.windows;
platforms = lib.platforms.mingw;
teams = [ lib.teams.windows ];
};
}
2 changes: 1 addition & 1 deletion pkgs/os-specific/windows/mcfgthreads/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ stdenv.mkDerivation rec {
homepage = "https://github.com/lhmouse/mcfgthread/wiki";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ wegank ];
platforms = lib.platforms.windows;
platforms = lib.platforms.mingw;
};
}
2 changes: 1 addition & 1 deletion pkgs/os-specific/windows/mingw-w64/headers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
downloadPage = "https://sourceforge.net/projects/mingw/files/Other/UserContributed/regex/";
description = "Collection of headers and libraries for building native Windows applications";
license = lib.licenses.publicDomain;
platforms = lib.platforms.windows;
platforms = lib.platforms.mingw;
teams = [ lib.teams.windows ];
};
})
Loading