| Summary: | Need a way to include WebKitAdditions code in WebKit API headers | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Wenson Hsieh <wenson_hsieh> | ||||||||
| Component: | WebKit API | Assignee: | Wenson Hsieh <wenson_hsieh> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | Normal | CC: | andersca, bdakin, commit-queue, mitz, thorton, webkit-bug-importer | ||||||||
| Priority: | P2 | Keywords: | DoNotImportToRadar | ||||||||
| Version: | WebKit Nightly Build | ||||||||||
| Hardware: | Unspecified | ||||||||||
| OS: | Unspecified | ||||||||||
| Bug Depends on: | |||||||||||
| Bug Blocks: | 196284 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Wenson Hsieh
2019-03-22 23:54:52 PDT
Created attachment 365804 [details]
There has got to be a better way :(
Work towards: <rdar://problem/47228232> Created attachment 365820 [details]
Patch
This approach, while hacky, should at least fulfill these requirements: - When building with a non-internal SDK, we don't produce framework headers with invalid content (e.g. #if USE(APPLE_INTERNAL_SDK)). - When building with an internal SDK, we produce framework headers that contain the internal bits from WebKitAdditions. - When building with an internal SDK, the symbols defined in the WebKitAdditions pieces can be referenced in implementation files. Comment on attachment 365820 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=365820&action=review This is 😡 but OK. For now. > Source/WebKit/mac/replace-webkit-additions-includes.py:35 > + file_in_build_directory = open("%s/%s" % (built_products_directory, additions_path), "r") os.path.join (in a bunch of places) > Source/WebKit/mac/replace-webkit-additions-includes.py:75 > + print "(%s): failed to write to file: %s" % (argv[0], header_path) print as a function? what happens with python3? do we care? I don't know? Comment on attachment 365820 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=365820&action=review >> Source/WebKit/mac/replace-webkit-additions-includes.py:35 >> + file_in_build_directory = open("%s/%s" % (built_products_directory, additions_path), "r") > > os.path.join (in a bunch of places) 👍🏻 > Source/WebKit/mac/replace-webkit-additions-includes.py:50 > + header_path = argv[1] > + built_products_directory = argv[2] > + sdk_root_directory = argv[3] I also added sanity checks here to return early and print usage if the wrong number of arguments is supplied. >> Source/WebKit/mac/replace-webkit-additions-includes.py:75 >> + print "(%s): failed to write to file: %s" % (argv[0], header_path) > > print as a function? what happens with python3? do we care? I don't know? Good catch, we should be compatible with python3! I ran this with `/usr/bin/env python3` for good measure, and verified that everything behaves as expected. Created attachment 366117 [details]
Patch for landing
Comment on attachment 366117 [details] Patch for landing Clearing flags on attachment: 366117 Committed r243569: <https://trac.webkit.org/changeset/243569> |