From 1e6ab3434f9a0b08bf56a2fc147fdf721ce4cbaa Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 25 Mar 2025 22:45:40 +0000 Subject: [PATCH 1/2] =?UTF-8?q?treewide:=20drop=20support=20for=2032?= =?UTF-8?q?=E2=80=90bit=20Darwin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s dead, Jim. --- doc/release-notes/rl-2505.section.md | 2 ++ lib/systems/doubles.nix | 2 -- lib/systems/examples.nix | 19 ------------------- lib/tests/systems.nix | 5 ----- pkgs/development/compilers/rust/binary.nix | 2 -- .../development/libraries/tachyon/default.nix | 4 +--- .../python-modules/debugpy/default.nix | 2 -- pkgs/games/dwarf-fortress/game.nix | 1 - 8 files changed, 3 insertions(+), 34 deletions(-) diff --git a/doc/release-notes/rl-2505.section.md b/doc/release-notes/rl-2505.section.md index 4332e26511ba..13270084769f 100644 --- a/doc/release-notes/rl-2505.section.md +++ b/doc/release-notes/rl-2505.section.md @@ -81,6 +81,8 @@ - `i3status-rust`-package no longer enables `notmuch` by default. It can be enabled via `withNotmuch`. +- All support for 32‐bit Darwin systems has been dropped. + - Default ICU version updated from 74 to 76 - Apache Kafka was updated to `>= 4.0.0`. Please note that this is the first release which operates diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index b2a66021dfc9..90f67b3916fb 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -12,9 +12,7 @@ let # Darwin "x86_64-darwin" - "i686-darwin" "aarch64-darwin" - "armv7a-darwin" # FreeBSD "i686-freebsd" diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index cb54d8fd631a..f87162e83277 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -284,15 +284,6 @@ rec { useiOSPrebuilt = true; }; - iphone32 = { - config = "armv7a-apple-ios"; - # config = "arm-apple-darwin10"; - darwinSdkVersion = "14.3"; - xcodeVer = "12.3"; - xcodePlatform = "iPhoneOS"; - useiOSPrebuilt = true; - }; - iphone64-simulator = { config = "x86_64-apple-ios"; # config = "x86_64-apple-darwin14"; @@ -303,16 +294,6 @@ rec { useiOSPrebuilt = true; }; - iphone32-simulator = { - config = "i686-apple-ios"; - # config = "i386-apple-darwin11"; - darwinSdkVersion = "14.3"; - xcodeVer = "12.3"; - xcodePlatform = "iPhoneSimulator"; - darwinPlatform = "ios-simulator"; - useiOSPrebuilt = true; - }; - aarch64-darwin = { config = "aarch64-apple-darwin"; xcodePlatform = "MacOSX"; diff --git a/lib/tests/systems.nix b/lib/tests/systems.nix index 941f887304d3..236ee20727e6 100644 --- a/lib/tests/systems.nix +++ b/lib/tests/systems.nix @@ -66,10 +66,8 @@ lib.runTests ( "armv7l-linux" "armv7l-netbsd" "arm-none" - "armv7a-darwin" ]; testarmv7 = mseteq armv7 [ - "armv7a-darwin" "armv7a-linux" "armv7l-linux" "armv7a-netbsd" @@ -84,7 +82,6 @@ lib.runTests ( "i686-cygwin" "i686-windows" "i686-none" - "i686-darwin" ]; testmips = mseteq mips [ "mips-none" @@ -145,9 +142,7 @@ lib.runTests ( ]; testdarwin = mseteq darwin [ "x86_64-darwin" - "i686-darwin" "aarch64-darwin" - "armv7a-darwin" ]; testfreebsd = mseteq freebsd [ "aarch64-freebsd" diff --git a/pkgs/development/compilers/rust/binary.nix b/pkgs/development/compilers/rust/binary.nix index 89190a3a69f6..7d7f4423ccd8 100644 --- a/pkgs/development/compilers/rust/binary.nix +++ b/pkgs/development/compilers/rust/binary.nix @@ -82,7 +82,6 @@ rec { # Platforms with host tools from # https://doc.rust-lang.org/nightly/rustc/platform-support.html "x86_64-darwin" - "i686-darwin" "aarch64-darwin" "i686-freebsd" "x86_64-freebsd" @@ -110,7 +109,6 @@ rec { targetPlatforms = tier1TargetPlatforms ++ [ # Platforms without host tools from # https://doc.rust-lang.org/nightly/rustc/platform-support.html - "armv7a-darwin" "armv5tel-linux" "armv7a-linux" "m68k-linux" diff --git a/pkgs/development/libraries/tachyon/default.nix b/pkgs/development/libraries/tachyon/default.nix index e006abaef218..9fb40ddb259d 100644 --- a/pkgs/development/libraries/tachyon/default.nix +++ b/pkgs/development/libraries/tachyon/default.nix @@ -54,9 +54,7 @@ stdenv.mkDerivation rec { else if stdenv.hostPlatform.system == "aarch64-darwin" then "macosx" else if stdenv.hostPlatform.system == "x86_64-darwin" then - "macosx-thr" - else if stdenv.hostPlatform.system == "i686-darwin" then - "macosx-64-thr" + "macosx-x86-64-thr" else if stdenv.hostPlatform.system == "i686-cygwin" then "win32" else if stdenv.hostPlatform.system == "x86_64-freebsd" then diff --git a/pkgs/development/python-modules/debugpy/default.nix b/pkgs/development/python-modules/debugpy/default.nix index 27b586407015..b671a5a5be62 100644 --- a/pkgs/development/python-modules/debugpy/default.nix +++ b/pkgs/development/python-modules/debugpy/default.nix @@ -84,7 +84,6 @@ buildPythonPackage rec { "i686-linux" = "-shared -o attach_linux_x86.so"; "aarch64-linux" = "-shared -o attach_linux_arm64.so"; "x86_64-darwin" = "-D_REENTRANT -dynamiclib -lc -o attach_x86_64.dylib"; - "i686-darwin" = "-D_REENTRANT -dynamiclib -lc -o attach_x86.dylib"; "aarch64-darwin" = "-D_REENTRANT -dynamiclib -lc -o attach_arm64.dylib"; } .${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}") @@ -147,7 +146,6 @@ buildPythonPackage rec { "i686-linux" "aarch64-linux" "x86_64-darwin" - "i686-darwin" "aarch64-darwin" ]; }; diff --git a/pkgs/games/dwarf-fortress/game.nix b/pkgs/games/dwarf-fortress/game.nix index 6d7b27120555..b394cd991635 100644 --- a/pkgs/games/dwarf-fortress/game.nix +++ b/pkgs/games/dwarf-fortress/game.nix @@ -41,7 +41,6 @@ let x86_64-linux = "linux"; i686-linux = "linux32"; x86_64-darwin = "osx"; - i686-darwin = "osx32"; x86_64-cygwin = "win"; i686-cygwin = "win32"; }; From 61582c704327002b75d61354a769ebf00f594cdf Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 25 Mar 2025 21:54:53 +0000 Subject: [PATCH 2/2] lib/systems: use Darwin architecture names for `config` and `uname` `aarch64-apple-darwin` no longer works with LLVM 20. --- doc/release-notes/rl-2505.section.md | 2 ++ lib/systems/default.nix | 11 ++++------- lib/systems/examples.nix | 4 ++-- lib/systems/parse.nix | 11 ++++++++++- pkgs/by-name/di/discord-gamesdk/package.nix | 2 +- .../compilers/llvm/common/llvm/default.nix | 11 ++--------- pkgs/development/compilers/swift/compiler/default.nix | 7 +------ pkgs/development/compilers/zig/generic.nix | 2 +- .../darwin/apple-source-releases/libffi/package.nix | 9 +++++---- 9 files changed, 28 insertions(+), 31 deletions(-) diff --git a/doc/release-notes/rl-2505.section.md b/doc/release-notes/rl-2505.section.md index 13270084769f..fc40e5eefe4e 100644 --- a/doc/release-notes/rl-2505.section.md +++ b/doc/release-notes/rl-2505.section.md @@ -53,6 +53,8 @@ - The hand written `perlPackages.SearchXapian` bindings have been dropped in favor of the (mostly compatible) `perlPackages.Xapian`. +- The `config` triple for `aarch64-darwin` has been changed from `aarch64-apple-darwin` to `arm64-apple-darwin` to match the Apple toolchain and LLVM’s expectations. + - [testers.shellcheck](https://nixos.org/manual/nixpkgs/unstable/#tester-shellcheck) now warns when `name` is not provided. The `name` argument will become mandatory in a future release. diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 5e16240e4263..97f3d0dced17 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -209,6 +209,8 @@ let "ppc${optionalString final.isLittleEndian "le"}" else if final.isMips64 then "mips64" # endianness is *not* included on mips64 + else if final.isDarwin then + final.darwinArch else final.parsed.cpu.name; @@ -329,12 +331,7 @@ let else final.parsed.cpu.name; - darwinArch = - { - armv7a = "armv7"; - aarch64 = "arm64"; - } - .${final.parsed.cpu.name} or final.parsed.cpu.name; + darwinArch = parse.darwinArch final.parsed.cpu; darwinPlatform = if final.isMacOS then @@ -488,8 +485,8 @@ let } .${cpu.name} or cpu.name; vendor_ = final.rust.platform.vendor; - # TODO: deprecate args.rustc in favour of args.rust after 23.05 is EOL. in + # TODO: deprecate args.rustc in favour of args.rust after 23.05 is EOL. args.rust.rustcTarget or args.rustc.config or ( # Rust uses `wasm32-wasip?` rather than `wasm32-unknown-wasi`. # We cannot know which subversion does the user want, and diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index f87162e83277..3988e39f150c 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -276,7 +276,7 @@ rec { # iphone64 = { - config = "aarch64-apple-ios"; + config = "arm64-apple-ios"; # config = "aarch64-apple-darwin14"; darwinSdkVersion = "14.3"; xcodeVer = "12.3"; @@ -295,7 +295,7 @@ rec { }; aarch64-darwin = { - config = "aarch64-apple-darwin"; + config = "arm64-apple-darwin"; xcodePlatform = "MacOSX"; platform = { }; }; diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix index a7f65e69bf4c..ec773c824def 100644 --- a/lib/systems/parse.nix +++ b/lib/systems/parse.nix @@ -396,6 +396,12 @@ rec { significantByte = littleEndian; family = "javascript"; }; + } + // { + # aliases + # Apple architecture name, as used by `darwinArch`; required by + # LLVM ≥ 20. + arm64 = cpuTypes.aarch64; }; # GNU build systems assume that older NetBSD architectures are using a.out. @@ -921,6 +927,8 @@ rec { kernelName = kernel: kernel.name + toString (kernel.version or ""); + darwinArch = cpu: if cpu.name == "aarch64" then "arm64" else cpu.name; + doubleFromSystem = { cpu, @@ -949,8 +957,9 @@ rec { kernel.name == "netbsd" && gnuNetBSDDefaultExecFormat cpu != kernel.execFormat ) kernel.execFormat.name; optAbi = optionalString (abi != abis.unknown) "-${abi.name}"; + cpuName = if kernel.families ? darwin then darwinArch cpu else cpu.name; in - "${cpu.name}-${vendor.name}-${kernelName kernel}${optExecFormat}${optAbi}"; + "${cpuName}-${vendor.name}-${kernelName kernel}${optExecFormat}${optAbi}"; ################################################################################ diff --git a/pkgs/by-name/di/discord-gamesdk/package.nix b/pkgs/by-name/di/discord-gamesdk/package.nix index 5d7a8185be45..c82b6c4fde10 100644 --- a/pkgs/by-name/di/discord-gamesdk/package.nix +++ b/pkgs/by-name/di/discord-gamesdk/package.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { installPhase = let - processor = stdenv.hostPlatform.uname.processor; + processor = stdenv.hostPlatform.parsed.cpu.name; sharedLibrary = stdenv.hostPlatform.extensions.sharedLibrary; in '' diff --git a/pkgs/development/compilers/llvm/common/llvm/default.nix b/pkgs/development/compilers/llvm/common/llvm/default.nix index ea2f024f617c..d2f9e711f653 100644 --- a/pkgs/development/compilers/llvm/common/llvm/default.nix +++ b/pkgs/development/compilers/llvm/common/llvm/default.nix @@ -594,21 +594,14 @@ stdenv.mkDerivation ( (lib.cmakeBool "LLVM_LINK_LLVM_DYLIB" enableSharedLibraries) (lib.cmakeFeature "LLVM_TABLEGEN" "${buildLlvmTools.tblgen}/bin/llvm-tblgen") ]; - - triple = - if stdenv.hostPlatform.isDarwin && lib.versionAtLeast release_version "20" then - # JIT tests expect the triple to use Darwin arch's naming for CPU architectures. - "${stdenv.hostPlatform.darwinArch}-apple-${stdenv.hostPlatform.darwinPlatform}" - else - stdenv.hostPlatform.config; in flagsForLlvmConfig ++ [ (lib.cmakeBool "LLVM_INSTALL_UTILS" true) # Needed by rustc (lib.cmakeBool "LLVM_BUILD_TESTS" finalAttrs.finalPackage.doCheck) (lib.cmakeBool "LLVM_ENABLE_FFI" true) - (lib.cmakeFeature "LLVM_HOST_TRIPLE" triple) - (lib.cmakeFeature "LLVM_DEFAULT_TARGET_TRIPLE" triple) + (lib.cmakeFeature "LLVM_HOST_TRIPLE" stdenv.hostPlatform.config) + (lib.cmakeFeature "LLVM_DEFAULT_TARGET_TRIPLE" stdenv.hostPlatform.config) (lib.cmakeBool "LLVM_ENABLE_DUMP" true) (lib.cmakeBool "LLVM_ENABLE_TERMINFO" enableTerminfo) (lib.cmakeBool "LLVM_INCLUDE_TESTS" finalAttrs.finalPackage.doCheck) diff --git a/pkgs/development/compilers/swift/compiler/default.nix b/pkgs/development/compilers/swift/compiler/default.nix index e5ee9323eea0..844bb4c3d6d8 100644 --- a/pkgs/development/compilers/swift/compiler/default.nix +++ b/pkgs/development/compilers/swift/compiler/default.nix @@ -72,12 +72,7 @@ let else targetPlatform.parsed.kernel.name; - # Apple Silicon uses a different CPU name in the target triple. - swiftArch = - if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 then - "arm64" - else - targetPlatform.parsed.cpu.name; + swiftArch = stdenv.hostPlatform.darwinArch; # On Darwin, a `.swiftmodule` is a subdirectory in `lib/swift/`, # containing binaries for supported archs. On other platforms, binaries are diff --git a/pkgs/development/compilers/zig/generic.nix b/pkgs/development/compilers/zig/generic.nix index eb08623f2013..0dba4983ea98 100644 --- a/pkgs/development/compilers/zig/generic.nix +++ b/pkgs/development/compilers/zig/generic.nix @@ -156,7 +156,7 @@ stdenv.mkDerivation (finalAttrs: { nixSupport.cc-cflags = [ "-target" - "${stdenv.targetPlatform.parsed.cpu.name}-${stdenv.targetPlatform.parsed.kernel.name}-${stdenv.targetPlatform.parsed.abi.name}" + "${stdenv.targetPlatform.config}" ] ++ lib.optional ( stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.isStatic or false) diff --git a/pkgs/os-specific/darwin/apple-source-releases/libffi/package.nix b/pkgs/os-specific/darwin/apple-source-releases/libffi/package.nix index 176455d15f11..4fe40e86aab9 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libffi/package.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libffi/package.nix @@ -48,23 +48,24 @@ mkAppleDerivation (finalAttrs: { configureFlags = [ "--with-gcc-arch=generic" # no detection of -march= or -mtune= + "--enable-builddir=build" ]; postConfigure = '' # Use Apple’s configuration instead of the one generated by the `configure` script. - cp darwin/include/fficonfig_${stdenv.hostPlatform.darwinArch}.h ${stdenv.hostPlatform.config}/fficonfig.h + cp darwin/include/fficonfig_${stdenv.hostPlatform.darwinArch}.h build/fficonfig.h cp darwin/include/ffitarget_${ if stdenv.hostPlatform.isAarch64 then "arm64" else "x86" - }.h ${stdenv.hostPlatform.config}/include/ffitarget.h + }.h build/include/ffitarget.h # Use `macCatalyst` instead of `iosmac` to avoid errors due to invalid availability annotations. - substitute darwin/include/ffi.h ${stdenv.hostPlatform.config}/include/ffi.h \ + substitute darwin/include/ffi.h build/include/ffi.h \ --replace-fail iosmac macCatalyst ''; postBuild = lib.optionalString stdenv.hostPlatform.isAarch64 '' $CC -Os -Wl,-allowable_client,! -Wl,-not_for_dyld_shared_cache -Wl,-no_compact_unwind \ src/aarch64/trampoline.S -dynamiclib -o libffi-trampolines.dylib \ - -Iinclude -Iaarch64-apple-darwin -Iaarch64-apple-darwin/include \ + -Iinclude -Ibuild -Ibuild/include \ -install_name "$out/lib/libffi-trampoline.dylib" -Wl,-compatibility_version,1 -Wl,-current_version,1 '';