Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#52049 closed defect (fixed)

lnav opportunistically links with MacPorts curl

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: g5pw (Aljaž Srebrnič)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: haspatch Cc:
Port: lnav

Description

I think some dependency(ies) are missing.

If MacPorts curl is installed with the +http2 variant, then lnav ends up linked with libnghttp2.dylib, though it doesn't declare a dependency on curl or nghttp2:

$ otool -L /opt/local/bin/lnav
/opt/local/bin/lnav:
	/opt/local/lib/libnghttp2.14.dylib (compatibility version 24.0.0, current version 24.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)

If MacPorts curl is installed without the +http2 variant, lnav doesn't link with libnghttp2.dylib or libcurl.dylib:

/opt/local/bin/lnav:
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)

(I don't understand why it doesn't link with MacPorts curl here.)

If MacPorts curl is not installed, lnav uses the macOS version of curl:

/opt/local/bin/lnav:
	/usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current version 8.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)

But it fails to build on older versions of macOS where the version of curl is too old.

Attachments (1)

lnav.diff (1.1 KB) - added by ryandesign (Ryan Carsten Schmidt) 8 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 8 years ago by g5pw (Aljaž Srebrnič)

Wow, good catch. I think we should enforce MacPorts' curl and add a http2 variant to lnav dependant on nghttp2.

comment:2 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Just having nghttp2 installed didn't seem to cause lnav to link with it, only when curl was configured with it. But I don't understand why lnav would then directly link with libnghttp2.dylib but not libcurl.dylib. I didn't look into it too closely though.

Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: lnav.diff added

comment:3 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: haspatch added

For some reason this build system thinks it should link to the static libraries by default. There's a configure switch to make it link to the dynamic libraries, which is what we want.

comment:4 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

comment:5 Changed 8 years ago by g5pw (Aljaž Srebrnič)

Thanks for the fix, Ryan!

Note: See TracTickets for help on using tickets.