RESOLVED FIXED 207012
[build-webkit] Compare with cmakeargs and unhandled to detect configuration change
https://bugs.webkit.org/show_bug.cgi?id=207012
Summary [build-webkit] Compare with cmakeargs and unhandled to detect configuration c...
Basuke Suzuki
Reported 2020-01-30 11:53:04 PST
If --cmakeargs are passed, usually that means CMake Cache should be invalidated and do clean build.
Attachments
PATCH (1.79 KB, patch)
2020-01-30 12:26 PST, Basuke Suzuki
no flags
PATCH (1.49 KB, patch)
2020-10-01 14:56 PDT, Basuke Suzuki
no flags
PATCH (1.49 KB, patch)
2020-10-01 15:24 PDT, Basuke Suzuki
no flags
PATCH (1.38 KB, patch)
2020-10-01 15:30 PDT, Basuke Suzuki
no flags
Basuke Suzuki
Comment 1 2020-01-30 11:53:57 PST
Also command line options can change the configuration such as --no-ninja. Add them also.
Basuke Suzuki
Comment 2 2020-01-30 12:26:35 PST
Stephan Szabo
Comment 3 2020-01-30 14:23:07 PST
Comment on attachment 389275 [details] PATCH View in context: https://bugs.webkit.org/attachment.cgi?id=389275&action=review > Tools/Scripts/build-webkit:309 > + my @buildArgs = (@featureArgs, @cmakeArgs, @ARGV); This seems like it'd be prone to false positives for removal if I'm reading the code correctly. It seems like the check is order dependent, so specifying the same cmake args in different orders seems like it would result in a positive to remove. And something similar with feature args, where if a feature arg was -DFOO=ON, a run with no cmake args and one with a cmake arg setting -DFOO=ON (i.e. the value it already had) seems like it would result in a positive to remove.
Stephan Szabo
Comment 4 2020-01-30 14:32:38 PST
Comment on attachment 389275 [details] PATCH View in context: https://bugs.webkit.org/attachment.cgi?id=389275&action=review >> Tools/Scripts/build-webkit:309 >> + my @buildArgs = (@featureArgs, @cmakeArgs, @ARGV); > > This seems like it'd be prone to false positives for removal if I'm reading the code correctly. > It seems like the check is order dependent, so specifying the same cmake args in different orders seems like it would result in a positive to remove. > And something similar with feature args, where if a feature arg was -DFOO=ON, a run with no cmake args and one with a cmake arg setting -DFOO=ON (i.e. the value it already had) seems like it would result in a positive to remove. I should add that sorting the cmake args (or feature + cmake args) would be insufficient since you could specify -DFOO=ON -DFOO=OFF which is different from "-DFOO=OFF -DFOO=ON" while "-DFOO=ON -DBAR=OFF" seems like it's the same as "-DBAR=OFF -DFOO=ON". Also, thinking about it - mixing ARGV with the cmake/feature args seems like a problem if you can have an item in @ARGV that looked like -DFOO=ON, because you might get false negatives between build-webkit --cmakeargs="-DFOO=ON" and build-webkit -DFOO=ON.
Basuke Suzuki
Comment 5 2020-01-30 15:02:06 PST
(In reply to Stephan Szabo from comment #4) > Comment on attachment 389275 [details] > PATCH > > View in context: > https://bugs.webkit.org/attachment.cgi?id=389275&action=review > > >> Tools/Scripts/build-webkit:309 > >> + my @buildArgs = (@featureArgs, @cmakeArgs, @ARGV); > > > > This seems like it'd be prone to false positives for removal if I'm reading the code correctly. > > It seems like the check is order dependent, so specifying the same cmake args in different orders seems like it would result in a positive to remove. > > And something similar with feature args, where if a feature arg was -DFOO=ON, a run with no cmake args and one with a cmake arg setting -DFOO=ON (i.e. the value it already had) seems like it would result in a positive to remove. > > I should add that sorting the cmake args (or feature + cmake args) would be insufficient since you could specify > -DFOO=ON -DFOO=OFF which is different from "-DFOO=OFF -DFOO=ON" while "-DFOO=ON -DBAR=OFF" seems like it's the same > as "-DBAR=OFF -DFOO=ON". > Also, thinking about it - mixing ARGV with the cmake/feature args seems like a problem if you can have an item in > @ARGV that looked like -DFOO=ON, because you might get false negatives between build-webkit --cmakeargs="-DFOO=ON" > and build-webkit -DFOO=ON. Yes, this patch is far from ideal, but rebuilding caused by false positive is much better than mis-configured build result, don't you think so? But anyway sorting should be added.
Carlos Alberto Lopez Perez
Comment 6 2020-09-30 20:46:19 PDT
Comment on attachment 389275 [details] PATCH View in context: https://bugs.webkit.org/attachment.cgi?id=389275&action=review >>>> Tools/Scripts/build-webkit:309 >>>> + my @buildArgs = (@featureArgs, @cmakeArgs, @ARGV); >>> >>> This seems like it'd be prone to false positives for removal if I'm reading the code correctly. >>> It seems like the check is order dependent, so specifying the same cmake args in different orders seems like it would result in a positive to remove. >>> And something similar with feature args, where if a feature arg was -DFOO=ON, a run with no cmake args and one with a cmake arg setting -DFOO=ON (i.e. the value it already had) seems like it would result in a positive to remove. >> >> I should add that sorting the cmake args (or feature + cmake args) would be insufficient since you could specify -DFOO=ON -DFOO=OFF which is different from "-DFOO=OFF -DFOO=ON" while "-DFOO=ON -DBAR=OFF" seems like it's the same as "-DBAR=OFF -DFOO=ON". >> Also, thinking about it - mixing ARGV with the cmake/feature args seems like a problem if you can have an item in @ARGV that looked like -DFOO=ON, because you might get false negatives between build-webkit --cmakeargs="-DFOO=ON" and build-webkit -DFOO=ON. > > Yes, this patch is far from ideal, but rebuilding caused by false positive is much better than mis-configured build result, don't you think so? > But anyway sorting should be added. I like the idea of the patch, but I'm unsure about adding ARGV. You mention that is for use-cases like "--no-ninja", but that option is removed from ARGV as soon as it checked on the canUseNinja() call above for the case of "if (isCMakeBuild() && !isAnyWindows()) {" I suggest to move the code for cleaning the cmake cache above that check
Basuke Suzuki
Comment 7 2020-10-01 10:33:28 PDT
Comment on attachment 389275 [details] PATCH View in context: https://bugs.webkit.org/attachment.cgi?id=389275&action=review >>>>> Tools/Scripts/build-webkit:309 >>>>> + my @buildArgs = (@featureArgs, @cmakeArgs, @ARGV); >>>> >>>> This seems like it'd be prone to false positives for removal if I'm reading the code correctly. >>>> It seems like the check is order dependent, so specifying the same cmake args in different orders seems like it would result in a positive to remove. >>>> And something similar with feature args, where if a feature arg was -DFOO=ON, a run with no cmake args and one with a cmake arg setting -DFOO=ON (i.e. the value it already had) seems like it would result in a positive to remove. >>> >>> I should add that sorting the cmake args (or feature + cmake args) would be insufficient since you could specify -DFOO=ON -DFOO=OFF which is different from "-DFOO=OFF -DFOO=ON" while "-DFOO=ON -DBAR=OFF" seems like it's the same as "-DBAR=OFF -DFOO=ON". >>> Also, thinking about it - mixing ARGV with the cmake/feature args seems like a problem if you can have an item in @ARGV that looked like -DFOO=ON, because you might get false negatives between build-webkit --cmakeargs="-DFOO=ON" and build-webkit -DFOO=ON. >> >> Yes, this patch is far from ideal, but rebuilding caused by false positive is much better than mis-configured build result, don't you think so? >> But anyway sorting should be added. > > I like the idea of the patch, but I'm unsure about adding ARGV. > > You mention that is for use-cases like "--no-ninja", but that option is removed from ARGV as soon as it checked on the canUseNinja() call above for the case of "if (isCMakeBuild() && !isAnyWindows()) {" > > I suggest to move the code for cleaning the cmake cache above that check Thanks for the comment. I'll rework this with latest code this afternoon.
Basuke Suzuki
Comment 8 2020-10-01 14:56:06 PDT
Basuke Suzuki
Comment 9 2020-10-01 15:24:10 PDT
Basuke Suzuki
Comment 10 2020-10-01 15:30:44 PDT
Basuke Suzuki
Comment 11 2020-10-01 15:33:06 PDT
So to collect all possible configuration change, I chose to copy original argv and treat them as the change. `cmakeargs` is also one of them so that there's no need to treat it as special.
Carlos Alberto Lopez Perez
Comment 12 2020-10-07 11:00:21 PDT
Comment on attachment 410278 [details] PATCH LGTM!
EWS
Comment 13 2020-10-07 11:04:51 PDT
Committed r268134: <https://trac.webkit.org/changeset/268134> All reviewed patches have been landed. Closing bug and clearing flags on attachment 410278 [details].
Radar WebKit Bug Importer
Comment 14 2020-10-07 11:05:22 PDT
Basuke Suzuki
Comment 15 2020-10-07 13:56:11 PDT
(In reply to Carlos Alberto Lopez Perez from comment #12) > Comment on attachment 410278 [details] > PATCH > > LGTM! Thanks!
Note You need to log in before you can comment on or make changes to this bug.