Give a better error message on a silly --tool value
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 13
- Forks
- 21
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 8
Description
This was originally [reported in OpenTitan](https://github.com/lowRISC/opentitan/issues/4689) in 2020.
The basic problem is that dvsim tries too hard to load tool-specific files. For example:
I think it's kind of nice that dvsim doesn't care what tools you have installed, but surely we can spit out a more helpful error message. That file is getting loaded because OpenTitan has this in `common_sim_cfg.hjson`:
```
import_cfgs: ["{proj_root}/hw/data/common_project_cfg.hjson",
"{dv_root}/tools/dvsim/common_modes.hjson",
"{dv_root}/tools/dvsim/fusesoc.hjson",
"{dv_root}/tools/dvsim/bazel.hjson",
"{dv_root}/tools/dvsim/{tool}.hjson"]
```
I wonder whether we should add a magic "test_files" key or similar that would allow the tool die with a message saying "The file path/to/foobar.hjson does not exist. The path was computed from the following wildcards: is one of them wrong?"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the --tool value expands import_cfgs entries such as common_project_cfg.hjson and {tool}.hjson. The work is done when a missing tool-specific file produces a helpful error that identifies the missing path and the wildcard values or otherwise clearly explains the invalid --tool value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100