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

OS X build error related to libwkhtmltox and get_version #2418

Closed
benmaher opened this Issue Jun 17, 2015 · 8 comments

Comments

Projects
None yet
3 participants
@benmaher

benmaher commented Jun 17, 2015

I'm unable to build from source for OS X. Given that this change occurred on Feb 17, 2015 and there hasn't been an OS X binary released since 0.12.2.1 I'm assuming that this is a new bug. I haven't found any open issues regarding this.

355217a

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: bin/libwkhtmltox.0.12.3.0.dylib (No such file or directory)
install_name_tool -change /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework/CoreText bin/libwkhtmltox.0.12.3.0.dylib
command failed: exit code 256

Tracing this, in build.py -> def build_osx -> def get_version returns a simple_version with 4 levels. This is used later when running install_name_tool which looks for libwkhtmltox.0.12.3.0.dylib. This file doesn't exist because when qmake generates the Makefile it is instructed to create libwkhtmltox.0.12.3.dylib and the following symlinks:

libwkhtmltox.0.12.dylib
libwkhtmltox.0.dylib
libwkhtmltox.dylib

libwkhtmltox.0.12.3.0.dylib is not created as symlink.

I realize this is tied to wkhtmltopdf/qt though I'm creating an issue here as I don't know which code base should address it. I've dug into wkhtmltopdf/qt and found that wkhtmltopdf/qt/qmake/generators/unix/unixmake2.cpp appears to handle the creation of these symlinks. Given that the Makefile has TARGET2 =, this is the only section of code that creates it:

In UnixMakefileGenerator::writeMakeParts
...

    } else if(project->isEmpty("QMAKE_HPUX_SHLIB")) {
        t << "TARGETD       = " << escapeFilePath(var("TARGET_x.y.z")) << endl;
        t << "TARGET0       = " << escapeFilePath(var("TARGET_")) << endl;
        t << "TARGET1       = " << escapeFilePath(var("TARGET_x")) << endl;
        t << "TARGET2       = " << escapeFilePath(var("TARGET_x.y")) << endl;

These TARGET_ vars appear to be created in UnixMakefileGenerator::init2 relying on project variables that store the version. This would also require modification to wkhtmltopdf/qt/qmake/generators/mac/pbx_builder.cpp to support a fourth level to the version.

I've worked around this by changing def get_version -> def make4digit from

while ver.count('.') < 3:

to

while ver.count('.') < 2:

The compile works now although I'm not entirely sure this is the best move as make4digit was added with the commit message "This is required for embedding the version information in the installer." I don't have enough insight to know if my workaround breaks anything. Should wkhtmltopdf/qt be modified or is there a better solution?

@ashkulz ashkulz added the Verified label Jun 20, 2015

@ashkulz ashkulz added this to the 0.12.3 milestone Jun 20, 2015

@ashkulz

This comment has been minimized.

Member

ashkulz commented Jun 20, 2015

Thanks for the very detailed investigation and bug report 👍 The version needs to be 4 digits when creating the Windows installer, but you're right it breaks the OS X build.

@ashkulz ashkulz closed this in cb9394e Jun 30, 2015

@ashkulz ashkulz added Fixed and removed Verified labels Jun 30, 2015

@ashkulz

This comment has been minimized.

Member

ashkulz commented Jun 30, 2015

Thanks, please check that the latest master works for you on OS X.

DanielCeregatti added a commit to DanielCeregatti/wkhtmltopdf that referenced this issue Jul 8, 2015

fix build error on OS X
This was introduced in 355217a,
and reverts that and implements the logic specifically for Windows.

fixes wkhtmltopdf#2418
@ashkulz

This comment has been minimized.

Member

ashkulz commented Jul 14, 2015

A preview for the next release 0.12.3-dev-79ff51e is available, which should contain the fix for this issue (otherwise the build would not have happened...)

Please note that the above downloads will be removed after the 0.12.3 release.

@ashkulz

This comment has been minimized.

Member

ashkulz commented Jan 21, 2016

0.12.3 has been released, which should contain the fix for this issue. Please report back if it is not solved with the above version.

Note that the preview downloads mentioned above have been removed.

@jbertrand-siliconsalad

This comment has been minimized.

jbertrand-siliconsalad commented May 24, 2016

Hi,
When I try to use ./release.py I still get the error:

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: bin/libwkhtmltox.0.12.3.2.dylib (No such file or directory)
install_name_tool -change /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework/CoreText bin/libwkhtmltox.0.12.3.2.dylib
command failed: exit code 256

I am on the branch 0.12.3.x

@ashkulz

This comment has been minimized.

Member

ashkulz commented May 24, 2016

What are the files present in bin/?

@jbertrand-siliconsalad

This comment has been minimized.

jbertrand-siliconsalad commented May 24, 2016

# find . -name libwkhtmltox*
./static-build/osx-cocoa-x86-64/app/bin/libwkhtmltox.0.12.3.dylib
./static-build/osx-cocoa-x86-64/app/bin/libwkhtmltox.0.12.dylib
./static-build/osx-cocoa-x86-64/app/bin/libwkhtmltox.0.dylib
./static-build/osx-cocoa-x86-64/app/bin/libwkhtmltox.dylib
@ashkulz

This comment has been minimized.

Member

ashkulz commented May 25, 2016

Hmm, looks like only 3 digit versions are generated which is strange. Will have to investigate this further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment