From 31cdf9db6fd7d2eab0ab52a4322f8168c555bd8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gy=C3=B6rgy=20Kurucz?= Date: Sat, 18 Jan 2025 01:52:54 +0100 Subject: [PATCH 1/2] fex: minimize set of cloned submodules This change also removes the submodules that contained prebuilt (test) binaries. --- pkgs/by-name/fe/fex/package.nix | 47 +++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/fe/fex/package.nix b/pkgs/by-name/fe/fex/package.nix index 90c2148746e9..4f28b83cbb64 100644 --- a/pkgs/by-name/fe/fex/package.nix +++ b/pkgs/by-name/fe/fex/package.nix @@ -8,6 +8,8 @@ qt5, python3, nix-update-script, + xxHash, + fmt, }: llvmPackages.stdenv.mkDerivation (finalAttrs: { @@ -18,8 +20,32 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: { owner = "FEX-Emu"; repo = "FEX"; tag = "FEX-${finalAttrs.version}"; - hash = "sha256-tqUJBHYSRlEUaLI4WItzotIHGMUNbdjA7o9NjBYZmHw="; - fetchSubmodules = true; + + hash = "sha256-oXducy4uvf/3Ox6AadPWNl9450D9TiPIr53P91/qEvw="; + + leaveDotGit = true; + postFetch = '' + cd $out + git reset + + # Only fetch required submodules + git submodule update --init --depth 1 \ + External/Vulkan-Headers \ + External/drm-headers \ + External/jemalloc \ + External/jemalloc_glibc \ + External/robin-map \ + External/vixl \ + Source/Common/cpp-optparse \ + External/Catch2 + + find . -name .git -print0 | xargs -0 rm -rf + + # Remove some more unnecessary directories + rm -r \ + External/vixl/src/aarch32 \ + External/vixl/test + ''; }; nativeBuildInputs = [ @@ -37,12 +63,17 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: { )) ]; - buildInputs = with qt5; [ - qtbase - qtdeclarative - qtquickcontrols - qtquickcontrols2 - ]; + buildInputs = + [ + xxHash + fmt + ] + ++ (with qt5; [ + qtbase + qtdeclarative + qtquickcontrols + qtquickcontrols2 + ]); cmakeFlags = [ (lib.cmakeFeature "CMAKE_BUILD_TYPE" "Release") From 0ce1f02b4077b45965316141ddae5716ed46b7d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gy=C3=B6rgy=20Kurucz?= Date: Sat, 18 Jan 2025 01:56:09 +0100 Subject: [PATCH 2/2] fex: fix and enable tests This will still fail on Apple Silicon devices using 16K page size kernels, but such systems are not supported by upstream, so there is nothing we can do about that. --- pkgs/by-name/fe/fex/package.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/fe/fex/package.nix b/pkgs/by-name/fe/fex/package.nix index 4f28b83cbb64..7b9ff2ffdd2a 100644 --- a/pkgs/by-name/fe/fex/package.nix +++ b/pkgs/by-name/fe/fex/package.nix @@ -10,6 +10,7 @@ nix-update-script, xxHash, fmt, + nasm, }: llvmPackages.stdenv.mkDerivation (finalAttrs: { @@ -63,6 +64,8 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: { )) ]; + nativeCheckInputs = [ nasm ]; + buildInputs = [ xxHash @@ -85,7 +88,18 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: { ]; strictDeps = true; - doCheck = false; # broken on Apple silicon computers + + # Unsupported on non-4K page size kernels (e.g. Apple Silicon) + doCheck = true; + + # List not exhaustive, e.g. because they depend on an x86 compiler or some + # other difficult-to-build test binaries. + checkTarget = lib.concatStringsSep " " [ + "asm_tests" + "api_tests" + "fexcore_apitests" + "emitter_tests" + ]; # Avoid wrapping anything other than FEXConfig, since the wrapped executables # don't seem to work when registered as binfmts.