python3Packages.mlx: code cleanup (#544008)

This commit is contained in:
Sandro
2026-07-21 14:16:57 +00:00
committed by GitHub
+12 -21
View File
@@ -74,22 +74,17 @@ buildPythonPackage (finalAttrs: {
env = {
PYPI_RELEASE = 1;
CMAKE_ARGS = toString (
[
# NOTE The `metal` command-line utility used to build the Metal kernels is not open-source.
# To build mlx with Metal support in Nix, you'd need to use one of the sandbox escape
# hatches which let you interact with a native install of Xcode, such as `composeXcodeWrapper`
# or by changing the upstream (e.g., https://github.com/zed-industries/zed/discussions/7016).
(lib.cmakeBool "MLX_BUILD_METAL" false)
(lib.cmakeBool "USE_SYSTEM_FMT" true)
(lib.cmakeOptionType "filepath" "FETCHCONTENT_SOURCE_DIR_GGUFLIB" "${gguf-tools}")
(lib.cmakeOptionType "filepath" "FETCHCONTENT_SOURCE_DIR_NANOBIND" "${nanobind.src}")
(lib.cmakeFeature "CMAKE_CXX_FLAGS" "-I${lib.getDev nlohmann_json}/include/nlohmann")
]
++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [
(lib.cmakeBool "MLX_ENABLE_X64_MAC" true)
]
);
CMAKE_ARGS = toString [
# NOTE The `metal` command-line utility used to build the Metal kernels is not open-source.
# To build mlx with Metal support in Nix, you'd need to use one of the sandbox escape
# hatches which let you interact with a native install of Xcode, such as `composeXcodeWrapper`
# or by changing the upstream (e.g., https://github.com/zed-industries/zed/discussions/7016).
(lib.cmakeBool "MLX_BUILD_METAL" false)
(lib.cmakeBool "USE_SYSTEM_FMT" true)
(lib.cmakeOptionType "filepath" "FETCHCONTENT_SOURCE_DIR_GGUFLIB" "${gguf-tools}")
(lib.cmakeOptionType "filepath" "FETCHCONTENT_SOURCE_DIR_NANOBIND" "${nanobind.src}")
(lib.cmakeFeature "CMAKE_CXX_FLAGS" "-I${lib.getDev nlohmann_json}/include/nlohmann")
];
};
build-system = [
@@ -118,11 +113,7 @@ buildPythonPackage (finalAttrs: {
"python/tests/"
];
disabledTests = [
# brittle memory leak test, see: https://github.com/ml-explore/mlx/pull/3088
"test_siblings_without_eval"
]
++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64) [
disabledTests = lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64) [
# Segmentation fault
"test_lapack"
"test_multivariate_normal"