Skip to content

Correct handling of nested --helps between IREE flags and other libraries. #5628

Closed

Description

@benvanik

In most tools - including IREE after #5602 - --help will exit after printing by design. This unfortunately makes it hard to interop multiple flag systems as whichever one goes first will exit before the other can print its flags.

This currently impacts anything using benchmark as well as iree-run-mlir (though I'm ok with that one being a bit busted). The current intent with exposing iree/testing/benchmark.h as a C header is that we switch to using that in our code and then implement IREE-flag-based parsing such that we don't use benchmark's version at all. This would give us consistent flags across multiple benchmarking backends for when we use non-benchmark ones (bare metal/webassembly/iot/etc) and avoid the issue entirely.

We could also add an iree_flags_parse_mode_t to not exit on --help. This does get a bit tricky as --help is a callback and without using global state we'd need to change that behavior. We could also move the exit(0) to the parser such that --help is special.

Activity

  1. added
    runtime
    ew 🤮
    on Apr 26, 2021
  2. self-assigned this
    on Apr 26, 2021
  3. added 2 commits that reference this issue on Apr 26, 2021
    fa99caf
    1cb2f7a
  4. added a commit that references this issue on Apr 29, 2021
    35c7125
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ew 🤮runtime

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions