Enable setting definition and includes with environment variables

Open
#3,402 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
build-system, cli

Research direction

Start at the kbuild run and kprove command entry points and trace how --definition and -I are currently supplied. Check how K_DEFINITION and K_INCLUDES should be read, then verify that explicitly passed flags take precedence and that the kbuild run example works with the target-derived environment.

Written by the indexing model from the issue text.

Description

E.g. K_DEFINITION and K_INCLUDES. A flag explicitly passed to the command should have a higher priority than the corresponding environment variable.

Rationale

For a given kompile target, kbuild manages the output directory (by default) and the list of includes the target should be kompiled against. Letting K tools (e.g. kprove) consume --definition and -I from an environment variable enables their combination with kbuild, without having to implement a custom runner script (e.g. kbuild prove) for each tool.

E.g. instead of

$ kprove --definition path/to/haskell/target -I list -I of -I includes ...

one could

$ kbuild run haskell kprove ...

where haskell is a kbuild target. In this example, kbuild run executes kprove in an environment where K_DEFINITION=path/to/haskell/target and K_INCLUDES=list,of,includes, based on the target.

A natural use case for this is proving against existing definitions: the proof project marks the definition project as a dependency, then kbuild takes care of setting up the environment:

$ kbuild run evm-semantics.haskell kprove my-spec.k
Dominant language
Python
Stars
591
Forks
163
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from runtimeverification/k

All issues in runtimeverification/k

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.