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

Add doctor subcommand #1436

Merged
merged 9 commits into from
Aug 6, 2022
Merged

Add doctor subcommand #1436

merged 9 commits into from
Aug 6, 2022

Conversation

paulcadman
Copy link
Collaborator

@paulcadman paulcadman commented Aug 4, 2022

Adds juvix doctor subcommand to help users diagnose issues with their Juvix development environment.

NB: Also adds a common Log effect.

It currently has the following checks:

$ juvix doctor
> Checking for clang...
> Checking clang version...
> Checking for wasm-ld...
> Checking that clang supports wasm32...
> Checking that clang supports wasm32-wasi...
> Checking that WASI_SYSROOT_PATH is set...
> Checking for wasmer...
> Checking latest Juvix release on Github...

If the doctor finds an issue it prints a message and links to Juvix documentation:

$ juvix doctor
> Checking for clang...
> Checking clang version...
> Checking for wasm-ld...
> Checking that clang supports wasm32...
> Checking that clang supports wasm32-wasi...
> Checking that WASI_SYSROOT_PATH is set...
  ! Environment variable WASI_SYSROOT_PATH is missing
  ! https://docs.juvix.org/tooling/doctor.html#environment-variable-wasi_sysroot_path-is-not-set
> Checking for wasmer...
> Checking latest Juvix release on Github...

To disable the version check, which makes a network call, pass the --offline flag:

$ juvix doctor --offline
> Checking for clang...
> Checking clang version...
> Checking for wasm-ld...
> Checking that clang supports wasm32...
> Checking that clang supports wasm32-wasi...
> Checking that WASI_SYSROOT_PATH is set...
> Checking for wasmer...

This is inspired by doom doctor and brew doctor.

Closes #1216

@paulcadman paulcadman added the CLI label Aug 4, 2022
@paulcadman paulcadman added this to the 0.2.3 milestone Aug 4, 2022
@paulcadman paulcadman self-assigned this Aug 4, 2022
@paulcadman paulcadman linked an issue Aug 4, 2022 that may be closed by this pull request
@paulcadman paulcadman force-pushed the doctor-1216 branch 2 times, most recently from c060a15 to f9dc537 Compare August 5, 2022 16:29
@paulcadman paulcadman marked this pull request as ready for review August 6, 2022 11:11
@paulcadman paulcadman requested a review from jonaprieto August 6, 2022 11:12
@jonaprieto jonaprieto merged commit 4b7fad9 into main Aug 6, 2022
@jonaprieto jonaprieto deleted the doctor-1216 branch August 6, 2022 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add juvix doctor subcommand
2 participants