Skip to content

[K-Bug] Missing file argument in kompile's flag #3619

@Robertorosmaninho

Description

@Robertorosmaninho

What component is the issue in?

Front-End

Which command

  • kompile
  • kast
  • krun
  • kprove
  • kprovex
  • ksearch

What K Version?

v6.0.83-0-gc2ad66e022

Operating System

MacOS (Apple Silicon/AMD)

Steps to Reproduce

When I tried to use --profile-rule-parsing as it's defined on our hidden-help flag

$ kompile -hh
...
 --profile-rule-parsing
      Generate time in milliseconds to parse each rule in the semantics.

I got the following confusing error message:

$ kompile -v --profile-rule-parsing test.k --main-module TEST

Parse command line options                                   =  0,014s
[Error] Critical: You have to provide exactly one main file in order to do
outer parsing.

After talking with @radumereuta at #3611 (comment) I saw the this flag actually expects a new file to write the time taken to parse each rule.

Expected Results

I would expect 3 things here:

  • Check if any other flag expects a file or other type of input that isn’t currently described on -hh or -h.
  • Modify the help message to be --profile-rule-parsing <file> and probably contain a more helpful description like Store in this file time taken in ms to parse each rule in the semantics as suggested by @radumereuta.
  • If possible, modify the error message to be different when a flag doesn’t receive input.

The last is optional, but it’s something to consider. Currently kompile works as Usage: kompile [options] <file>, in this case, the --profile-rule-parsing consumed the K file instead of kompile. This could be avoided if we swap the order to kompile <file> [options], and then it will be easier to identify when we don’t pass input to kompile and when we don’t pass input for a kompile’s flag. Although, I admit that’s counterintuitive considering other compiler’s CLI design.

PS.: Also from @radumereuta:
"The output for the help command is handled automatically by thejcommnader library here: https://github.com/runtimeverification/k/blob/master/kernel/src/main/java/org/kframework/kompile/KompileUsageFormatter.java"

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions