microsoft / microsoft/typespec
Emitter hook to validate system dependencies
- Dominant language
- Java
- Stars
- 5.9k
- Forks
- 394
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 104
Description
Emitters may require additional system dependencies not managed by NPM, for example runtimes and build tools for non-JS languages. Today, when such dependencies are missing, the exception bubbles up and reports the "This is a bug" error verbiage.
I believe an emitter hook that we can run prior to compiling that validates that the environment can execute the emitters would be a huge help. It should encourage checking the environment and giving useful errors to users with advice on how to proceed. For example you could imagine the following on a debian-like linux machine:
```
✓ Validating @typespec/java-rest-client requirements
× Validating @typespec/python-rest-client requirements
[ERROR] Python is not in your path. Run apt install python3 python3-pip.
```
We would also probably want a --skip-emitter-validation to optimize inner loop build times.
Contributor guide
Assessment
This issue has not been assessed yet.