Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit e0cd719

Browse files
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: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@268870 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 4bd41f5 commit e0cd719

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

Tools/ChangeLog

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
2020-10-22 Angelos Oikonomopoulos <[email protected]>
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+
120
2020-10-22 Peng Liu <[email protected]>
221

322
Let webkitDisplayingFullscreen() return true when a video element’s fullscreen mode is not VideoFullscreenModeNone

Tools/Scripts/build-jsc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,17 @@ if ($forceCLoop) {
155155
}
156156

157157
if (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";
160171
push @cmakeArgs, " -DENABLE_C_LOOP=ON";

0 commit comments

Comments
 (0)