From e19ce84e47a20a30f622c082cc441fc97324dd01 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 21 Jan 2026 14:31:33 +0000 Subject: [PATCH 1/4] python3Packages.torchtune: use finalAttrs pattern --- pkgs/development/python-modules/torchtune/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/torchtune/default.nix b/pkgs/development/python-modules/torchtune/default.nix index 1fac454501f0..ce757924e984 100644 --- a/pkgs/development/python-modules/torchtune/default.nix +++ b/pkgs/development/python-modules/torchtune/default.nix @@ -35,7 +35,7 @@ writableTmpDirAsHomeHook, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "torchtune"; version = "0.6.1"; pyproject = true; @@ -43,7 +43,7 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "meta-pytorch"; repo = "torchtune"; - tag = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-evhQBpZiUXriL0PAYkEzGypH21iRs37Ix6Nl5YAyeQ0="; }; @@ -134,11 +134,11 @@ buildPythonPackage rec { meta = { description = "PyTorch native post-training library"; homepage = "https://github.com/meta-pytorch/torchtune"; - changelog = "https://github.com/meta-pytorch/torchtune/releases/tag/${src.tag}"; + changelog = "https://github.com/meta-pytorch/torchtune/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.bsd3; maintainers = with lib.maintainers; [ GaetanLepage sarahec ]; }; -} +}) From 530a975b502bdca1d187f48ee6e9fee5581be929 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 21 Jan 2026 14:31:54 +0000 Subject: [PATCH 2/4] python3Packages.executorch: use finalAttrs pattern --- .../development/python-modules/executorch/default.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/executorch/default.nix b/pkgs/development/python-modules/executorch/default.nix index 9013410fb89d..0ffade9dc6b9 100644 --- a/pkgs/development/python-modules/executorch/default.nix +++ b/pkgs/development/python-modules/executorch/default.nix @@ -46,7 +46,7 @@ writableTmpDirAsHomeHook, yaspin, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "executorch"; version = "1.0.1"; pyproject = true; @@ -54,7 +54,7 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "pytorch"; repo = "executorch"; - tag = "v${version}"; + tag = "v${finalAttrs.version}"; # The ExecuTorch repo must be cloned into a directory named exactly `executorch`. # See https://github.com/pytorch/executorch/issues/6475 for progress on a fix for this restriction. @@ -63,7 +63,6 @@ buildPythonPackage rec { fetchSubmodules = true; hash = "sha256-h+nmipFDO/cdPTQXrjM5EkH//wHKBAvlDIp6SBbGN/8="; }; - # src = /home/gaetan/nix/nixpkgs-packages/executorch; postPatch = # Hardcode the default flatc binary path to the nixpkgs flatc @@ -89,7 +88,7 @@ buildPythonPackage rec { ''; env = { - BUILD_VERSION = version; + BUILD_VERSION = finalAttrs.version; }; build-system = [ @@ -194,7 +193,7 @@ buildPythonPackage rec { meta = { description = "On-device AI across mobile, embedded and edge for PyTorch"; homepage = "https://github.com/pytorch/executorch"; - changelog = "https://github.com/pytorch/executorch/releases/tag/v${version}"; + changelog = "https://github.com/pytorch/executorch/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.bsd3; maintainers = with lib.maintainers; [ GaetanLepage ]; badPlatforms = [ @@ -204,4 +203,4 @@ buildPythonPackage rec { lib.systems.inspect.patterns.isDarwin ]; }; -} +}) From c46e5e5e5f4d5ac40c0bc65dab39e1a73cfaf72b Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 21 Jan 2026 14:32:12 +0000 Subject: [PATCH 3/4] python3Packages.executorch: fix build with GCC 15 Tracking: https://github.com/NixOS/nixpkgs/issues/475479 --- pkgs/development/python-modules/executorch/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/development/python-modules/executorch/default.nix b/pkgs/development/python-modules/executorch/default.nix index 0ffade9dc6b9..faf18e94ed5d 100644 --- a/pkgs/development/python-modules/executorch/default.nix +++ b/pkgs/development/python-modules/executorch/default.nix @@ -85,6 +85,15 @@ buildPythonPackage (finalAttrs: { --replace-fail \ "CMAKE_MINIMUM_REQUIRED(VERSION 3.5 FATAL_ERROR)" \ "CMAKE_MINIMUM_REQUIRED(VERSION 3.10 FATAL_ERROR)" + '' + # Fix build with GCC>=15 + + '' + substituteInPlace third-party/flatcc/include/flatcc/portable/grisu3_print.h \ + --replace-fail \ + 'static char hexdigits[16] = "0123456789ABCDEF";' \ + 'static char hexdigits[17] = "0123456789ABCDEF";' + + sed -i "1i #include " backends/apple/coreml/runtime/inmemoryfs/memory_buffer.hpp ''; env = { From cae93b24836783e409a3b4521f578ec61f556e46 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 21 Jan 2026 14:38:34 +0000 Subject: [PATCH 4/4] python3Packages.executorch: relax scikit-learn dependency --- pkgs/development/python-modules/executorch/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/executorch/default.nix b/pkgs/development/python-modules/executorch/default.nix index faf18e94ed5d..95d8a94df950 100644 --- a/pkgs/development/python-modules/executorch/default.nix +++ b/pkgs/development/python-modules/executorch/default.nix @@ -125,6 +125,7 @@ buildPythonPackage (finalAttrs: { "pytest-xdist" ]; pythonRelaxDeps = [ + "scikit-learn" "torchao" ]; dependencies = [