Skip to content

Commit

Permalink
python3: proper syntax for Windows patches
Browse files Browse the repository at this point in the history
Windows patches were being added with a shell glob, which was dying with
an error. See NixOS#351007. Use filesystem methods to walk the patch set and
retrieve the patch names.

Also, update the patches from the Fedora project to the latest for
Python 3.11.9 and add filtering for any that are already applied to the
3.11.10 in the current cycle.

python312 still fails to cross-compile after this patch, but at least
3.11 will again be available
  • Loading branch information
greg-hellings committed Oct 25, 2024
1 parent 2eacb37 commit 708a493
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions pkgs/development/interpreters/python/cpython/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,28 @@ in with passthru; stdenv.mkDerivation (finalAttrs: {
mingw-patch = fetchgit {
name = "mingw-python-patches";
url = "https://src.fedoraproject.org/rpms/mingw-python3.git";
rev = "45c45833ab9e5480ad0ae00778a05ebf35812ed4"; # for python 3.11.5 at the time of writing.
sha256 = "sha256-KIyNvO6MlYTrmSy9V/DbzXm5OsIuyT/BEpuo7Umm9DI=";
rev = "3edecdbfb4bbf1276d09cd5e80e9fb3dd88c9511"; # for python 3.11.9 at the time of writing.
hash = "sha256-kpXoIHlz53+0FAm/fK99ZBdNUg0u13erOr1XP2FSkQY=";
};
in [
"${mingw-patch}/*.patch"
]);
in (
builtins.map (f: "${mingw-patch}/${f}")
[
# The other patches in that repo are already applied to 3.11.10
"mingw-python3_distutils.patch"
"mingw-python3_frozenmain.patch"
"mingw-python3_make-sysconfigdata.py-relocatable.patch"
"mingw-python3_mods-failed.patch"
"mingw-python3_module-select.patch"
"mingw-python3_module-socket.patch"
"mingw-python3_modules.patch"
"mingw-python3_platform-mingw.patch"
"mingw-python3_posix-layout.patch"
"mingw-python3_pthread_threadid.patch"
"mingw-python3_pythonw.patch"
"mingw-python3_setenv.patch"
"mingw-python3_win-modules.patch"
])
);

postPatch = optionalString (!stdenv.hostPlatform.isWindows) ''
substituteInPlace Lib/subprocess.py \
Expand Down

0 comments on commit 708a493

Please sign in to comment.