microsoft / microsoft/typespec

Emitter hook to validate system dependencies

Open
#2,974 0 comments 0 reactions 0 assignees View on GitHub
design:needed triaged:core
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.