Discussion:
[MacPorts] #57594: dyld error when enabling tests for tk +quartz
MacPorts
2018-11-13 04:42:24 UTC
Permalink
#57594: dyld error when enabling tests for tk +quartz
--------------------------+---------------------------------
Reporter: chrstphrchvz | Owner: MarcusCalhoun-Lopez
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.5.4
Keywords: | Port: tk
--------------------------+---------------------------------
Using Tk 8.6.8/8.6.9rc4 on macOS 10.14.1.

If I manually add `test.run yes` to the `tk` portfile under the `+quartz`
variant, and run `port -vt test tk +quartz`, there is an error:
{{{
DYLD_LIBRARY_PATH="`pwd`:/opt/local/lib:${DYLD_LIBRARY_PATH}"; export
DYLD_LIBRARY_PATH; 

dyld: Symbol not found: __cg_jpeg_resync_to_restart
Referenced from:
/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /opt/local/lib/libJPEG.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
}}}
([https://gist.githubusercontent.com/chrstphrchvz/8564f5525d40e28a47c1ee7571ded10a/raw/2d6423e7dbbc504cc3a9f26d47530cf3f6ef3c06/tk869rc4
-quartz-tests.log full test log])

I'm guessing `/opt/local/lib/libJPEG.dylib` should instead be
`/opt/local/lib/libjpeg.dylib` (note this is on a case-insensitive APFS
volume).

There have been
[https://trac.macports.org/query?status=accepted&status=assigned&status=closed&status=new&status=reopened&resolution=fixed&resolution=invalid&resolution=wontfix&resolution=worksforme&description=~__cg_jpeg_resync_to_restart&col=id&col=summary&col=status&col=type&col=priority&col=milestone&col=component&desc=1&order=id
tickets] for similar errors on other ports, and one common diagnosis is
that ports shouldn't use/set `DYLD_LIBRARY_PATH`.

I'm inclined to think this is a MacPorts-specific issue but haven't ruled
out it being an upstream issue.

I am unsure whether tests should be runnable for `+quartz`. My impression
is they were left out of the portfile mainly because they can't be run for
the `+x11` variant (since `port` runs tests as the `macports` user, which
can't access the X11 server).
--
Ticket URL: <https://trac.macports.org/ticket/57594>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-11-13 12:53:42 UTC
Permalink
#57594: dyld error when enabling tests for tk +quartz
---------------------------+---------------------------------
Reporter: chrstphrchvz | Owner: MarcusCalhoun-Lopez
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.5.4
Resolution: | Keywords:
Port: tk |
---------------------------+---------------------------------

Comment (by MarcusCalhoun-Lopez):

This is a know issue.\\
{{{DYLD_FALLBACK_LIBRARY_PATH}}} should be used instead of
{{{DYLD_LIBRARY_PATH}}}.

If we run {{{otool -L
/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO}}}, we see
that the library uses
{{{/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib}}}.\\
When {{{DYLD_FALLBACK_LIBRARY_PATH}}} is set to {{{${prefix}/lib}}}, we
**force** {{{ImageIO}}} to use {{{${prefix}/lib/libjpeg.dylib}}}
instead.\\
Th two {{{libjpeg.dylib}}}s have different symbols, hence the error.

{{{DYLD_FALLBACK_LIBRARY_PATH}}} goes looking for other libraries **only**
if the requested one cannot be found.

This issue has cropped up from time to time.\\
[https://github.com/macports/macports-ports/blob/master/x11/tix/Portfile
tix] and [https://github.com/macports/macports-
ports/blob/master/devel/cargo/Portfile cargo] are two I can think of off
the top of my head.
--
Ticket URL: <https://trac.macports.org/ticket/57594#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-11-15 16:38:22 UTC
Permalink
#57594: dyld error when enabling tests for tk +quartz
---------------------------+---------------------------------
Reporter: chrstphrchvz | Owner: MarcusCalhoun-Lopez
Type: defect | Status: closed
Priority: Normal | Milestone:
Component: ports | Version: 2.5.4
Resolution: fixed | Keywords:
Port: tk |
---------------------------+---------------------------------
Changes (by MarcusCalhoun-Lopez):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"97d4a4bb23681f5bc2c8abb15c77d2e50c9e1de0/macports-ports"
97d4a4bb23681f5bc2c8abb15c77d2e50c9e1de0/macports-ports] (master):
{{{
#!ConfigurableCommitTicketReference repository="macports-ports"
revision="97d4a4bb23681f5bc2c8abb15c77d2e50c9e1de0"
tk: enable tests

Fixes https://trac.macports.org/ticket/57594
}}}
--
Ticket URL: <https://trac.macports.org/ticket/57594#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-11-28 03:35:38 UTC
Permalink
#57594: dyld error when enabling tests for tk +quartz
---------------------------+---------------------------------
Reporter: chrstphrchvz | Owner: MarcusCalhoun-Lopez
Type: defect | Status: closed
Priority: Normal | Milestone:
Component: ports | Version: 2.5.4
Resolution: fixed | Keywords:
Port: tk |
---------------------------+---------------------------------

Comment (by kencu):

There is a minor typo in that comment. You said:
{{{
When DYLD_FALLBACK_LIBRARY_PATH is set to ${prefix}/lib, we force ImageIO
to use ${prefix}/lib/libjpeg.dylib instead.
}}}
but I think you meant:
{{{
When DYLD_LIBRARY_PATH is set to ${prefix}/lib, we force ImageIO to use
${prefix}/lib/libjpeg.dylib instead.
}}}
--
Ticket URL: <https://trac.macports.org/ticket/57594#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-11-28 03:38:12 UTC
Permalink
#57594: dyld error when enabling tests for tk +quartz
---------------------------+---------------------------------
Reporter: chrstphrchvz | Owner: MarcusCalhoun-Lopez
Type: defect | Status: closed
Priority: Normal | Milestone:
Component: ports | Version: 2.5.4
Resolution: fixed | Keywords:
Port: tk |
---------------------------+---------------------------------

Comment (by kencu):

BTW - would this only show up on case-insensitive file systems? {{{libjpeg
vs libJPEG}}}? Maybe that's why some people don't seem to see it.
--
Ticket URL: <https://trac.macports.org/ticket/57594#comment:4>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-11-28 03:44:07 UTC
Permalink
#57594: dyld error when enabling tests for tk +quartz
---------------------------+---------------------------------
Reporter: chrstphrchvz | Owner: MarcusCalhoun-Lopez
Type: defect | Status: closed
Priority: Normal | Milestone:
Component: ports | Version: 2.5.4
Resolution: fixed | Keywords:
Port: tk |
---------------------------+---------------------------------

Comment (by MarcusCalhoun-Lopez):

Thank you for pointing this out.\\
I have made the edit.
Post by MacPorts
{{{
When DYLD_FALLBACK_LIBRARY_PATH is set to ${prefix}/lib, we force
ImageIO to use ${prefix}/lib/libjpeg.dylib instead.
Post by MacPorts
}}}
{{{
When DYLD_LIBRARY_PATH is set to ${prefix}/lib, we force ImageIO to use
${prefix}/lib/libjpeg.dylib instead.
Post by MacPorts
}}}
--
Ticket URL: <https://trac.macports.org/ticket/57594#comment:5>
MacPorts <https://www.macports.org/>
Ports system for macOS
Loading...