Bug 182891 - [CMake] Replace AVFoundationSupport.py using CMake
Summary: [CMake] Replace AVFoundationSupport.py using CMake
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CMake (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Don Olmstead
URL:
Keywords:
: 182800 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-02-16 15:18 PST by Don Olmstead
Modified: 2018-08-30 21:36 PDT (History)
9 users (show)

See Also:


Attachments
Patch (11.43 KB, patch)
2018-02-21 11:06 PST, Don Olmstead
no flags Details | Formatted Diff | Diff
Patch (11.23 KB, patch)
2018-02-21 16:18 PST, Don Olmstead
no flags Details | Formatted Diff | Diff
Patch (11.24 KB, patch)
2018-02-21 16:19 PST, Don Olmstead
no flags Details | Formatted Diff | Diff
Patch (13.99 KB, patch)
2018-02-26 17:47 PST, Don Olmstead
no flags Details | Formatted Diff | Diff
Patch (14.00 KB, patch)
2018-02-26 17:52 PST, Don Olmstead
no flags Details | Formatted Diff | Diff
Patch (14.08 KB, patch)
2018-02-28 10:16 PST, Don Olmstead
no flags Details | Formatted Diff | Diff
Patch (15.83 KB, patch)
2018-02-28 12:55 PST, Don Olmstead
no flags Details | Formatted Diff | Diff
Patch (15.85 KB, patch)
2018-08-27 14:57 PDT, Don Olmstead
no flags Details | Formatted Diff | Diff
Patch (15.86 KB, patch)
2018-08-27 14:58 PDT, Don Olmstead
no flags Details | Formatted Diff | Diff
Patch (16.37 KB, patch)
2018-08-28 12:54 PDT, Don Olmstead
no flags Details | Formatted Diff | Diff
Patch (16.29 KB, patch)
2018-08-28 15:37 PDT, Don Olmstead
no flags Details | Formatted Diff | Diff
Patch (16.27 KB, patch)
2018-08-28 16:39 PDT, Don Olmstead
pvollan: review+
ews-watchlist: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews106 for mac-sierra-wk2 (3.59 MB, application/zip)
2018-08-28 19:56 PDT, EWS Watchlist
no flags Details
Patch (16.74 KB, patch)
2018-08-30 12:49 PDT, Don Olmstead
no flags Details | Formatted Diff | Diff
Patch (17.01 KB, patch)
2018-08-30 14:08 PDT, Don Olmstead
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Don Olmstead 2018-02-16 15:18:54 PST
Currently AVFoundationSupport.py looks around for include files. This is something that CMake could be used for instead to determine.
Comment 1 Don Olmstead 2018-02-21 11:06:08 PST
Created attachment 334394 [details]
Patch

This is going to need to be tested on the internal AppleWin build.

Please run it initially to get the contents of WebKitBuild/Release/DerivedSources/PAL/PALHeaderDetection.h

From there make sure that the HAVE checks in cmakeconfig.h match up. If they do then this is good to go. If not then we need to start debugging in the CMake logs.
Comment 2 Don Olmstead 2018-02-21 16:18:32 PST
Created attachment 334423 [details]
Patch

Rebased on latest revision
Comment 3 Don Olmstead 2018-02-21 16:19:18 PST
Created attachment 334424 [details]
Patch
Comment 4 Don Olmstead 2018-02-21 16:20:26 PST
Comment on attachment 334424 [details]
Patch

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

Ok this should hopefully work. Still needs to be checked on Apple Win internal builds

> Source/WebCore/config.h:-28
> -#if PLATFORM(COCOA)

This is already in Platform.h so no need to redefine it here.
Comment 5 Don Olmstead 2018-02-26 17:47:33 PST
Created attachment 334661 [details]
Patch

Rebasing after r229048
Comment 6 EWS Watchlist 2018-02-26 17:49:36 PST
Attachment 334661 [details] did not pass style-queue:


ERROR: Source/WebKitLegacy/win/WebKitPrefix.h:39:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebKitLegacy/win/WebKitPrefix.h:40:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebKitLegacy/win/WebKitPrefix.h:62:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebCore/ChangeLog:8:  You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
Total errors found: 4 in 9 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Don Olmstead 2018-02-26 17:52:12 PST
Created attachment 334662 [details]
Patch

Make style queue happier...
Comment 8 EWS Watchlist 2018-02-26 19:55:52 PST
Attachment 334662 [details] did not pass style-queue:


ERROR: Source/WebKitLegacy/win/WebKitPrefix.h:39:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebKitLegacy/win/WebKitPrefix.h:40:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebKitLegacy/win/WebKitPrefix.h:62:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 3 in 9 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Don Olmstead 2018-02-28 10:16:10 PST
Created attachment 334750 [details]
Patch

Potential fix for apple internal build
Comment 10 EWS Watchlist 2018-02-28 10:19:18 PST
Attachment 334750 [details] did not pass style-queue:


ERROR: Source/WebKitLegacy/win/WebKitPrefix.h:39:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebKitLegacy/win/WebKitPrefix.h:40:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebKitLegacy/win/WebKitPrefix.h:62:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 3 in 9 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 11 Don Olmstead 2018-02-28 12:55:27 PST
Created attachment 334759 [details]
Patch

Use HAVE_SYMBOL to hopefully get further in the apple internal build
Comment 12 EWS Watchlist 2018-02-28 12:57:29 PST
Attachment 334759 [details] did not pass style-queue:


ERROR: Source/WebKitLegacy/win/WebKitPrefix.h:39:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebKitLegacy/win/WebKitPrefix.h:40:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebKitLegacy/win/WebKitPrefix.h:62:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/cmake/OptionsAppleWin.cmake:33:  No trailing spaces  [whitespace/trailing] [5]
Total errors found: 4 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 13 Don Olmstead 2018-03-01 10:49:47 PST
Comment on attachment 334759 [details]
Patch

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

> Source/cmake/OptionsAppleWin.cmake:43
> +    set(CMAKE_REQUIRED_INCLUDES ${WEBKIT_LIBRARIES_INCLUDE_DIR})
> +    set(CMAKE_REQUIRED_LIBRARIES
> +        "${WEBKIT_LIBRARIES_LINK_DIR}/CoreFoundation${DEBUG_SUFFIX}.lib"
> +        "${WEBKIT_LIBRARIES_LINK_DIR}/AVFoundationCF${DEBUG_SUFFIX}.lib"
> +        "${WEBKIT_LIBRARIES_LINK_DIR}/QuartzCore${DEBUG_SUFFIX}.lib"
> +    )
> +    
> +    WEBKIT_CHECK_HAVE_INCLUDE(HAVE_AVCF AVFoundationCF/AVCFBase.h)
> +
> +    if (HAVE_AVCF)
> +        SET_AND_EXPOSE_TO_BUILD(USE_AVFOUNDATION ON)
> +    endif ()
> +
> +    WEBKIT_CHECK_HAVE_SYMBOL(HAVE_AVCF_LEGIBLE_OUTPUT AVCFPlayerItemLegibleOutputSetCallbacks "TargetConditionals.h;dispatch/dispatch.h;AVFoundationCF/AVFoundationCF.h;AVFoundationCF/AVCFPlayerItemLegibleOutput.h")
> +    WEBKIT_CHECK_HAVE_SYMBOL(HAVE_AVFOUNDATION_LOADER_DELEGATE AVCFAssetResourceLoaderSetCallbacks "TargetConditionals.h;dispatch/dispatch.h;AVFoundationCF/AVFoundationCF.h")
> +    WEBKIT_CHECK_HAVE_SYMBOL(HAVE_AVCFURL_PLAYABLE_MIMETYPE AVCFURLAssetIsPlayableExtendedMIMEType "TargetConditionals.h;dispatch/dispatch.h;AVFoundationCF/AVFoundationCF.h")
> +    WEBKIT_CHECK_HAVE_SYMBOL(HAVE_AVCFPLAYERITEM_CALLBACK_VERSION_2 kAVCFPlayerItemLegibleOutput_CallbacksVersion_2 "TargetConditionals.h;dispatch/dispatch.h;AVFoundationCF/AVFoundationCF.h")

On public apple win I am using have symbol rather than looking directly for the include. The have symbol actually creates a C file and tries to compile and link it. The ones expected for public apple win are present so things SHOULD work for the internal apple build
Comment 14 Don Olmstead 2018-03-06 13:13:59 PST
Per Arne if everything is getting detected properly on Apple's internal windows build I'd like to get this reviewed and merged.
Comment 15 Don Olmstead 2018-08-27 14:57:08 PDT
Created attachment 348206 [details]
Patch

Rebased and trying to use a compile check for the callback v2
Comment 16 Don Olmstead 2018-08-27 14:58:21 PDT
Created attachment 348207 [details]
Patch
Comment 17 EWS Watchlist 2018-08-27 15:00:05 PDT
Attachment 348207 [details] did not pass style-queue:


ERROR: Source/WebKitLegacy/win/WebKitPrefix.h:39:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebKitLegacy/win/WebKitPrefix.h:40:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebKitLegacy/win/WebKitPrefix.h:57:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 3 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 18 Don Olmstead 2018-08-27 17:00:42 PDT
Comment on attachment 348207 [details]
Patch

Per Arne everything seems to have built on AppleWin side. Just need confirmation that AppleWin internal builds are happy and have the right values present. If so its good to go.
Comment 19 Don Olmstead 2018-08-28 12:54:06 PDT
Created attachment 348325 [details]
Patch

Verified that the public AppleWin build has the same behavior through the CMake checks.

https://gist.github.com/donny-dont/78a553447df58882b38854863749a6d1 has the outputted cmakeconfig.h
Comment 20 Don Olmstead 2018-08-28 12:55:20 PDT
Comment on attachment 348325 [details]
Patch

Still needs to be verified with the internal AppleWin builds to make sure the have checks pick up everything properly.
Comment 21 EWS Watchlist 2018-08-28 12:57:38 PDT
Attachment 348325 [details] did not pass style-queue:


ERROR: Source/WebKitLegacy/win/WebKitPrefix.h:39:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebKitLegacy/win/WebKitPrefix.h:40:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebKitLegacy/win/WebKitPrefix.h:57:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 3 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 22 Per Arne Vollan 2018-08-28 15:14:24 PDT
Comment on attachment 348325 [details]
Patch

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

> Source/WebCore/config.h:-30
> -#if PLATFORM(COCOA)
> -#define USE_FILE_LOCK 1
> -#endif

Is it correct to remove this define?
Comment 23 Don Olmstead 2018-08-28 15:37:06 PDT
Created attachment 348355 [details]
Patch

Updating based on review feedback
Comment 24 EWS Watchlist 2018-08-28 15:41:23 PDT
Attachment 348355 [details] did not pass style-queue:


ERROR: Source/WebKitLegacy/win/WebKitPrefix.h:55:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 25 Don Olmstead 2018-08-28 16:39:45 PDT
Created attachment 348359 [details]
Patch
Comment 26 EWS Watchlist 2018-08-28 19:56:05 PDT
Comment on attachment 348359 [details]
Patch

Attachment 348359 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/9018378

New failing tests:
accessibility/smart-invert-reference.html
Comment 27 EWS Watchlist 2018-08-28 19:56:07 PDT
Created attachment 348381 [details]
Archive of layout-test-results from ews106 for mac-sierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6
Comment 28 Don Olmstead 2018-08-29 09:16:19 PDT
(In reply to Build Bot from comment #27)
> Created attachment 348381 [details]
> Archive of layout-test-results from ews106 for mac-sierra-wk2
> 
> The attached test failures were seen while running run-webkit-tests on the
> mac-wk2-ews.
> Bot: ews106  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6

I don't see why this would be caused by this patch and I saw a couple bot failures on mac-wk2 for other patches.

Per Arne, Alex or Brent could you give this a review? This should work for Apple's internal builds. I tested it as much as I could without access to it.
Comment 29 Per Arne Vollan 2018-08-30 11:35:54 PDT
Comment on attachment 348359 [details]
Patch

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

r=me. Please make sure the bots are green before landing.

> Source/WebCore/PAL/ChangeLog:8
> +        Remove AVFoundationSupport.py file and invokation.

invocation

> Source/WebKitLegacy/win/WebKitPrefix.h:69
> +#if USE(CG)
> +#ifndef CGFLOAT_DEFINED
> +#if (defined(__LP64__) && __LP64__) || (defined(__x86_64__) && __x86_64__) || defined(_M_X64) || defined(__amd64__)
> +typedef double CGFloat;
> +#else
> +typedef float CGFloat;
> +#endif
> +#define CGFLOAT_DEFINED 1
> +#endif
> +#endif /* USE(CG) */

This could perhaps be put in a new header file (CGFloat.h) to avoid duplication.

> Source/cmake/WebKitCommon.cmake:-78
> -        file(MAKE_DIRECTORY ${DERIVED_SOURCES_PAL_DIR})

Is creating this directory not needed anymore?
Comment 30 Don Olmstead 2018-08-30 12:49:23 PDT
Created attachment 348532 [details]
Patch

Updated based on review
Comment 31 Don Olmstead 2018-08-30 14:08:31 PDT
Created attachment 348544 [details]
Patch

Ok it appears those #defines are needed in config.h so adding them back
Comment 32 Don Olmstead 2018-08-30 14:10:32 PDT
(In reply to Per Arne Vollan from comment #29)
> Comment on attachment 348359 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=348359&action=review
> 
> r=me. Please make sure the bots are green before landing.
> 
> > Source/WebCore/PAL/ChangeLog:8
> > +        Remove AVFoundationSupport.py file and invokation.
> 
> invocation
> 
> > Source/WebKitLegacy/win/WebKitPrefix.h:69
> > +#if USE(CG)
> > +#ifndef CGFLOAT_DEFINED
> > +#if (defined(__LP64__) && __LP64__) || (defined(__x86_64__) && __x86_64__) || defined(_M_X64) || defined(__amd64__)
> > +typedef double CGFloat;
> > +#else
> > +typedef float CGFloat;
> > +#endif
> > +#define CGFLOAT_DEFINED 1
> > +#endif
> > +#endif /* USE(CG) */
> 
> This could perhaps be put in a new header file (CGFloat.h) to avoid
> duplication.

Will look into getting rid of this in a follow up.

> 
> > Source/cmake/WebKitCommon.cmake:-78
> > -        file(MAKE_DIRECTORY ${DERIVED_SOURCES_PAL_DIR})
> 
> Is creating this directory not needed anymore?

Nope its not. AVFoundationSupport.py was the only thing writing to it.
Comment 33 WebKit Commit Bot 2018-08-30 16:28:18 PDT
Comment on attachment 348544 [details]
Patch

Clearing flags on attachment: 348544

Committed r235531: <https://trac.webkit.org/changeset/235531>
Comment 34 WebKit Commit Bot 2018-08-30 16:28:20 PDT
All reviewed patches have been landed.  Closing bug.
Comment 35 Don Olmstead 2018-08-30 17:05:24 PDT
*** Bug 182800 has been marked as a duplicate of this bug. ***
Comment 36 Ross Kirsling 2018-08-30 21:36:20 PDT
Committed build fix for WPE in r235536: <https://trac.webkit.org/changeset/235536>