NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.47k stars 13.66k forks source link

mupdf: `mutool -v` can't load dylibs on aarch64-darwin #272789

Closed ajaxbits closed 8 months ago

ajaxbits commented 9 months ago

Describe the bug

On my M1 macbook pro, a executing mutool -v will complain with the following:

dyld[85912]: Library not loaded: build/shared-release/libmupdf.dylib
  Referenced from: <no uuid> /nix/store/53anxhdg9mqh8cj568hrqd8w8yfxp07f-mupdf-1.23.5-bin/bin/mutool
  Reason: tried: 'build/shared-release/libmupdf.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSbuild/shared-release/libmupdf.dylib' (no such file), 'build/shared-release/libmupdf.dylib' (no such file), '/usr/local/lib/libmupdf.dylib' (no such file), '/usr/lib/libmupdf.dylib' (no such file, not in dyld cache)
fish: Job 1, 'result-bin/bin/mutool -v' terminated by signal SIGABRT (Abort)

Steps To Reproduce

Steps to reproduce the behavior:

  1. nix build github:nixos/nixpkgs/master#mupdf
  2. ./result-bin/bin/mutool -v

Expected behavior

Version information is outputted, as dyn libs are found.

Additional context

Affects the img2pdf package, which other packages depend on, like paperless-ngx.

Discovered when creating #272563

Notify maintainers

@vrthra @fpletz @lilyinstarlight

Metadata

[user@system:~]$ nix run nixpkgs#nix-info -- -m
 - system: `"aarch64-darwin"`
 - host os: `Darwin 22.5.0, macOS 13.4.1`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.17.0`
 - channels(root): `""`
 - nixpkgs: `not found`

[user@system:~]$ nix flake metadata nixpkgs
Resolved URL:  github:NixOS/nixpkgs/nixpkgs-unstable
Locked URL:    github:NixOS/nixpkgs/09ec6a0881e1a36c29d67497693a67a16f4da573
Description:   A collection of packages for the Nix package manager
Path:          /nix/store/wk5dq7iwpd8yb4mnhb98k687kgdqachh-source
Revision:      09ec6a0881e1a36c29d67497693a67a16f4da573
Last modified: 2023-12-04 06:43:35

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

lilyinstarlight commented 9 months ago

Ah hell, I don't know how I missed this. Thank you for the report!

I'll have a fix prepared imminently

lilyinstarlight commented 9 months ago

Please test if #272807 fixes the issue for you

Thanks again!

ajaxbits commented 9 months ago

Thanks for the fix!! I'll test as soon as I'm able -- likely tomorrow morning CT.

ajaxbits commented 9 months ago

Works for me! https://github.com/NixOS/nixpkgs/pull/272807#issuecomment-1847347779

Endle commented 8 months ago

Has this fix been pushed into stable channel?

pdfarranger $ nix-shell -I nixpkgs=channel:nixpkgs-unstable -p mupdf
these 4 paths will be fetched (24.81 MiB download, 55.70 MiB unpacked):
  /nix/store/8rxm4jzw1dddm53rpc2zdqgafadn7d5n-bash-interactive-5.2-p21
  /nix/store/p9r44cscjyav2nz0g0438c68q1f0k0h4-mupdf-1.23.6
  /nix/store/gcklnclajfqjslr6q2djgcy1773hppix-mupdf-1.23.6-bin
  /nix/store/p64zywc2pgbk7ivnmwlnjvzgslhhdh78-mupdf-1.23.6-dev
copying path '/nix/store/8rxm4jzw1dddm53rpc2zdqgafadn7d5n-bash-interactive-5.2-p21' from 'https://cache.nixos.org'...
copying path '/nix/store/p9r44cscjyav2nz0g0438c68q1f0k0h4-mupdf-1.23.6' from 'https://cache.nixos.org'...
copying path '/nix/store/gcklnclajfqjslr6q2djgcy1773hppix-mupdf-1.23.6-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/p64zywc2pgbk7ivnmwlnjvzgslhhdh78-mupdf-1.23.6-dev' from 'https://cache.nixos.org'...

[nix-shell:/Volumes/extend/src/nixpkgs/pkgs/applications/misc/pdfarranger]$ mupdf -v
dyld[11886]: Library not loaded: build/shared-release/libmupdf.dylib
  Referenced from: <0C1F93C5-B6D1-361A-9B54-B351E22C0654> /nix/store/gcklnclajfqjslr6q2djgcy1773hppix-mupdf-1.23.6-bin/bin/mupdf-gl
  Reason: tried: 'build/shared-release/libmupdf.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSbuild/shared-release/libmupdf.dylib' (no such file), 'build/shared-release/libmupdf.dylib' (no such file), '/usr/local/lib/libmupdf.dylib' (no such file), '/usr/lib/libmupdf.dylib' (no such file, not in dyld cache)
Abort trap: 6

[nix-shell:/Volumes/extend/src/nixpkgs/pkgs/applications/misc/pdfarranger]$ which mupdf
/nix/store/gcklnclajfqjslr6q2djgcy1773hppix-mupdf-1.23.6-bin/bin/mupdf

As the version has been bumped to 1.23.6, I guess the fix (https://github.com/NixOS/nixpkgs/commit/29455886e21c45b8c0b33c57a1b12d1b2c709e25) is already applied, but it still fails on my computer.

$ nix-info -m
 - system: `"aarch64-darwin"`
 - host os: `Darwin 23.1.0, macOS 14.1.2`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
lilyinstarlight commented 8 months ago

No, the fix is still in staging-next (in #275620)

You can see progress to channels a bit more easily at https://nixpk.gs/pr-tracker.html?pr=272807

lilyinstarlight commented 8 months ago

272807 is now in nixos-unstable and nixpkgs-unstable

I'm waiting on the backport PR #273899 (https://nixpk.gs/pr-tracker.html?pr=273899) to make it to nixos-23.11 and then I'll close this issue

lilyinstarlight commented 8 months ago

Fix should be on all supported channels now, closing