Skip to content

Commit

Permalink
[Make] Use workspace builds by default
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=242625

Reviewed by Alexey Proskuryakov.

Use the currently-selected workspace [1] for Make-based builds. This
improves build performance as it has in other build workflows, by doing
a parallel scheme-based build instead of building each project
sequentially.

The old, manually ordered build workflow can be used by passing
USE_WORKSPACE=NO to Make.

* Makefile: USE_WORKSPACE enabled by default.
* Makefile.shared: USE_WORKSPACE enabled by default. Avoid checking the
  value of USE_WORKSPACE when deciding whether to print a scheme vs. a
  project name.
* Source/Makefile: USE_WORKSPACE enabled by default.
* Source/bmalloc/bmalloc.xcodeproj/xcshareddata/xcschemes/bmalloc.xcscheme: Added.
  Needed so that Source/bmalloc can be built via the workspace.
* Tools/Makefile: USE_WORKSPACE enabled by default.

MobileMiniBrowser was being built by `make -C Tools`, but was never
added to the "All Tools" scheme. Add an aggregate which builds
MobileMiniBrowser, but only during iOS builds (like we did for
MiniBrowser and Mac in https://commits.webkit.org/251501@main).

* Tools/MobileMiniBrowser/Configurations/Base.xcconfig: Move
  SUPPORTED_PLATFORMS logic down to MobileMiniBrowser.xcconfig, so the
  aggregate target can use platform filtering.
* Tools/MobileMiniBrowser/Configurations/MobileMiniBrowser.xcconfig:
* Tools/MobileMiniBrowser/MobileMiniBrowser.xcodeproj/project.pbxproj:

Add the new `MobileMiniBrowser (Platform filters)` target to the
relevant schemes.

* WebKit.xcworkspace/xcshareddata/xcschemes/All Modules.xcscheme:
* WebKit.xcworkspace/xcshareddata/xcschemes/All Tools.xcscheme:

[1]: A workspace is selected automatically when making a "top-level"
build, such as building the entire WebKit tree. Once a workspace is
selected, single-projects builds (e.g. make -C Source/WebCore) use the
same workspace, preserving incremental build data. This allows engineers
building the internal tree to iterate on individual projects while still
being able to make incremental workspace builds. See
https://commits.webkit.org/252363@main for more information.

Canonical link: https://commits.webkit.org/252794@main
  • Loading branch information
emw-apple committed Jul 25, 2022
1 parent c55c39c commit 1648743
Show file tree
Hide file tree
Showing 10 changed files with 189 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ifeq ($(USE_WORKSPACE),YES)
ifneq ($(USE_WORKSPACE),NO)

SCHEME = All Modules
SCRIPTS_PATH = Tools/Scripts
Expand Down
6 changes: 4 additions & 2 deletions Makefile.shared
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SCRIPTS_PATH ?= ../Tools/Scripts

ifeq ($(USE_WORKSPACE),YES)
ifneq ($(USE_WORKSPACE),NO)
SCHEME ?= $(notdir $(CURDIR))
XCODE_TARGET = -scheme "$(SCHEME)"

Expand All @@ -12,9 +12,11 @@ endif
# happen in the workspace. When this is only passed on the command line, it
# invalidates build results made in the IDE (rdar://88135402).
#XCODE_OPTIONS += WK_VALIDATE_DEPENDENCIES=YES_ERROR
BUILD_GOAL = $(SCHEME)
else
USE_WORKSPACE =
BUILD_WEBKIT_OPTIONS += --no-use-workspace
BUILD_GOAL = $(notdir $(CURDIR))
endif


Expand Down Expand Up @@ -125,7 +127,7 @@ endef
define invoke_xcode
( \
echo; \
echo "===== BUILDING $(if $(USE_WORKSPACE),$(SCHEME),$(notdir $(CURDIR))) ====="; \
echo "===== BUILDING $(BUILD_GOAL) ====="; \
echo; \
$1 xcodebuild $2 $(OTHER_OPTIONS) $(XCODE_TARGET) $(XCODE_OPTIONS) $3 | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} \
)
Expand Down
2 changes: 1 addition & 1 deletion Source/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ifeq ($(USE_WORKSPACE),YES)
ifneq ($(USE_WORKSPACE),NO)

include ../Makefile.shared
SCHEME = All Source
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1330"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "14F271BD18EA3963008C152F"
BuildableName = "libbmalloc.a"
BlueprintName = "bmalloc"
ReferencedContainer = "container:bmalloc.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "14F271BD18EA3963008C152F"
BuildableName = "libbmalloc.a"
BlueprintName = "bmalloc"
ReferencedContainer = "container:bmalloc.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
<InstallAction
buildConfiguration = "Release">
</InstallAction>
</Scheme>
4 changes: 2 additions & 2 deletions Tools/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ifeq ($(USE_WORKSPACE),YES)
ifneq ($(USE_WORKSPACE),NO)

include ../Makefile.shared
SCHEME = All Tools
Expand Down Expand Up @@ -61,4 +61,4 @@ clean:
installsrc:
@true

endif # USE_WORKSPACE
endif # USE_WORKSPACE
2 changes: 1 addition & 1 deletion Tools/MobileMiniBrowser/Configurations/Base.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ MTL_ENABLE_DEBUG_INFO = NO;
VALIDATE_PRODUCT = YES;
WARNING_CFLAGS = -Wall -W -Wformat=2 -Wno-unused-parameter -Wundef;

SUPPORTED_PLATFORMS = iphoneos iphonesimulator;
SUPPORTED_PLATFORMS = iphoneos iphonesimulator macosx appletvos appletvsimulator watchos watchsimulator;
SDKROOT = $(SDKROOT_$(USE_INTERNAL_SDK));
SDKROOT_ = macosx;
SDKROOT_YES = macosx.internal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

PRODUCT_NAME = MiniBrowser

STRIP_STYLE=debugging
SUPPORTED_PLATFORMS = iphoneos iphonesimulator;
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,23 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 52;
objects = {

/* Begin PBXAggregateTarget section */
DD2A1D052888D1CB00342472 /* MobileMiniBrowser (Platform filters) */ = {
isa = PBXAggregateTarget;
buildConfigurationList = DD2A1D082888D1CB00342472 /* Build configuration list for PBXAggregateTarget "MobileMiniBrowser (Platform filters)" */;
buildPhases = (
);
dependencies = (
DD2A1D0A2888D1D300342472 /* PBXTargetDependency */,
);
name = "MobileMiniBrowser (Platform filters)";
productName = "MiniBrowser (Platform filters)";
};
/* End PBXAggregateTarget section */

/* Begin PBXBuildFile section */
3F0B439B1D908D0C00D186B5 /* looping2s.html in Resources */ = {isa = PBXBuildFile; fileRef = 3F0B439A1D908D0C00D186B5 /* looping2s.html */; };
3F0B439D1D908DE700D186B5 /* test2s.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 3F0B439C1D908DE700D186B5 /* test2s.mp4 */; };
Expand Down Expand Up @@ -44,6 +58,13 @@
remoteGlobalIDString = CD498B3A1D76348000681FA7;
remoteInfo = MobileMiniBrowser;
};
DD2A1D092888D1D300342472 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = CD1DAF8A1D709E3600017CF0 /* Project object */;
proxyType = 1;
remoteGlobalIDString = CD1DAF911D709E3600017CF0;
remoteInfo = MobileMiniBrowser;
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
Expand Down Expand Up @@ -302,6 +323,9 @@
CreatedOnToolsVersion = 8.0;
ProvisioningStyle = Automatic;
};
DD2A1D052888D1CB00342472 = {
CreatedOnToolsVersion = 13.3;
};
};
};
buildConfigurationList = CD1DAF8D1D709E3600017CF0 /* Build configuration list for PBXProject "MobileMiniBrowser" */;
Expand All @@ -320,6 +344,7 @@
CD1DAF911D709E3600017CF0 /* MobileMiniBrowser */,
CD1DAFAA1D709E3600017CF0 /* MobileMiniBrowserUITests */,
CD498B3A1D76348000681FA7 /* MobileMiniBrowser.framework */,
DD2A1D052888D1CB00342472 /* MobileMiniBrowser (Platform filters) */,
);
};
/* End PBXProject section */
Expand Down Expand Up @@ -396,6 +421,12 @@
target = CD498B3A1D76348000681FA7 /* MobileMiniBrowser.framework */;
targetProxy = CD498B401D76348000681FA7 /* PBXContainerItemProxy */;
};
DD2A1D0A2888D1D300342472 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
platformFilter = ios;
target = CD1DAF911D709E3600017CF0 /* MobileMiniBrowser */;
targetProxy = DD2A1D092888D1D300342472 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
Expand Down Expand Up @@ -438,7 +469,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = MobileMiniBrowser/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = org.webkit.MobileMiniBrowser;
PRODUCT_NAME = MobileMiniBrowser;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -451,7 +485,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = MobileMiniBrowser/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = org.webkit.MobileMiniBrowser;
PRODUCT_NAME = MobileMiniBrowser;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -462,7 +499,11 @@
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = MobileMiniBrowserUITests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = org.webkit.MobileMiniBrowserUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_TARGET_NAME = MobileMiniBrowser;
Expand All @@ -473,7 +514,11 @@
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = MobileMiniBrowserUITests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = org.webkit.MobileMiniBrowserUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_TARGET_NAME = MobileMiniBrowser;
Expand All @@ -491,7 +536,11 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = MobileMiniBrowser/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = org.webkit.MobileMiniBrowserFramework;
PRODUCT_NAME = MobileMiniBrowser;
SKIP_INSTALL = YES;
Expand All @@ -511,7 +560,11 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = MobileMiniBrowser/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = org.webkit.MobileMiniBrowserFramework;
PRODUCT_NAME = MobileMiniBrowser;
SKIP_INSTALL = YES;
Expand All @@ -520,6 +573,18 @@
};
name = Release;
};
DD2A1D062888D1CB00342472 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
};
name = Debug;
};
DD2A1D072888D1CB00342472 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
Expand Down Expand Up @@ -559,6 +624,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
DD2A1D082888D1CB00342472 /* Build configuration list for PBXAggregateTarget "MobileMiniBrowser (Platform filters)" */ = {
isa = XCConfigurationList;
buildConfigurations = (
DD2A1D062888D1CB00342472 /* Debug */,
DD2A1D072888D1CB00342472 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = CD1DAF8A1D709E3600017CF0 /* Project object */;
Expand Down
14 changes: 14 additions & 0 deletions WebKit.xcworkspace/xcshareddata/xcschemes/All Modules.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,20 @@
ReferencedContainer = "container:Tools/MiniBrowser/MiniBrowser.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DD2A1D052888D1CB00342472"
BuildableName = "MobileMiniBrowser (Platform filters)"
BlueprintName = "MobileMiniBrowser (Platform filters)"
ReferencedContainer = "container:Tools/MobileMiniBrowser/MobileMiniBrowser.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
Expand Down
14 changes: 14 additions & 0 deletions WebKit.xcworkspace/xcshareddata/xcschemes/All Tools.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@
ReferencedContainer = "container:Tools/DumpRenderTree/DumpRenderTree.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DD2A1D052888D1CB00342472"
BuildableName = "MobileMiniBrowser (Platform filters)"
BlueprintName = "MobileMiniBrowser (Platform filters)"
ReferencedContainer = "container:Tools/MobileMiniBrowser/MobileMiniBrowser.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
Expand Down

0 comments on commit 1648743

Please sign in to comment.