NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.36k stars 13.59k forks source link

Build failure: python312Packages.pymupdf #331934

Open idlip opened 1 month ago

idlip commented 1 month ago

Steps To Reproduce

Steps to reproduce the behavior:

  1. build python312Packages.pymupdf

Build log

builder for '/nix/store/0ibrmx5mkr625p2n5972n7426k6fq5yp-mupdf-1.23.6.drv' failed with exit code 1;
       last 20 log lines:
       > (+5.7s): -b: 1: __main__.py:1638:build: [returned e=1]
       > Traceback (most recent call last):
       >     scripts/mupdfwrap.py:6:<module>(): wrap.__main__.main()
       >     scripts/wrap/__main__.py:2902:main(): jlib.exception_info()
       >     ^except raise:
       >     scripts/wrap/__main__.py:2900:main(): main2()
       >     scripts/wrap/__main__.py:2310:main2(): build( build_dirs, swig_command, args, vs_upgrade)
       >     scripts/wrap/__main__.py:1638:build(): jlib.build(
       >     scripts/jlib.py:2213:build(): system( command, out=out, verbose=verbose, executable=executable, caller=2)
       >     scripts/jlib.py:1682:system(): raise Exception( message)
       > Exception: Command failed: c++ \
       >     -o build/shared-release/libmupdfcpp.so \
       >  \
       >     -O2 -DNDEBUG \
       >     -fPIC -shared \
       >     -I /build/mupdf-1.23.6-source/include \
       >     -I /build/mupdf-1.23.6-source/platform/c++/include \
       >      platform/c++/implementation/classes.cpp platform/c++/implementation/classes2.cpp platform/c++/implementation/exceptions.cpp platform/c++/implementation/extra.cpp platform/c++/implementation/functions.cpp platform/c++/implementation/internal.cpp \
       >     -L build/shared-release -l mupdf -Wl,-rpath,'$ORIGIN',-z,origin
       > /nix/store/1r32fki5z5ivgaikgh8pq0r6vz3b0jpj-stdenv-linux/setup: line 193: pop_var_context: head of shell_variables not a function context
       For full logs, run 'nix log /nix/store/0ibrmx5mkr625p2n5972n7426k6fq5yp-mupdf-1.23.6.drv'.
error: 1 dependencies of derivation '/nix/store/bgrlbv73rkijhw2n03yh98r503l7jrk4-python3.12-pymupdf-1.23.26.drv' failed to build

Additional context

I see few more build failures with other packages. Guess so it is not built in cache as well.

Eg: python312Packages.imbalanced-learn

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.10.2, NixOS, 24.11 (Vicuna), 24.11.20240728.52ec9ac`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - nixpkgs: `/nix/store/bcghcr9qwqmanpds017w75mcqda4fgab-source`

Add a :+1: reaction to issues you find important.

ghpzin commented 1 month ago

On Hydra: https://hydra.nixos.org/job/nixos/trunk-combined/nixpkgs.python312Packages.pymupdf.x86_64-linux https://hydra.nixos.org/build/267693093

Build failed because mupdf-cxx did not build on x86_64-linux and aarch64-linux (both darwin targets are okay).

mupdf itself is green: https://hydra.nixos.org/job/nixos/trunk-combined/nixpkgs.mupdf.x86_64-linux https://hydra.nixos.org/build/267654619

I assume the issue is related to things pymudpf does to generate mupdf-cxx. And based on this upstream issue: https://github.com/pymupdf/PyMuPDF/issues/3279 is probably related to recent update to clang_18 and fixed on version 1.24.0 (which may need some updated version of mupdf too).


PS: You need to ping pymupdf maintainers in "Notify maintainers" for them to notice it: @teto

idlip commented 1 month ago

Hey, thank you for the thorough investigation and detailed report on the issue.