Skip to content

python3Packages.pymupdf: propagate mupdf better - #412508

Merged
philiptaron merged 1 commit into
NixOS:masterfrom
philiptaron:pymupdf
May 31, 2025
Merged

philiptaron merged 1 commit into
NixOS:masterfrom
philiptaron:pymupdf

Conversation

@philiptaron

Copy link
Copy Markdown
Contributor

Otherwise, we end up in this situation where this derivation works:

{ pkgs ? import ./. { } }:

pkgs.runCommand "driver" { buildInputs = [ pkgs.python3Packages.pymupdf ]; } ''
  python -c 'import pymupdf;' > $out
''

... but this ostensibly identical derivation fails.

{ pkgs ? import ./. { } }:

pkgs.runCommand "driver" { buildInputs = [ pkgs.python3.withPackages (ps: [ ps.pymupdf ]; } ''
  python -c 'import pymupdf;' > $out
''

What's happening is that the propagated input mupdf-cxx doesn't pass the filter check in requiredPythonModules as it does not have a Python module as defined in that function.

Now, it does.

Huge thanks to hexa (@mweinelt) who debugged this with me on Matrix.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

…on't be filtered out

Otherwise, we end up in this situation where this derivation works:

```nix
{ pkgs ? import ./. { } }:

pkgs.runCommand "driver" { buildInputs = [ pkgs.python3Packages.pymupdf ]; } ''
  python -c 'import pymupdf;' > $out
''
```

... but this ostensibly identical derivation fails.

```nix
{ pkgs ? import ./. { } }:

pkgs.runCommand "driver" { buildInputs = [ pkgs.python3.withPackages (ps: [ ps.pymupdf ]; } ''
  python -c 'import pymupdf;' > $out
''
```

What's happening is that the propagated input `mupdf-cxx` doesn't pass the filter check in `requiredPythonModules` as it does not have a Python module as defined in that function.

Now, it does.

Huge thanks to hexa who debugged this with me on Matrix.

Co-authored-by: Martin Weinelt <[email protected]>
@github-actions github-actions Bot added 6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels May 30, 2025
@philiptaron philiptaron changed the title python3Packages.pymupdf: propagated mupdf-cxx in such a way that it won't be filtered out python3Packages.pymupdf: propagate mupdf better May 30, 2025
@philiptaron
philiptaron marked this pull request as ready for review May 30, 2025 23:17
@philiptaron
philiptaron requested a review from fabaff May 30, 2025 23:17
@philiptaron

Copy link
Copy Markdown
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 412508
Commit: 36354c7702e0a3436d024f4cc5ef1bfb07661526


x86_64-linux

✅ 34 packages built:
  • browsr
  • browsr.dist
  • cardimpose (python312Packages.cardimpose)
  • cardimpose.dist (python312Packages.cardimpose.dist)
  • mcomix
  • mcomix.dist
  • plakativ
  • plakativ.dist
  • private-gpt
  • private-gpt.dist
  • python312Packages.llama-index
  • python312Packages.llama-index-readers-file
  • python312Packages.llama-index-readers-file.dist
  • python312Packages.llama-index-readers-s3
  • python312Packages.llama-index-readers-s3.dist
  • python312Packages.llama-index.dist
  • python312Packages.pdf2docx
  • python312Packages.pdf2docx.dist
  • python312Packages.private-gpt
  • python312Packages.private-gpt.dist
  • python312Packages.pymupdf
  • python312Packages.pymupdf.dist
  • python312Packages.pytikz-allefeld
  • python312Packages.pytikz-allefeld.dist
  • python313Packages.cardimpose
  • python313Packages.cardimpose.dist
  • python313Packages.pdf2docx
  • python313Packages.pdf2docx.dist
  • python313Packages.pymupdf
  • python313Packages.pymupdf.dist
  • python313Packages.pytikz-allefeld
  • python313Packages.pytikz-allefeld.dist
  • termpdfpy
  • termpdfpy.dist

@philiptaron

Copy link
Copy Markdown
Contributor Author

Self-merging due to lack of maintainer and co-authorship.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant