Bug 235385 - [XCBuild] Build via the workspace with USE_WORKSPACE=YES
Summary: [XCBuild] Build via the workspace with USE_WORKSPACE=YES
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-19 15:35 PST by Elliott Williams
Modified: 2022-01-20 13:12 PST (History)
3 users (show)

See Also:


Attachments
Patch (8.34 KB, patch)
2022-01-19 16:28 PST, Elliott Williams
no flags Details | Formatted Diff | Diff
Patch (19.32 KB, patch)
2022-01-19 19:38 PST, Elliott Williams
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Elliott Williams 2022-01-19 15:35:23 PST
[XCBuild] Build via the workspace with USE_WORKSPACE=YES
Comment 1 Elliott Williams 2022-01-19 16:28:50 PST
Created attachment 449529 [details]
Patch
Comment 2 Elliott Williams 2022-01-19 16:29:13 PST
rdar://87489695
Comment 3 Elliott Williams 2022-01-19 16:35:48 PST
Comment on attachment 449529 [details]
Patch

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

FWIW, there are some known edge cases in our Makefile logic that I'd like to address outside ths patch. For example, WebInspectorUI only builds for Mac _or_ installsrc, and the workspace schemes do not accurately model that logic.

> Makefile.shared:-49
> -ifeq ($(findstring UseNewBuildSystem,$(ARGS)),)
> -	CAN_USE_XCBUILD = $(shell perl -I$(SCRIPTS_PATH) -Mwebkitdirs -e 'print canUseXCBuild()')
> -	ifeq ($(CAN_USE_XCBUILD),1)
> -		# Temporarily disable default use of XCBuild until issues with it are ironed out.
> -		#XCODE_OPTIONS += -UseNewBuildSystem=YES
> -		XCODE_OPTIONS += -UseNewBuildSystem=NO
> -	else
> -		XCODE_OPTIONS += -UseNewBuildSystem=NO
> -	endif
> -endif
> -

Removed because we don't need it. *All* non-workspace builds with use the legacy build system, as they currently do, and this flag's behavior changed in rdar://86872452.

> WebKit.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:-6
> -	<key>BuildSystemType</key>
> -	<string>Original</string>

This only affects builds started from the workspace, so EWS + WebKit devs should continue to see PBXBuild for the time being.
Comment 4 Radar WebKit Bug Importer 2022-01-19 16:36:29 PST
<rdar://problem/87798139>
Comment 5 Alexey Proskuryakov 2022-01-19 16:47:46 PST
Comment on attachment 449529 [details]
Patch

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

> Makefile.shared:153
> +ifeq ($(SKIP_INSTALLSRC),YES)
> +	@true
> +else

I don't understand why this is needed. `make installsrc` is only invoked in very specific circumstances, and when it is, it's really necessary. So it's not clear to me how it would be invoked from the root makefile with workspace.
Comment 6 Elliott Williams 2022-01-19 16:49:54 PST
(In reply to Alexey Proskuryakov from comment #5)
> > Makefile.shared:153
> > +ifeq ($(SKIP_INSTALLSRC),YES)
> > +	@true
> > +else
> 
> I don't understand why this is needed. `make installsrc` is only invoked in
> very specific circumstances, and when it is, it's really necessary. So it's
> not clear to me how it would be invoked from the root makefile with
> workspace.

Tools/Makefile is the only place that sets this, to match its current `installsrc` rule. If we'd never actually try to installsrc from Tools/, maybe it's safe to delete this?
Comment 7 Alexey Proskuryakov 2022-01-19 16:54:28 PST
I'm not sure what directory it gets invoked from.
Comment 8 Elliott Williams 2022-01-19 19:38:14 PST
Created attachment 449545 [details]
Patch
Comment 9 Elliott Williams 2022-01-19 19:42:57 PST
(In reply to Elliott Williams from comment #6) 
> Tools/Makefile is the only place that sets this, to match its current
> `installsrc` rule. If we'd never actually try to installsrc from Tools/,
> maybe it's safe to delete this?

(In reply to Alexey Proskuryakov from comment #7)
> I'm not sure what directory it gets invoked from.

Turns out installsrc is impossible to invoke from a workspace build, anyways. If you try to, you get:

    xcodebuild: error: Cannot use the installsrc action with -scheme

It wouldn't be logical for a user or bot to run `make installsrc USE_WORKSPACE=YES`, so it seems fine to not handle this case, and let any errant invocation fall through to the xcodebuild error.
Comment 10 Alexey Proskuryakov 2022-01-19 20:26:03 PST
Comment on attachment 449545 [details]
Patch

r=ews
Comment 11 EWS 2022-01-20 13:12:12 PST
Committed r288316 (246232@main): <https://commits.webkit.org/246232@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 449545 [details].