Bug 80398 - [Qt] Add qmake config tests for JPEG and PNG library
Summary: [Qt] Add qmake config tests for JPEG and PNG library
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Zoltan Horvath
URL:
Keywords: Qt
Depends on: 32410
Blocks: 80400
  Show dependency treegraph
 
Reported: 2012-03-06 01:34 PST by Zoltan Horvath
Modified: 2012-03-07 03:55 PST (History)
3 users (show)

See Also:


Attachments
proposed patch (6.66 KB, patch)
2012-03-07 01:56 PST, Zoltan Horvath
no flags Details | Formatted Diff | Diff
proposed patch, style fixed (6.66 KB, patch)
2012-03-07 02:07 PST, Zoltan Horvath
no flags Details | Formatted Diff | Diff
proposed patch, style fixed (6.66 KB, patch)
2012-03-07 02:12 PST, Zoltan Horvath
vestbo: review-
vestbo: commit-queue-
Details | Formatted Diff | Diff
proposed patch (6.49 KB, patch)
2012-03-07 02:46 PST, Zoltan Horvath
vestbo: review+
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zoltan Horvath 2012-03-06 01:34:14 PST
Continue from:
https://bugs.webkit.org/show_bug.cgi?id=32410#c23

(In reply to comment #23)
> (From update of attachment 128446 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=128446&action=review
> 
> r=me.
> 
> > Source/WebCore/WebCore.pri:214
> > +    LIBS += -ljpeg -lpng12
> 
> It would be nice to replace the direct linkage with qmake config tests that print out a message or abort. That can be done in a follow-up patch of course :)
Comment 1 Zoltan Horvath 2012-03-07 01:56:12 PST
Created attachment 130572 [details]
proposed patch

It's my first contribution to config.test, it might need improved. :-)
Comment 2 WebKit Review Bot 2012-03-07 01:58:39 PST
Attachment 130572 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Tools/qmake/config.tests/jpeg/jpeg.cpp:28:  Alphabetical sorting problem.  [build/include_order] [4]
Tools/qmake/config.tests/png/png.cpp:30:  Use 0 instead of NULL.  [readability/null] [5]
Total errors found: 2 in 8 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Zoltan Horvath 2012-03-07 02:07:37 PST
Created attachment 130573 [details]
proposed patch, style fixed

NULLs of PNG fixed.
In case of JPEG I have to use this include order otherwise it won't work.
Comment 4 WebKit Review Bot 2012-03-07 02:10:23 PST
Attachment 130573 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Tools/qmake/config.tests/jpeg/jpeg.cpp:28:  Alphabetical sorting problem.  [build/include_order] [4]
Tools/qmake/config.tests/png/png.cpp:30:  Use 0 instead of NULL.  [readability/null] [5]
Total errors found: 2 in 8 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Zoltan Horvath 2012-03-07 02:12:09 PST
Created attachment 130575 [details]
proposed patch, style fixed
Comment 6 WebKit Review Bot 2012-03-07 02:15:14 PST
Attachment 130575 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Tools/qmake/config.tests/jpeg/jpeg.cpp:28:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 8 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Tor Arne Vestbø 2012-03-07 02:27:18 PST
Comment on attachment 130575 [details]
proposed patch, style fixed

View in context: https://bugs.webkit.org/attachment.cgi?id=130575&action=review

> Source/WebCore/WebCore.pri:221
> +    haveQt(5):!contains(config_test_jpeg, yes) error("JPEG library not found!")
> +    haveQt(5):!contains(config_test_png, yes) error("PNG 1.2 library not found!")

do one scope for Qt5, eg:

haveQt(5) {
    # Qt5 allows us to use config tests to check for the presence of these libraries
    !contains(config_test_libjpeg, yes): error("JPEG library not found!")
    !contains(config_test_libpng yes): error("PNG 1.2 library not found!")
}

also note the colon after each condition (except when using { )

Ideally we'd have these hard dependencies somewhere that gets run up-front, so that you don't have to build all of WTF and JSC until finding out you're missing dependencies, but let's deal with that later (we still want to allow people to build JSC only, etc).

> Tools/qmake/config.tests/jpeg/jpeg.pro:11
> +test.commands = test -f $$OBJECTS_DIR/jpeg.o
> +test.depends = $$OBJECTS_DIR/jpeg.o
> +QMAKE_EXTRA_TARGETS += test
> +
> +default.target = all
> +default.depends += test
> +QMAKE_EXTRA_TARGETS += default

You don't need this part. qmake + make will produce an executable named "jpeg" if everything is fine, so the test will pass

> Tools/qmake/config.tests/png/png.pro:11
> +test.commands = test -f $$OBJECTS_DIR/png.o
> +test.depends = $$OBJECTS_DIR/png.o
> +QMAKE_EXTRA_TARGETS += test
> +
> +default.target = all
> +default.depends += test
> +QMAKE_EXTRA_TARGETS += default

Same with this, not needed

> Tools/qmake/sync.profile:6
> +    png => {},
> +    jpeg => {},

i prefer they were named libpng and libjpg
Comment 8 Tor Arne Vestbø 2012-03-07 02:28:30 PST
(In reply to comment #7)
> Ideally we'd have these hard dependencies somewhere that gets run up-front, so that you don't have to build all of WTF and JSC until finding out you're missing dependencies, but let's deal with that later (we still want to allow people to build JSC only, etc).

Actually strike that, we'll run make qmake up front, so we'll catch these before builing anything (though we generate derived sources).
Comment 9 Tor Arne Vestbø 2012-03-07 02:28:55 PST
(In reply to comment #6)
> i prefer they were named libpng and libjpg

sorry, libjpeg
Comment 10 Zoltan Horvath 2012-03-07 02:46:01 PST
Created attachment 130578 [details]
proposed patch

Thanks for the review!

I modified the patch.
Comment 11 WebKit Review Bot 2012-03-07 02:48:33 PST
Attachment 130578 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Tools/qmake/config.tests/libjpeg/libjpeg.cpp:28:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 8 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 12 Tor Arne Vestbø 2012-03-07 03:17:11 PST
Comment on attachment 130578 [details]
proposed patch

great, thanks!
Comment 13 WebKit Review Bot 2012-03-07 03:20:38 PST
Comment on attachment 130578 [details]
proposed patch

Rejecting attachment 130578 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 1

ERROR: /mnt/git/webkit-commit-queue/Source/WebCore/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive).

Full output: http://queues.webkit.org/results/11838919
Comment 14 Tor Arne Vestbø 2012-03-07 03:31:02 PST
Comment on attachment 130578 [details]
proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=130578&action=review

> Source/WebCore/ChangeLog:10
> +

Ugh, you need a Reviewed by NOBODY (OOPS!). line here to please the commit queue.

>> Tools/qmake/config.tests/libjpeg/libjpeg.cpp:28
>> +#include <jpeglib.h>
> 
> Alphabetical sorting problem.  [build/include_order] [4]

You can probably fix this while you're at it.
Comment 15 Zoltan Horvath 2012-03-07 03:41:37 PST
(In reply to comment #14)
> (From update of attachment 130578 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=130578&action=review
> 
> > Source/WebCore/ChangeLog:10
> > +
> 
> Ugh, you need a Reviewed by NOBODY (OOPS!). line here to please the commit queue.

Ups. My excessive use of vim's dd :) I'm going to land by hand and add the line.

> >> Tools/qmake/config.tests/libjpeg/libjpeg.cpp:28
> >> +#include <jpeglib.h>
> > 
> > Alphabetical sorting problem.  [build/include_order] [4]
> 
> You can probably fix this while you're at it.

stdio.h have to go before libjpeg.h because libjpeg.h needs size_t and FILE declarations. I removed stdlib.h because it's not necessary.
Comment 16 Zoltan Horvath 2012-03-07 03:55:14 PST
Landed in http://trac.webkit.org/changeset/110045.