$ run-webkit-tests --help
usage: webkit-flatpak [-h] [--verbose] [--debug] [--release]
[--platform PLATFORM] [--gtk] [--wpe] [-nf] [-u] [-b]
[-ba] [-q] [-t ...] [-c ...] [-y] [--avalaible]
[--gdb [GDB]] [-m COREDUMPCTL_MATCHES]
[--makeargs MAKEARGS] [--cmakeargs CMAKEARGS] [--clean]
-h, --help show this help message and exit
--verbose Show debug message
--debug Compile with Debug configuration, also installs Sdk
--release Compile with Release configuration.
--platform PLATFORM Platform to use (e.g., "mac-lion")
--gtk Alias for --platform=gtk
--wpe Alias for --platform=wpe
Do not update flaptak runtime/sdk
-u, --update Update the runtime/sdk/app and rebuild the development
environment if needed
-b, --build-webkit Force rebuilding the app.
-ba, --build-all Force rebuilding the app and its dependencies.
-q, --quiet Do not print anything
-t ..., --tests ... Run LayoutTests
-c ..., --command ...
The command to run in the sandbox
-y, --assumeyes Automatically answer yes for all questions.
--avalaible Check if required dependencies are avalaible.
--clean Clean previous builds and restart from scratch
--gdb [GDB] Activate gdb, passing extra args to it if wanted.
-m COREDUMPCTL_MATCHES, --coredumpctl-matches COREDUMPCTL_MATCHES
Arguments to pass to gdb.
Extra build arguments:
--makeargs MAKEARGS Optional Makefile flags
One or more optional CMake flags (e.g.
Expected behavior: I see the help for run-webkit-tests :)
Actual behavior: I see the help for webkit-flatpak :(
This kind of bug usually occurs when someone passes user-provided arguments to a wrapper without a "--" prefix.
flatpak_runner = WebkitFlatpak.load_from_args(args)
[...] # creates a webkit-flatpak's ArgumentParser
_, self.args = parser.parse_known_args(args=args, namespace=self)
What is `args` in run_in_sandbox_if_available() supposed to be? On the first invocation I would assume it is the command to be executed, but it's (also?) being parsed as the flags to webkit-flatpak. That's strange to say the least.
It seems like the code is trying to mix flatpak flags with the flags for the wrapped executable (we could call it the «flatpakee»?). This was probably intended to make it easy to set flags for both, but it's quite dangerous and as we are seeing now, can't cope with conflicts.
I think run-webkit-tests is doing too much, acting as both the wrapper and the wrapped, and that makes it confusing and creates these conflicts.
Created attachment 350189 [details]
Comment on attachment 350189 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=350189&action=review
> + 2. exists the app - The solution is to just make sure that `--help` is not used when using
Created attachment 350204 [details]
Patch for landing
Comment on attachment 350204 [details]
Patch for landing
Clearing flags on attachment: 350204
Committed r236261: <https://trac.webkit.org/changeset/236261>
All reviewed patches have been landed. Closing bug.