Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand ${variable} in benchcomp variant env #2981

Closed
karkhaz opened this issue Jan 22, 2024 · 0 comments · Fixed by #3090
Closed

Expand ${variable} in benchcomp variant env #2981

karkhaz opened this issue Jan 22, 2024 · 0 comments · Fixed by #3090
Labels
[C] Feature / Enhancement A new feature request or enhancement to an existing feature.

Comments

@karkhaz
Copy link
Contributor

karkhaz commented Jan 22, 2024

Requested feature: The value of the env key in Benchcomp's config file should expand strings of the form ${variable} to the value of that environment variable.

Use case: Benchcomp variants often require a different value of $PATH for each variant. Currently users set $PATH in the command_line, which obscures the difference between variants. This feature would allow the user to do this:

env:
  PATH: /my/local/directory:${PATH}
  CFLAGS: -O2 ${CFLAGS}

Link to relevant documentation (Rust reference, Nomicon, RFC): N/A

Test case:
Running benchcomp with the below config file should terminate successfully. Note that ${USER} is assumed to be set by the Unix session so should always be available, and the whoami command is also assumed to be available.

variants:
  var_set:
    config:
      command_line: "[ \"${kani_user}\" = \"$(whoami)\" ]"
      env:
        kani_user: "${USER}"
      directory: /tmp
run:
  suites:
    suite_1:
      parser:
        command: >
          echo '{"benchmarks": {}, "metrics": {}}'
      variants: [var_set]

visualize: []
@karkhaz karkhaz added the [C] Feature / Enhancement A new feature request or enhancement to an existing feature. label Jan 22, 2024
karkhaz added a commit to karkhaz/kani that referenced this issue Mar 18, 2024
The values of environment variables in the benchcomp configuration file
can now contain strings of the form '${var}'. Benchcomp will replace
these strings with the value of the environment variable 'var'. This is
intended to allow users to have several benchcomp variants, each of
which differs only in the environment.

This fixes model-checking#2981.
karkhaz added a commit to karkhaz/kani that referenced this issue Mar 18, 2024
The values of environment variables in the benchcomp configuration file
can now contain strings of the form '${var}'. Benchcomp will replace
these strings with the value of the environment variable 'var'. This is
intended to allow users to have several benchcomp variants, each of
which differs only in the environment.

This fixes model-checking#2981.
karkhaz added a commit to karkhaz/kani that referenced this issue Mar 18, 2024
The values of environment variables in the benchcomp configuration file
can now contain strings of the form '${var}'. Benchcomp will replace
these strings with the value of the environment variable 'var'. This is
intended to allow users to have several benchcomp variants, each of
which differs only in the environment.

This fixes model-checking#2981.
karkhaz added a commit to karkhaz/kani that referenced this issue Mar 19, 2024
The values of environment variables in the benchcomp configuration file
can now contain strings of the form '${var}'. Benchcomp will replace
these strings with the value of the environment variable 'var'. This is
intended to allow users to have several benchcomp variants, each of
which differs only in the environment.

This fixes model-checking#2981.
karkhaz added a commit to karkhaz/kani that referenced this issue Mar 19, 2024
The values of environment variables in the benchcomp configuration file
can now contain strings of the form '${var}'. Benchcomp will replace
these strings with the value of the environment variable 'var'. This is
intended to allow users to have several benchcomp variants, each of
which differs only in the environment.

This fixes model-checking#2981.
karkhaz added a commit to karkhaz/kani that referenced this issue Mar 19, 2024
The values of environment variables in the benchcomp configuration file
can now contain strings of the form '${var}'. Benchcomp will replace
these strings with the value of the environment variable 'var'. This is
intended to allow users to have several benchcomp variants, each of
which differs only in the environment.

This fixes model-checking#2981.
tautschnig pushed a commit that referenced this issue Mar 22, 2024
The values of environment variables in the benchcomp configuration file
can now contain strings of the form '${var}'. Benchcomp will replace
these strings with the value of the environment variable 'var'. This is
intended to allow users to have several benchcomp variants, each of
which differs only in the environment.

This fixes #2981.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] Feature / Enhancement A new feature request or enhancement to an existing feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant