{"action":"created","issue":{"url":"https://api.github.com/repos/Homebrew/homebrew-core/issues/6161","repository_url":"https://api.github.com/repos/Homebrew/homebrew-core","labels_url":"https://api.github.com/repos/Homebrew/homebrew-core/issues/6161/labels{/name}","comments_url":"https://api.github.com/repos/Homebrew/homebrew-core/issues/6161/comments","events_url":"https://api.github.com/repos/Homebrew/homebrew-core/issues/6161/events","html_url":"https://github.com/Homebrew/homebrew-core/issues/6161","id":184618691,"number":6161,"title":"[qt5] Build is subtly misconfigured, and breaks the macdeployqt tool","user":{"login":"LRFLEW","id":607715,"avatar_url":"https://avatars.githubusercontent.com/u/607715?v=3","gravatar_id":"","url":"https://api.github.com/users/LRFLEW","html_url":"https://github.com/LRFLEW","followers_url":"https://api.github.com/users/LRFLEW/followers","following_url":"https://api.github.com/users/LRFLEW/following{/other_user}","gists_url":"https://api.github.com/users/LRFLEW/gists{/gist_id}","starred_url":"https://api.github.com/users/LRFLEW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LRFLEW/subscriptions","organizations_url":"https://api.github.com/users/LRFLEW/orgs","repos_url":"https://api.github.com/users/LRFLEW/repos","events_url":"https://api.github.com/users/LRFLEW/events{/privacy}","received_events_url":"https://api.github.com/users/LRFLEW/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-10-22T08:50:24Z","updated_at":"2016-10-23T23:10:44Z","closed_at":null,"body":"This is a weird issue, and may end up not being Homebrew's fault directly. However, this problem doesn't appear with Qt's releases, so I think it's a problem with how Qt's configure/build/install scripts are interacting with Homebrew's setup. If it turns out to be a problem with Qt directly, then I'd like to use this to get a little more information I can use to make a bug report on Qt's site.\r\n\r\nThe problem becomes clear when you use `otool -L` to look at the dependencies for different Qt frameworks. Let's take QtGui for example. Here's what I get with the Sierra bottle of Qt 5.7.0 (I truncated the output a bit):\r\n\r\n```\r\n$ otool -L QtGui.framework/Versions/5/QtGui \r\nQtGui.framework/Versions/5/QtGui:\r\n\t/usr/local/opt/qt5/lib/QtGui.framework/Versions/5/QtGui (compatibility version 5.7.0, current version 5.7.0)\r\n\t/usr/local/Cellar/qt5/5.7.0/lib/QtCore.framework/Versions/5/QtCore (compatibility version 5.7.0, current version 5.7.0)\r\n\t/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)\r\n\t/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)\r\n\t...\r\n```\r\n\r\nIn case you don't know what `otool -L` does, here a simple breakdown of what it returns. The first line is the file as you passed it in to the command line (this is to allow it to work when you pass multiple files). The second line is the library's id. This is the path that gets stored in a binary when you link against this. The rest of the lines are the links that this library has to other libraries. These are the paths the binary looks for the dependencies when loading it to run something. Most of these links are to system libraries, but you can see that the first one links to QtCore.\r\n\r\nThe problem here is that the id and the first link use different paths. The id uses the unversioned location (aka, `/usr/local/opt/qt5`), whereas the links use the versioned location (aka, `/usr/local/Cellar/qt5/<version>`). This pattern is matched by all the frameworks for Qt.\r\n\r\nNow, this is ok for running the binaries because the unversioned path symlinks to the versioned one, so they both refer to the same file. However, things break when you try to copy the framework out of the Cellar, which is exactly what `macdeployqt` does. The purpose of the tool is to make the app bundles that qmake/make create self-contained, which involves copying in all the dependencies. Because the links specify *where* to look for the libraries, the tool has to change the ids and links to their new path (using @executable_path to be app-location independent). However, because the links don't match the id of the linked library, `macdeployqt` can't find the link to replace it. This causes the resulting binary to always look for the dependent libraries in the exact cellar location, which fails if the user has a different version of Qt installed, or has the cellar in a different location, or doesn't have Brew installed at all.\r\n\r\nAll the links should match the id of the linked file anyways, so something has gone wrong here. I'm not exactly sure what, though. When you link to a library (ex. by passing `-l<library>` to clang), the compiler uses the id to set the link, which suggests that the id is getting changed at some point after building everything. However, there doesn't appear to be any such id change in the formula, and it doesn't make sense for the Qt installer to change the id in this way, so I have no clue how it could be being changed."},"comment":{"url":"https://api.github.com/repos/Homebrew/homebrew-core/issues/comments/255621477","html_url":"https://github.com/Homebrew/homebrew-core/issues/6161#issuecomment-255621477","issue_url":"https://api.github.com/repos/Homebrew/homebrew-core/issues/6161","id":255621477,"user":{"login":"ilovezfs","id":5268928,"avatar_url":"https://avatars.githubusercontent.com/u/5268928?v=3","gravatar_id":"","url":"https://api.github.com/users/ilovezfs","html_url":"https://github.com/ilovezfs","followers_url":"https://api.github.com/users/ilovezfs/followers","following_url":"https://api.github.com/users/ilovezfs/following{/other_user}","gists_url":"https://api.github.com/users/ilovezfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ilovezfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilovezfs/subscriptions","organizations_url":"https://api.github.com/users/ilovezfs/orgs","repos_url":"https://api.github.com/users/ilovezfs/repos","events_url":"https://api.github.com/users/ilovezfs/events{/privacy}","received_events_url":"https://api.github.com/users/ilovezfs/received_events","type":"User","site_admin":false},"created_at":"2016-10-23T23:10:44Z","updated_at":"2016-10-23T23:10:44Z","body":">Either way, I also lose the useful patches Brew adds\r\n\r\nWhat are you referring to?\r\n\r\n>Unlike other formula, which set the minimum macOS version to the version being installed on, qt5 always builds to support its lowest-supported version\r\n\r\nThat is probably a bug if true."}}
{"actor":{"display_login":"ilovezfs"}}