⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 268870 in webkit


Ignore:
Timestamp:
Oct 22, 2020, 10:31:05 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Angelos Oikonomopoulos <Angelos Oikonomopoulos> 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:
Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r268865 r268870  
     12020-10-22  Angelos Oikonomopoulos  <angelos@igalia.com>
     2
     3        Detect unrecognized options in build-jsc
     4        https://bugs.webkit.org/show_bug.cgi?id=218077
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        Currently, Getopt::Long is configured with pass_through, in order to
     9        be able to forward arbitrary arguments in buildMyProject. However, that
     10        means that typos in option names (e.g. using --cmake-args instead of
     11        --cmakeargs) go undetected and the option is silently ignored.
     12 
     13        For cmake builds, there is no such forwarding, so check that there are
     14        no remaining arguments in ARGV and refuse to continue if so. This runs
     15        the risk of breaking wrapper scripts that incorrectly pass unrecognized
     16        options, but that seems like a good thing.
     17
     18        * Scripts/build-jsc:
     19
    1202020-10-22  Peng Liu  <peng.liu6@apple.com>
    221
  • trunk/Tools/Scripts/build-jsc

    r268200 r268870  
    156156
    157157if (isCMakeBuild()) {
     158    if (scalar(@ARGV) > 0) {
     159        foreach (@ARGV) {
     160            my $arg = $_;
     161            if ($arg =~ /^-.*/) {
     162                print STDERR "Unrecognized option `$arg'\n";
     163            } else {
     164                print STDERR "Stray anonymous argument `$arg'\n";
     165            }
     166        }
     167        exit 2;
     168    }
    158169    if ($forceCLoop) {
    159170        push @cmakeArgs, " -DENABLE_JIT=OFF";
Note: See TracChangeset for help on using the changeset viewer.