Skip to content

fix: replace mimetypes.patch for wrapped knownfiles layout - #7

Merged
diefans merged 1 commit into
mainfrom
fix/mimetypes-wrapped-patch
Oct 27, 2026
Merged

diefans merged 1 commit into
mainfrom
fix/mimetypes-wrapped-patch

Conversation

@diefans

@diefans diefans commented Oct 27, 2026

Copy link
Copy Markdown

Problem

CPython 3.14.9+ (and 3.11.18+/3.12.16+/3.13.18+/3.15.x) wrap the knownfiles list in Lib/mimetypes.py in an if sys.platform == "win32" branch. nixpkgs' mimetypes.patch targets the old flat layout, so it fails to apply:

applying patch .../mimetypes.patch
patching file Lib/mimetypes.py
Hunk #1 FAILED at 40.

This makes every 3.14.9+ build fail — including the latest."3.14" alias (currently 3.14.10) and exact pins like 3.14.9 — with any nixpkgs rev (verified against b6018f87, 674a2028, master). The same applies to the current latest aliases 3.11.18, 3.12.16, 3.13.18 and 3.15.2.

Fix

  • New patches/mimetypes-wrapped.patch: same transformation as nixpkgs' mimetypes.patch, but matching the wrapped layout. It still emits the @mime-types@ marker that nixpkgs' substituteInPlace --replace-fail requires (so a plain filterOutPatch would not work).
  • New override entry using the existing replacePatch machinery, applied to all affected versions (3.11.18 <= version < 3.16).

Verification

Built successfully with the patched flake (using devenv's nixpkgs input, github:cachix/devenv-nixpkgs/d97234e5 → nixpkgs-src 674a2028):

  • packages.x86_64-linux."3.14.9"
  • packages.x86_64-linux."3.14.10"

CPython 3.14.9+ (and 3.11.18+/3.12.16+/3.13.18+/3.15.x) wrap the
`knownfiles` list in Lib/mimetypes.py in an `if sys.platform ==
"win32"` branch, so nixpkgs' mimetypes.patch (targeting the old flat
layout) fails to apply:

  applying patch .../mimetypes.patch
  patching file Lib/mimetypes.py
  Hunk #1 FAILED at 40.

This breaks building every 3.14.9+ release, i.e. the current
`latest."3.14"` alias (3.14.10), with any nixpkgs rev.

Add a replacement patch matching the wrapped layout (still emitting the
@mime-types@ marker that nixpkgs substitutes with --replace-fail) and
apply it via the existing replacePatch override machinery for all
affected versions.
@diefans
diefans merged commit d7a5d6d into main Oct 27, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant