Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attempt to get OSX build working for Qt5 #35

Merged
merged 3 commits into from
Apr 11, 2017
Merged

attempt to get OSX build working for Qt5 #35

merged 3 commits into from
Apr 11, 2017

Conversation

gillins
Copy link
Contributor

@gillins gillins commented Apr 5, 2017

Currently get the following error:

dyld: Library not loaded: @rpath/libicui18n.58.dylib
  Referenced from: /Users/sam/miniconda3/conda-bld/qt_1491371174383/work/qt-everywhere-opensource-src-5.6.2/qtbase/lib/libQt5Core.5.dylib
  Reason: image not found

Does anyone know why this might happen? Am I setting DYLD_FALLBACK_LIBRARY_PATH incorrectly?

cc: @jakirkham
xref: #15

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@ccordoba12
Copy link
Contributor

What happens if you leave DYLD_FALLBACK_LIBRARY_PATH as it was? I mean, that way it's only used by make and not by configure

@gillins
Copy link
Contributor Author

gillins commented Apr 5, 2017

Same problem....

@ccordoba12
Copy link
Contributor

You could also try to use an older version of conda-build. Last time I compiled Qt5 was with 2.0...

@gillins
Copy link
Contributor Author

gillins commented Apr 6, 2017

Ping @danclewley

@jakirkham
Copy link
Member

Is it possible it is linking to the system copy of icu instead? Do you have your build log around? Maybe throw it in a gist so we can look at it more closely.

@jakirkham
Copy link
Member

Also as a side note have been trying to use -Wl,-rpath,$PREFIX/lib instead of DYLD_FALLBACK_LIBRARY_PATH. The latter seems to be problematic on 10.11+; whereas, the former should work regardless.

xref: conda-forge/conda-forge.github.io#238

@gillins
Copy link
Contributor Author

gillins commented Apr 6, 2017

Is it possible it is linking to the system copy of icu instead? Do you have your build log around?

How would we know? Note that it can't find the file rather than a missing entry point. See https://gist.github.com/gillins/c1c776f8a4b7ffa836f4f61faf846d96

Dependencies look ok (I think):

$ otool -L /Users/sam/miniconda3/conda-bld/qt_1491452143185/work/qt-everywhere-opensource-src-5.6.2/qtbase/lib/libQt5Core.5.dylib
/Users/sam/miniconda3/conda-bld/qt_1491452143185/work/qt-everywhere-opensource-src-5.6.2/qtbase/lib/libQt5Core.5.dylib:
	@rpath/libQt5Core.5.dylib (compatibility version 5.6.0, current version 5.6.2)
	/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
	@rpath/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	@rpath/libicui18n.58.dylib (compatibility version 58.0.0, current version 58.1.0)
	@rpath/libicuuc.58.dylib (compatibility version 58.0.0, current version 58.1.0)
	@rpath/libicudata.58.dylib (compatibility version 58.0.0, current version 58.1.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1258.0.0)
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 728.9.0)
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1404.46.0)
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 48.0.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1258.1.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)

Sorry I'm not very knowledgeable about OSX.

Also as a side note have been trying to use -Wl,-rpath,$PREFIX/lib instead of DYLD_FALLBACK_LIBRARY_PATH.

How would we change the build.sh to do this? Anyway I'm on 10.10 so should work!

@gillins
Copy link
Contributor Author

gillins commented Apr 11, 2017

I have it working - turns out the Makefile appears to unset DYLD_FALLBACK_LIBRARY_PATH, but there is a -R option to configure that works instead.

@jakirkham can you confirm you can build this on your configuration?
@ccordoba12 Are these lines still needed: https://github.com/conda-forge/qt-feedstock/blob/master/recipe/build.sh#L156 ? I see osx-post.sh etc haven't been copied from anaconda-recipes, but do we still need them or should they be converted to activate scripts??

@ccordoba12
Copy link
Contributor

Are these lines still needed

Please leave them as they are. You can try to improve our approach in another build, for now the most important thing is to get this finished.

And great job at finding the error, by the way!

@gillins gillins changed the title WIP: attempt to get OSX build working for Qt5 attempt to get OSX build working for Qt5 Apr 11, 2017
@jakirkham
Copy link
Member

So I'm seeing it is trying to use the 10.10 framework instead of the 10.9 framework. Are we missing an option somewhere? 😕 FWIW I have both SDKs as I'm trying to build on something similar to Travis CI. IOW XCode 6.4 on macOS 10.10.

@stuarteberg
Copy link
Contributor

stuarteberg commented Apr 11, 2017

I think I have a working build. Here are the details:

I'm seeing it is trying to use the 10.10 framework instead of the 10.9 framework.

I was seeing something similar on my machine (macOS 10.12). By default, Qt's macx-clang mkspec uses QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7, but since I don't have the 10.7 SDK, it defaults to the highest version available (10.12 in my case).

Are we missing an option somewhere?

The configure script allows me to provide -sdk macosx10.9 as an argument, but that seems to make no difference. The only way I could get it to use my 10.9 SDK was to patch qtbase/mkspecs/macx-clang/qmake.conf:

--- qtbase/mkspecs/macx-clang/qmake.conf
+++ qtbase/mkspecs/macx-clang/qmake.conf
@@ -11,6 +11,6 @@
 include(../common/clang.conf)
 include(../common/clang-mac.conf)

-QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7
+QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.9

 load(qt_config)

BTW, using the 10.9 SDK, I ran into a different problem: Qt's libTest framework attempts to use the macOS XCTest framework. But that requires macOS 10.10. I saw errors like this:

In file included from qxctestlogger.mm:41:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.h:35:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCAbstractTest.h:34:1: error:
      unknown type name 'NS_ASSUME_NONNULL_BEGIN'
NS_ASSUME_NONNULL_BEGIN
^

Here again, the easiest way to eliminate the failure was to write a patch:

--- qtbase/src/testlib/testlib.pro
+++ qtbase/src/testlib/testlib.pro
@@ -83,7 +83,7 @@
     }

     # XCTest support
-    !lessThan(QMAKE_XCODE_VERSION, "6.0") {
+    !lessThan(QMAKE_XCODE_VERSION, "6.0"):!lessThan(QMAKE_DEPLOYMENT_TARGET, "10.10") {
         OBJECTIVE_SOURCES += qxctestlogger.mm
         HEADERS += qxctestlogger_p.h

With those changes, the package builds. You can test out the built package from my channel. (Warning: I didn't increment the build number!)

conda install -c stuarteberg qt=5.6.2=1

My branch with these changes can be found here:
https://github.com/stuarteberg/qt-feedstock/tree/osx-qt5

FWIW, I'm using Xcode 8.3

@gillins
Copy link
Contributor Author

gillins commented Apr 11, 2017

Can we merge this PR so @stuarteberg can submit a new one with the above SDK fixes? Alternatively, the new PR can contain the fixes in this one so we are just merging once. I don't mind 😄

@jakirkham
Copy link
Member

I'm ok with merging. I got most of the way through the build (even though it was using the 10.10 SDK). I expect it would have finished (ran for like 5+hrs), but vagrant terminated the connection due to network changes. 😖 Anyways willing to give it another shot after @stuarteberg submits his patches.

@stuarteberg
Copy link
Contributor

Alternatively, the new PR can contain the fixes in this one so we are just merging once.

I guess the easiest way to do that would be to merge my commits into your branch, and then push it:

git remote add stuart https://github.com/stuarteberg/qt-feedstock
git fetch stuart
git merge stuart/osx-qt5
git push origin master

@ccordoba12
Copy link
Contributor

Let's merge it so @stuarteberg can open a new PR right away.

@ccordoba12 ccordoba12 merged commit 26b0c26 into conda-forge:master Apr 11, 2017
@stuarteberg stuarteberg mentioned this pull request Apr 11, 2017
@stuarteberg
Copy link
Contributor

Let's merge it so @stuarteberg can open a new PR right away.

OK, submitted as #36.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants