You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When passing an invalid C compiler via the -cc flag, the CLI evaluates the command/file arguments before validating if the requested C compiler actually exists. This leads to confusing error messages where the CLI complains about missing or invalid commands instead of the missing C compiler.
Reproduction Steps
No command provided
$ v -cc foo
Invalid command provided
$ v -cc foo bar
Valid command provided (only now does it check -cc)
$ v -cc foo -e
Expected Behavior
When running v -cc foo, the compiler should validate the -cc argument early and immediately output:
builder error: C compiler 'foo' was requested with '-cc', but was not found.
Current Behavior
1. No command provided
$ v -cc foo
v: unknown command``
Run v helpfor usage.
2. Invalid command provided
$ v -cc foo bar
v: unknown command`bar`.
Did you mean `share`?
Run v helpfor usage.
3. Valid command provided (only now does it check -cc)
$ v -cc foo -e
builder error: C compiler `foo` was requested with `-cc`, but was not found
Possible Solution
The validation for the -cc flag should be moved earlier in the execution pipeline, likely during the initial flag parsing. By checking if the requested C compiler exists immediately after the flag is consumed, the CLI can throw the correct builder error before the command router ever attempts to evaluate the remaining (or empty) arguments.
Describe the bug
When passing an invalid C compiler via the -cc flag, the CLI evaluates the command/file arguments before validating if the requested C compiler actually exists. This leads to confusing error messages where the CLI complains about missing or invalid commands instead of the missing C compiler.
Reproduction Steps
No command provided
Invalid command provided
Valid command provided (only now does it check -cc)
Expected Behavior
When running
v -cc foo, the compiler should validate the-ccargument early and immediately output:Current Behavior
1. No command provided
2. Invalid command provided
3. Valid command provided (only now does it check -cc)
Possible Solution
The validation for the
-ccflag should be moved earlier in the execution pipeline, likely during the initial flag parsing. By checking if the requested C compiler exists immediately after the flag is consumed, the CLI can throw the correct builder error before the command router ever attempts to evaluate the remaining (or empty) arguments.Additional Information/Context
No response
V version
V 0.5.2
Environment details (OS name and version, etc.)
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.