build-jsc should invoke make instead of calling xcodebuild directly
authorsbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Jan 2020 02:33:44 +0000 (02:33 +0000)
committersbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Jan 2020 02:33:44 +0000 (02:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=205960

Reviewed by Keith Miller.

.:

* Makefile.shared:

Tools:

This makes build-jsc invoke make instead of directly invoking xcodebuild.
There are some benefits here:
- 'make' is a more standard way to build than build-jsc, so as we make
improvements to the make build (e.g r254234), we'll get the same improvements
in build-jsc.

- There has been a longstanding bug where if you did if you did
`build-jsc --release && cd Source/JavaScriptCore && make release`
then the `make release` call would rebuild all of JavaScriptCore.
If build-jsc directly invokes make, this issue goes away and allows
the two to interoperate as expected.

* Scripts/build-jsc:
(buildMyProject):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254248 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Makefile.shared
Tools/ChangeLog
Tools/Scripts/build-jsc

index 7b5cac4..6ef11c4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,15 @@
 
         * Makefile.shared:
 
+2020-01-08  Saam Barati  <sbarati@apple.com>
+
+        build-jsc should invoke make instead of calling xcodebuild directly
+        https://bugs.webkit.org/show_bug.cgi?id=205960
+
+        Reviewed by Keith Miller.
+
+        * Makefile.shared:
+
 2020-01-08  Mark Lam  <mark.lam@apple.com>
 
         Rename testing build configuration to release+assert, and add new testing build configuration.
index d0e455c..1344e99 100644 (file)
@@ -91,30 +91,30 @@ export DSYMUTIL_NUM_THREADS = $(shell sysctl -n hw.activecpu)
 export PATH = $(shell getconf PATH)
 
 all: set_asan_configuration
-       ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
+       ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)' | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
 
 debug d development dev develop: force
        $(SCRIPTS_PATH)/set-webkit-configuration --debug $(ASAN_OPTION) $(WK_LTO_OPTION)
-       ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
+       ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)' | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
 
 release r deployment dep deploy: force
        $(SCRIPTS_PATH)/set-webkit-configuration --release $(ASAN_OPTION) $(WK_LTO_OPTION)
-       ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
+       ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)' | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
 
 release+assert ra: force
        $(SCRIPTS_PATH)/set-webkit-configuration --release $(ASAN_OPTION) $(WK_LTO_OPTION)
-       ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='ASSERT_ENABLED=1 $$(inherited)' | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
+       ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) ASSERT_ENABLED=1 $$(inherited)' | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
 
 testing t: force
        $(SCRIPTS_PATH)/set-webkit-configuration --debug $(ASAN_OPTION) $(WK_LTO_OPTION) --force-optimization-level=O3
-       ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
+       ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)' | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
 
 analyze:
        $(SCRIPTS_PATH)/set-webkit-configuration --debug $(ASAN_OPTION) $(WK_LTO_OPTION)
 ifndef PATH_TO_SCAN_BUILD
-       ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) RUN_CLANG_STATIC_ANALYZER=YES | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
+       ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)' RUN_CLANG_STATIC_ANALYZER=YES | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
 else
-       ( $(SET_COLOR_DIAGNOSTICS_ARG); $(PATH_TO_SCAN_BUILD) xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
+       ( $(SET_COLOR_DIAGNOSTICS_ARG); $(PATH_TO_SCAN_BUILD) xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)' | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
 endif
 
 set_asan_configuration:
index b6a2802..3c7a76e 100644 (file)
@@ -1,3 +1,25 @@
+2020-01-08  Saam Barati  <sbarati@apple.com>
+
+        build-jsc should invoke make instead of calling xcodebuild directly
+        https://bugs.webkit.org/show_bug.cgi?id=205960
+
+        Reviewed by Keith Miller.
+
+        This makes build-jsc invoke make instead of directly invoking xcodebuild.
+        There are some benefits here:
+        - 'make' is a more standard way to build than build-jsc, so as we make
+        improvements to the make build (e.g r254234), we'll get the same improvements
+        in build-jsc.
+        
+        - There has been a longstanding bug where if you did if you did
+        `build-jsc --release && cd Source/JavaScriptCore && make release`
+        then the `make release` call would rebuild all of JavaScriptCore.
+        If build-jsc directly invokes make, this issue goes away and allows
+        the two to interoperate as expected.
+
+        * Scripts/build-jsc:
+        (buildMyProject):
+
 2020-01-08  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r254235.
index 6c7360b..d0afccd 100755 (executable)
@@ -201,7 +201,19 @@ sub buildMyProject
     my $result;
     chdir $projectDirectory or die "Can't find $projectName directory to build from";
     if (isAppleCocoaWebKit()) {
-        $result = system "sh", "-c", ('xcodebuild -project ' . $projectName . '.xcodeproj "$@" | grep -v setenv && exit ${PIPESTATUS[0]}'), "xcodebuild",  @options, @ARGV, @additionalSupportOptions;
+        my $compilerFlags = 'GCC_PREPROCESSOR_ADDITIONS="';
+        if ($forceCLoop) {
+            $compilerFlags .= "ENABLE_JIT=0 ENABLE_C_LOOP=1";
+        }
+        $compilerFlags .= '"';
+
+        my $command = "make " . (lc configuration()) . " " . $compilerFlags . " " . join(" ", @ARGV);
+
+        print "\n";
+        print "building ", $projectName, "\n";
+        print "running build command '", $command, "' in ", $projectDirectory, "\n\n";
+
+        $result = system $command;
     } else {
         die "Building not defined for this platform!\n";
     }
@@ -223,6 +235,9 @@ sub writeCongrats()
 buildMyProject("Source/bmalloc", "bmalloc");
 buildMyProject("Source/WTF", "WTF");
 buildMyProject("Source/JavaScriptCore", "JavaScriptCore");
+if (isAppleCocoaWebKit()) {
+    writeCongrats();
+}
 if (isAppleCocoaWebKit() && $cli) {
     buildMyProject("Tools/jsc-cli", "jsc-cli");
 }