From e3895dafc941b6f419d2f820faabb1e815f437f4 Mon Sep 17 00:00:00 2001 From: Michael Hoang Date: Mon, 5 May 2025 13:06:42 +1000 Subject: [PATCH] swift: use `aarch64` instead of `arm64` on Linux --- pkgs/development/compilers/swift/compiler/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/swift/compiler/default.nix b/pkgs/development/compilers/swift/compiler/default.nix index cc0ddfa40e8a..fb7e4964eb86 100644 --- a/pkgs/development/compilers/swift/compiler/default.nix +++ b/pkgs/development/compilers/swift/compiler/default.nix @@ -72,7 +72,11 @@ let else targetPlatform.parsed.kernel.name; - swiftArch = stdenv.hostPlatform.darwinArch; + # This causes swiftPackages.XCTest to fail to build on aarch64-linux + # as I believe this is because Apple calls the architecture aarch64 + # on Linux rather than arm64 when used with macOS. + swiftArch = + if hostPlatform.isDarwin then hostPlatform.darwinArch else targetPlatform.parsed.cpu.name; # On Darwin, a `.swiftmodule` is a subdirectory in `lib/swift/`, # containing binaries for supported archs. On other platforms, binaries are