lol
fork

Configure Feed

Select the types of activity you want to include in your feed.

cygwin: init as a target toolchain

The old cygwin support used -pc-windows-cygnus as the config. This is
supported by LLVM, but not by GNU. This will change it to -pc-cygwin,
which is more generally supported.

Because the kernel is now 'cygwin' rather than 'windows', isWindows will
return false. There are lots of different reasons isWindows is used in
nixpkgs, but in my experience they often have to do with posix
compatibility and don't apply to cygwin.

Co-authored-by: Brian McKenna <brian@brianmckenna.org>

+31 -20
+6 -3
lib/systems/default.nix
··· 124 124 "ucrt" 125 125 else if final.isMinGW then 126 126 "msvcrt" 127 + else if final.isCygwin then 128 + "cygwin" 127 129 else if final.isWasi then 128 130 "wasilibc" 129 131 else if final.isWasm && !final.isWasi then ··· 183 185 sharedLibrary = 184 186 if final.isDarwin then 185 187 ".dylib" 186 - else if final.isWindows then 188 + else if (final.isWindows || final.isCygwin) then 187 189 ".dll" 188 190 else 189 191 ".so"; ··· 191 193 // { 192 194 staticLibrary = if final.isWindows then ".lib" else ".a"; 193 195 library = if final.isStatic then final.extensions.staticLibrary else final.extensions.sharedLibrary; 194 - executable = if final.isWindows then ".exe" else ""; 196 + executable = if (final.isWindows || final.isCygwin) then ".exe" else ""; 195 197 }; 196 198 # Misc boolean options 197 199 useAndroidPrebuilt = false; ··· 204 206 { 205 207 linux = "Linux"; 206 208 windows = "Windows"; 209 + cygwin = "CYGWIN_NT"; 207 210 darwin = "Darwin"; 208 211 netbsd = "NetBSD"; 209 212 freebsd = "FreeBSD"; ··· 603 606 "openbsd" 604 607 else if final.isSunOS then 605 608 "sunos" 606 - else if final.isWindows then 609 + else if (final.isWindows || final.isCygwin) then 607 610 "win32" 608 611 else 609 612 null;
+4
lib/systems/examples.nix
··· 388 388 useLLVM = true; 389 389 }; 390 390 391 + x86_64-cygwin = { 392 + config = "x86_64-pc-cygwin"; 393 + }; 394 + 391 395 # BSDs 392 396 393 397 aarch64-freebsd = {
+1 -2
lib/systems/inspect.nix
··· 337 337 kernel = kernels.windows; 338 338 }; 339 339 isCygwin = { 340 - kernel = kernels.windows; 341 - abi = abis.cygnus; 340 + kernel = kernels.cygwin; 342 341 }; 343 342 isMinGW = { 344 343 kernel = kernels.windows;
+19 -13
lib/systems/parse.nix
··· 42 42 isLinux 43 43 isPower64 44 44 isWindows 45 + isCygwin 45 46 ; 46 47 47 48 inherit (lib.types) ··· 617 618 execFormat = pe; 618 619 families = { }; 619 620 }; 621 + cygwin = { 622 + execFormat = pe; 623 + families = { }; 624 + }; 620 625 ghcjs = { 621 626 execFormat = unknown; 622 627 families = { }; ··· 650 655 types.abi = enum (attrValues abis); 651 656 652 657 abis = setTypes types.openAbi { 653 - cygnus = { }; 654 658 msvc = { }; 655 659 656 660 # Note: eabi is specific to ARM and PowerPC. ··· 783 787 throw "system string '${lib.concatStringsSep "-" l}' with 1 component is ambiguous"; 784 788 "2" = # We only do 2-part hacks for things Nix already supports 785 789 if elemAt l 1 == "cygwin" then 786 - { 787 - cpu = elemAt l 0; 788 - kernel = "windows"; 789 - abi = "cygnus"; 790 - } 790 + mkSkeletonFromList [ 791 + (elemAt l 0) 792 + "pc" 793 + "cygwin" 794 + ] 791 795 # MSVC ought to be the default ABI so this case isn't needed. But then it 792 796 # becomes difficult to handle the gnu* variants for Aarch32 correctly for 793 797 # minGW. So it's easier to make gnu* the default for the MinGW, but ··· 851 855 else 852 856 elemAt l 2; 853 857 } 858 + # lots of tools expect a triplet for Cygwin, even though the vendor is just "pc" 859 + else if elemAt l 2 == "cygwin" then 860 + { 861 + cpu = elemAt l 0; 862 + vendor = elemAt l 1; 863 + kernel = "cygwin"; 864 + } 854 865 else 855 866 throw "system string '${lib.concatStringsSep "-" l}' with 3 components is ambiguous"; 856 867 "4" = { ··· 891 902 getVendor args.vendor 892 903 else if isDarwin parsed then 893 904 vendors.apple 894 - else if isWindows parsed then 905 + else if (isWindows parsed || isCygwin parsed) then 895 906 vendors.pc 896 907 else 897 908 vendors.unknown; ··· 933 944 abi, 934 945 ... 935 946 }: 936 - if abi == abis.cygnus then 937 - "${cpu.name}-cygwin" 938 - else if kernel.families ? darwin then 939 - "${cpu.name}-darwin" 940 - else 941 - "${cpu.name}-${kernelName kernel}"; 947 + if kernel.families ? darwin then "${cpu.name}-darwin" else "${cpu.name}-${kernelName kernel}"; 942 948 943 949 tripleFromSystem = 944 950 {
+1 -2
lib/tests/systems.nix
··· 49 49 ++ illumos 50 50 ++ wasi 51 51 ++ windows 52 + ++ cygwin 52 53 ++ embedded 53 54 ++ mmix 54 55 ++ js ··· 202 203 "x86_64-openbsd" 203 204 ]; 204 205 testwindows = mseteq windows [ 205 - "i686-cygwin" 206 - "x86_64-cygwin" 207 206 "aarch64-windows" 208 207 "i686-windows" 209 208 "x86_64-windows"