Title: [268870] trunk/Tools
Revision
268870
Author
[email protected]
Date
2020-10-22 10:31:05 -0700 (Thu, 22 Oct 2020)

Log Message

Detect unrecognized options in build-jsc
https://bugs.webkit.org/show_bug.cgi?id=218077

Patch by Angelos Oikonomopoulos <[email protected]> on 2020-10-22
Reviewed by Yusuke Suzuki.

Currently, Getopt::Long is configured with pass_through, in order to
be able to forward arbitrary arguments in buildMyProject. However, that
means that typos in option names (e.g. using --cmake-args instead of
--cmakeargs) go undetected and the option is silently ignored.

For cmake builds, there is no such forwarding, so check that there are
no remaining arguments in ARGV and refuse to continue if so. This runs
the risk of breaking wrapper scripts that incorrectly pass unrecognized
options, but that seems like a good thing.

* Scripts/build-jsc:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (268869 => 268870)


--- trunk/Tools/ChangeLog	2020-10-22 16:47:20 UTC (rev 268869)
+++ trunk/Tools/ChangeLog	2020-10-22 17:31:05 UTC (rev 268870)
@@ -1,3 +1,22 @@
+2020-10-22  Angelos Oikonomopoulos  <[email protected]>
+
+        Detect unrecognized options in build-jsc
+        https://bugs.webkit.org/show_bug.cgi?id=218077
+
+        Reviewed by Yusuke Suzuki.
+
+        Currently, Getopt::Long is configured with pass_through, in order to
+        be able to forward arbitrary arguments in buildMyProject. However, that
+        means that typos in option names (e.g. using --cmake-args instead of
+        --cmakeargs) go undetected and the option is silently ignored.
+ 
+        For cmake builds, there is no such forwarding, so check that there are
+        no remaining arguments in ARGV and refuse to continue if so. This runs
+        the risk of breaking wrapper scripts that incorrectly pass unrecognized
+        options, but that seems like a good thing.
+
+        * Scripts/build-jsc:
+
 2020-10-22  Peng Liu  <[email protected]>
 
         Let webkitDisplayingFullscreen() return true when a video element’s fullscreen mode is not VideoFullscreenModeNone

Modified: trunk/Tools/Scripts/build-jsc (268869 => 268870)


--- trunk/Tools/Scripts/build-jsc	2020-10-22 16:47:20 UTC (rev 268869)
+++ trunk/Tools/Scripts/build-jsc	2020-10-22 17:31:05 UTC (rev 268870)
@@ -155,6 +155,17 @@
 }
 
 if (isCMakeBuild()) {
+    if (scalar(@ARGV) > 0) {
+        foreach (@ARGV) {
+            my $arg = $_;
+            if ($arg =~ /^-.*/) {
+                print STDERR "Unrecognized option `$arg'\n";
+            } else {
+                print STDERR "Stray anonymous argument `$arg'\n";
+            }
+        }
+        exit 2;
+    }
     if ($forceCLoop) {
         push @cmakeArgs, " -DENABLE_JIT=OFF";
         push @cmakeArgs, " -DENABLE_C_LOOP=ON";
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to