Bug 214043 - Building with the macOS Big Sur public SDK fails
Summary: Building with the macOS Big Sur public SDK fails
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rob Buis
URL:
Keywords:
Depends on: 214235 214237 214238 214242 214253
Blocks:
  Show dependency treegraph
 
Reported: 2020-07-07 07:22 PDT by Rob Buis
Modified: 2020-07-16 03:32 PDT (History)
14 users (show)

See Also:


Attachments
Patch (13.25 KB, patch)
2020-07-07 09:46 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (4.03 KB, patch)
2020-07-11 08:40 PDT, Rob Buis
ap: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Buis 2020-07-07 07:22:02 PDT
Building with the public SDK fails (Xcode 11.5 and Big Sur), there are multiple problems.
Comment 1 Rob Buis 2020-07-07 09:46:34 PDT
Created attachment 403702 [details]
Patch
Comment 2 Rob Buis 2020-07-07 09:53:59 PDT
Actually it seems Xcode 11.5 is not supposed to work on Big Sur, at least the command line tools refuse to install.
However the build problems with Xcode 12 are very similar. I am not very familiar with this code and how to cleanly fix it, so this is a rough patch but it unblocks me locally.
Some points:
- I do not know how Source/WTF/wtf/PlatformHave.h could test for public sdk.
- Setting _allowsHTTP3 seems problematic because it is marked readonly. How could that ever work?
- the typedef enum seems a problem for clang although it seems valid C++ to me.

Any hints appreciated! :)
Comment 3 Alexey Proskuryakov 2020-07-07 10:10:59 PDT
We should make every attempt to not guard functionality on USE(APPLE_INTERNAL_SDK), because we want the open source build to be real, and to work the same as what Apple ships as much as possible.

I think that it would be easiest for someone at Apple to fix the build. Do you need it soon?
Comment 4 Saagar Jha 2020-07-07 10:11:46 PDT
I'm using the Xcode 12 SDK and seeing issues as well. The first one I ran into is a missing AXSIsolatedTreeMode, which I suspect is defined in the internal SDK and hiding the build failure: https://bugs.webkit.org/show_bug.cgi?id=208691#c19. I tried working around this by patching out ENABLE(ACCESSIBILITY_ISOLATED_TREE) code and ran into this, which I fixed: https://bugs.webkit.org/show_bug.cgi?id=213911. So now I'm up to WebCore, which fails because it's missing ANGLE headers. It seems to me like the "Copy Headers" phase from the ANGLE static library target should be doing this, but it doesn't show up in the build log at all so this might be some sort of dependency tracking failure in the build system.
Comment 5 Darin Adler 2020-07-07 10:11:54 PDT
Comment on attachment 403702 [details]
Patch

These changes don’t seem right. We want to require the internal SDK only if absolutely necessary. We need to go slower, one item at a time. And also, as you said, need to try with a supported Xcode/SDK combination.
Comment 6 Rob Buis 2020-07-07 10:19:59 PDT
Right, do not take this patch too seriously, it is just something quick I did to build and do my normal development (I only put serious patches for review). At least it should show where the problems are.

As usual quicker is better, but I am not completely blocked. It is just an extra hassle when developing, and also it is not so nice to work on this stuff for me because touching some of these files (like PlatformHave.h) cause huge rebuilds on my poor 2015 mbp...
Comment 7 Rob Buis 2020-07-07 10:21:40 PDT
(In reply to Saagar Jha from comment #4)
> I'm using the Xcode 12 SDK and seeing issues as well. The first one I ran
> into is a missing AXSIsolatedTreeMode, which I suspect is defined in the
> internal SDK and hiding the build failure:
> https://bugs.webkit.org/show_bug.cgi?id=208691#c19. I tried working around
> this by patching out ENABLE(ACCESSIBILITY_ISOLATED_TREE) code and ran into
> this, which I fixed: https://bugs.webkit.org/show_bug.cgi?id=213911. So now
> I'm up to WebCore, which fails because it's missing ANGLE headers. It seems
> to me like the "Copy Headers" phase from the ANGLE static library target
> should be doing this, but it doesn't show up in the build log at all so this
> might be some sort of dependency tracking failure in the build system.

We are in the same boat, although I run into AXSIsolatedTreeMode problem but not ANGLE problem it seems.
Comment 8 Saagar Jha 2020-07-07 10:25:11 PDT
I hit that one only after patching out that feature. But the fact that you didn't see it in Xcode 11.5 lends credence to the fact that it's an Xcode-related change, and I wasn't just missing something stupid when I was looking at why that part was failing :P

I've also just found out that second beta has dropped, so I'll install that and see if that resolves any issues.
Comment 9 Rob Buis 2020-07-07 10:30:57 PDT
(In reply to Alexey Proskuryakov from comment #3)
> I think that it would be easiest for someone at Apple to fix the build. Do
> you need it soon?

I agree that it would be easiest for someone at Apple to fix the build, as I said on my 2015 mbp working on this is no fun and I am not so familiar with the internal/public SDK. For me this is mid-priority as I have non WebKit projects I can work on.
Comment 10 Rob Buis 2020-07-07 10:34:23 PDT
(In reply to Saagar Jha from comment #8)
> I've also just found out that second beta has dropped, so I'll install that
> and see if that resolves any issues.

Argh, 30 minutes after I grabbed 12A6159 :) Thanks for the heads up, I'll also try it.
Comment 11 Alexey Proskuryakov 2020-07-07 11:28:17 PDT
I don't expect the second beta to change anything in this regard.
Comment 12 Saagar Jha 2020-07-07 15:01:25 PDT
As you guessed, installing the new Xcode beta does not help :(
Comment 13 Rob Buis 2020-07-11 08:40:16 PDT
Created attachment 404053 [details]
Patch
Comment 14 Darin Adler 2020-07-11 12:10:52 PDT
Comment on attachment 404053 [details]
Patch

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

> Source/WebKit/ChangeLog:9
> +        The preconnect ping feature does not build using the Xcode 11.5 public
> +        SDK, so add a check for APPLE_INTERNAL_SDK.

Could you tell me more about why it does not build using the public SDK? We should be very reluctant to put things behind USE(APPLE_INTERNAL_SDK).
Comment 15 Alexey Proskuryakov 2020-07-11 14:31:27 PDT
Comment on attachment 404053 [details]
Patch

This CFNetwork functionality is not present in current macOS 11 seed versions, so it's more than an SDK issue. I don't think that we should wait for it to become available, so disabling it completely seems unavoidable. But we need to also compile out code in TestWebKitAPI. 

I can think of two approaches. 

1. Disable HAVE_PRECONNECT_PING in PlatformHave.h for public SDK for now. This would need to reference a bug to re-enable it.

2. Use runtime respondsToSelector checks (TestWebKitAPI part could be somewhat tricky).
Comment 16 Alexey Proskuryakov 2020-07-11 14:33:10 PDT
> Actually it seems Xcode 11.5 is not supposed to work on Big Sur, at least the command line tools refuse to install.

Removed Xcode 11.5 from the title.
Comment 17 Rob Buis 2020-07-12 07:20:16 PDT
(In reply to Darin Adler from comment #14)
> Comment on attachment 404053 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=404053&action=review
> 
> > Source/WebKit/ChangeLog:9
> > +        The preconnect ping feature does not build using the Xcode 11.5 public
> > +        SDK, so add a check for APPLE_INTERNAL_SDK.
> 
> Could you tell me more about why it does not build using the public SDK? We
> should be very reluctant to put things behind USE(APPLE_INTERNAL_SDK).

FWIW build error is:
In file included from WebKitBuild/Release/DerivedSources/WebCore/unified-sources/UnifiedSource198.cpp:5:
In file included from ./loader/CookieJar.cpp:35:
In file included from Source/WebCore/platform/network/NetworkStorageSession.h:42:
PAL/pal/spi/cf/CFNetworkSPI.h:71:1: error: expected unqualified-id
@interface _NSHTTPConnectionInfo : NSObject
^
PAL/pal/spi/cf/CFNetworkSPI.h:73:1: error: expected unqualified-id
@property (readonly) BOOL isValid;
^
PAL/pal/spi/cf/CFNetworkSPI.h:74:1: error: expected unqualified-id
@end
^
PAL/pal/spi/cf/CFNetworkSPI.h:78:1: error: expected unqualified-id
@end
^
Comment 18 Darin Adler 2020-07-12 10:10:39 PDT
Comment on attachment 404053 [details]
Patch

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

>>> Source/WebKit/ChangeLog:9
>>> +        SDK, so add a check for APPLE_INTERNAL_SDK.
>> 
>> Could you tell me more about why it does not build using the public SDK? We should be very reluctant to put things behind USE(APPLE_INTERNAL_SDK).
> 
> FWIW build error is:
> In file included from WebKitBuild/Release/DerivedSources/WebCore/unified-sources/UnifiedSource198.cpp:5:
> In file included from ./loader/CookieJar.cpp:35:
> In file included from Source/WebCore/platform/network/NetworkStorageSession.h:42:
> PAL/pal/spi/cf/CFNetworkSPI.h:71:1: error: expected unqualified-id
> @interface _NSHTTPConnectionInfo : NSObject
> ^
> PAL/pal/spi/cf/CFNetworkSPI.h:73:1: error: expected unqualified-id
> @property (readonly) BOOL isValid;
> ^
> PAL/pal/spi/cf/CFNetworkSPI.h:74:1: error: expected unqualified-id
> @end
> ^
> PAL/pal/spi/cf/CFNetworkSPI.h:78:1: error: expected unqualified-id
> @end
> ^

That error above is about Objective-C declarations in a header that’s included by a non-Objective-C source file. The fix for that one error is to put the declarations inside an #ifdef __OBJC__ or defined(__OBJC__) block. Note, for example, NSURLSessionTask below.
Comment 19 Rob Buis 2020-07-12 14:15:43 PDT
(In reply to Darin Adler from comment #18)

> 
> That error above is about Objective-C declarations in a header that’s
> included by a non-Objective-C source file. The fix for that one error is to
> put the declarations inside an #ifdef __OBJC__ or defined(__OBJC__) block.
> Note, for example, NSURLSessionTask below.

Thanks, I moved that fix to https://bugs.webkit.org/show_bug.cgi?id=214238.
Comment 20 Saagar Jha 2020-07-13 17:37:39 PDT
Couple new issues just cropped up on 11.0 having to do with HAVE(LARGE_CONTROL_SIZE) (corresponding availability macro defined anywhere) and HAVE(ALTERNATE_ICONS) (defined correctly and enabled on my system, but causes the use of what looks like undeclared SPI +[NSImage _imageWithSystemSymbolName:]). I'll try declaring the appropriate things, seeing if that helps, and sending in a patch if so.
Comment 21 Darin Adler 2020-07-13 17:44:50 PDT
When new versions come out there are always a ton of things like this, and we know they exist for Big Sur, and the new versions of iOS, watchOS and tvOS.

People at Apple typically fix these during the summer while the operating systems make their way from beta to GM.

In this case, Jonathan Bedard said (in another bug), "Aakash started work on [macOS Big Sur 2 weeks ago, but I think tvOS and watchOS EWS were a higher priority. Someone from [the Apple WebKit team] will get [the macOS Big Sur build] working in the next 2 weeks."
Comment 22 Saagar Jha 2020-07-13 17:54:13 PDT
(I appreciate the update, but am a bit unsure if that was meant to be purely informational or a polite way of saying "we know about the issue, we're working on fixing it, please stop bothering us with updates and don't send in patches"…)
Comment 23 Darin Adler 2020-07-13 17:56:35 PDT
I don’t mind if some non-Apple contributors send patches, but there’s a good chance they won’t be correct, and I hope the process is not too frustrating.

I also don’t think this can all be completed by someone outside Apple.

And I wanted to point out that we plan to handle it this year the way we have every other year.
Comment 24 Saagar Jha 2020-07-14 20:23:40 PDT
Fair enough :) I've created https://bugs.webkit.org/show_bug.cgi?id=214338 with a patch that has a slight chance of having useful things in it. That, coupled with disabling ENABLE_ACCESSIBILITY_ISOLATED_TREE and HAVE_INCREMENTAL_PDF_APIS (which still use SPI that I didn't want to bother guessing the values of) got me a successful build for Intel, though I haven't tried running it yet. On Apple silicon I get through most of the build but the linker fails, so I still need to figure out what is going on there.
Comment 25 Rob Buis 2020-07-15 00:13:05 PDT
(In reply to Saagar Jha from comment #24)
> Fair enough :) I've created https://bugs.webkit.org/show_bug.cgi?id=214338
> with a patch that has a slight chance of having useful things in it. That,
> coupled with disabling ENABLE_ACCESSIBILITY_ISOLATED_TREE and
> HAVE_INCREMENTAL_PDF_APIS (which still use SPI that I didn't want to bother
> guessing the values of) got me a successful build for Intel, though I
> haven't tried running it yet. On Apple silicon I get through most of the
> build but the linker fails, so I still need to figure out what is going on
> there.

It seems we are doing similar work, see the bugs linked to this one :)
I think it is not needed to disable ENABLE_ACCESSIBILITY_ISOLATED_TREE, see https://bugs.webkit.org/show_bug.cgi?id=214237.
Quite possibly the HAVE_INCREMENTAL_PDF_APIS issue is one that only Apple employees can fix.
Comment 26 Jonathan Bedard 2020-07-15 22:26:11 PDT
Linked this up to https://bugs.webkit.org/show_bug.cgi?id=214396, which should be enough to get WebKit to build for Big Sur with the Seed 1 SDK.
Comment 27 Rob Buis 2020-07-16 03:32:48 PDT
(In reply to Jonathan Bedard from comment #26)
> Linked this up to https://bugs.webkit.org/show_bug.cgi?id=214396, which
> should be enough to get WebKit to build for Big Sur with the Seed 1 SDK.

That fixes my build, thanks! I will close this bug therefore.