janet-lang / jpm

Janet Project Manager
MIT License
68 stars 22 forks source link

Print err when dagbuild fails #40

Closed pepe closed 2 years ago

pepe commented 2 years ago

Dag build was swallowing build errors. This PR prints the error before shortcutting. I also reformated the docstring for pmap.

sogaiu commented 2 years ago

Not swallowing the error sounds better.

I tested it with a checkout of a forked neil I had and found that with the PR I got more useful output:

$ jpm build
generating executable c source build/neilcomm.c from neil/comm.janet...
Failed.
error: could not find module neil/tell:
    /home/user/.local/lib/janet/neil/tell.jimage
    /home/user/.local/lib/janet/neil/tell.janet
    /home/user/.local/lib/janet/neil/tell/init.janet
    /home/user/.local/lib/janet/neil/tell.so

compared to when running without the changes:

$ jpm build
generating executable c source build/neilcomm.c from neil/comm.janet...
harryvederci commented 2 years ago

This is very helpful!

One remark: It doesn't seem to result in a non-0 exit code on failure. (Not sure if that's something that can/should be fixed in this PR or somewhere else.)

pepe commented 2 years ago

@harryvederci true, yet I would leave it for another PR, as I am not sure it can be solved on this place. /ping @bakpakin