Opened 6 months ago

Closed 5 months ago

#72898 closed defect (fixed)

pandoc: missing or opportunistic dependency on libffi

Reported by: jmroot (Joshua Root) Owned by: judaew (Vadym-Valdis Yudaiev)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: essandess (Steve Smith)
Port: pandoc

Description

Some but not all of our pandoc binaries are linked with libffi:

% otool -L pandoc-3.7.0.2_0.darwin_21.arm64/opt/local/bin/pandoc
pandoc-3.7.0.2_0.darwin_21.arm64/opt/local/bin/pandoc:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)
	/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.3.1)
	/opt/local/lib/libiconv.2.dylib (compatibility version 9.0.0, current version 9.1.0)
	/opt/local/lib/libgmp.10.dylib (compatibility version 16.0.0, current version 16.0.0)
	/opt/local/lib/libffi.8.dylib (compatibility version 10.0.0, current version 10.4.0)
	/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 60158.100.133)

No dependency is declared in the Portfile, which causes runtime failures like this (from gocryptfs):

Rendering MANPAGE.md to gocryptfs.1
dyld[77491]: Library not loaded: '/opt/local/lib/libffi.8.dylib'
  Referenced from: '/opt/local/bin/pandoc'
  Reason: tried: '/opt/local/lib/libffi.8.dylib' (no such file), '/usr/local/lib/libffi.8.dylib' (no such file), '/usr/lib/libffi.8.dylib' (no such file)
MANPAGE-render.bash: line 7: 77491 Abort trap: 6           pandoc "$IN" -s -t man >> "$OUT"

At least macOS 11 and 12 arm64 are affected.

Change History (5)

comment:1 Changed 5 months ago by ryandesign (Ryan Carsten Schmidt)

comment:2 Changed 5 months ago by essandess (Steve Smith)

But pandoc does depend on libffi:

port echo rdepof:pandoc | grep libffi
libffi 

Apparently via cabal:

port rdeps pandoc
  cabal
    cabal-prebuilt
      curl
        libpsl
          python310
            libffi

Should this be added as a direct dependency?

comment:3 Changed 5 months ago by jmroot (Joshua Root)

Since cabal is only a build-time dependency, it is not necessarily installed when pandoc is installed from a binary archive. More broadly, yes, a port should directly depend on everything that it uses directly, rather than relying on a dependency of a dependency, which may change in future.

comment:5 Changed 5 months ago by essandess (Steve Smith)

Resolution: fixed
Status: assignedclosed

In 9910c8980286842324d7a3e0492fddcb9d2408b9/macports-ports (master):

pandoc: Update to version 3.8, dependency fix

Fixes: #72898

Note: See TracTickets for help on using tickets.