unisonweb / unison

A friendly programming language from the future
https://unison-lang.org
Other
5.75k stars 269 forks source link

improve error message for run.native tests.jit.only #4911

Open kylegoetz opened 5 months ago

kylegoetz commented 5 months ago

The command right now (for my work implementing UDP for the JIT) currently spits out the following when testing

```ucm
    runtime-tests/selected> run.native testsruntime-tests/selected> run.native tests.jit.only
🛑

The transcript failed due to an error in the stanza above. The error is:

  native evaluation failed

Run unison --codebase /Users/kylegoetz/.cache/unisonlanguage/runtime-tests.unison to do more work with it.



Not a terribly useful error.
kylegoetz commented 5 months ago

Though I'm not sure how it could be improved upon easily. The code that generates the error is

ExitSuccess ->
            decodeResult . deserializeNativeResponse
              =<< UnliftIO.takeMVar mv
          ExitFailure _ -> do
            UnliftIO.killThread tid
            pure . Left $ "native evaluation failed"

and ExitFailure wraps an INT only.