Stream: git-wasmtime

Topic: wasmtime / PR #1274 Exit with a more severe error code if...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 10 2020 at 19:59):

sunfishcode opened PR #1274 from trap-exit to master:

Previously, the wasmtime CLI would return with a regular failure
error code, eg. 1 on Unix. However, a program trap indicates a bug in
the program, which can be useful to distinguish from a simple error
status. Check for the trap case, and return an appropriate OS-specific
exit status.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 10 2020 at 19:59):

sunfishcode requested alexcrichton, and peterhuene for a review on PR #1274.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 10 2020 at 19:59):

sunfishcode requested alexcrichton, and peterhuene for a review on PR #1274.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 10 2020 at 20:48):

peterhuene submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 10 2020 at 23:15):

fitzgen submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 10 2020 at 23:15):

fitzgen created PR Review Comment:

Rather than hard-coding "check for a trap two error sources above this error in the chain" I think it would make sense to loop over the whole chain and check for if any of them is a trap. Does that make sense?

view this post on Zulip Wasmtime GitHub notifications bot (Mar 10 2020 at 23:16):

fitzgen submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 10 2020 at 23:16):

fitzgen created PR Review Comment:

let mut err = Some(&e);
while let Some(source) = err {
    if source.is::<Trap>() { ... }
    err = source.source();
}

view this post on Zulip Wasmtime GitHub notifications bot (Mar 10 2020 at 23:23):

sunfishcode updated PR #1274 from trap-exit to master:

Previously, the wasmtime CLI would return with a regular failure
error code, eg. 1 on Unix. However, a program trap indicates a bug in
the program, which can be useful to distinguish from a simple error
status. Check for the trap case, and return an appropriate OS-specific
exit status.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 10 2020 at 23:24):

sunfishcode submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 10 2020 at 23:24):

sunfishcode created PR Review Comment:

Makes sense to me! I've now added a patch to do that. I just had to make a slight tweek, since e here is an anyhow::Error, so we have to start with the first source() rather than starting with e.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 10 2020 at 23:32):

fitzgen submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 10 2020 at 23:51):

sunfishcode updated PR #1274 from trap-exit to master:

Previously, the wasmtime CLI would return with a regular failure
error code, eg. 1 on Unix. However, a program trap indicates a bug in
the program, which can be useful to distinguish from a simple error
status. Check for the trap case, and return an appropriate OS-specific
exit status.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2020 at 13:17):

alexcrichton created PR Review Comment:

FWIW when using anyhow I think we can just do e.downcast_ref::<Trap>() and it'll automatically check the entire chain for Trap without having to use chain() explicitly

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2020 at 13:17):

alexcrichton submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2020 at 13:18):

alexcrichton submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2020 at 13:56):

sunfishcode updated PR #1274 from trap-exit to master:

Previously, the wasmtime CLI would return with a regular failure
error code, eg. 1 on Unix. However, a program trap indicates a bug in
the program, which can be useful to distinguish from a simple error
status. Check for the trap case, and return an appropriate OS-specific
exit status.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2020 at 13:57):

sunfishcode submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2020 at 13:57):

sunfishcode created PR Review Comment:

Cool, and we can even simplify it to just .is::<Trap>() here.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2020 at 14:23):

sunfishcode updated PR #1274 from trap-exit to master:

Previously, the wasmtime CLI would return with a regular failure
error code, eg. 1 on Unix. However, a program trap indicates a bug in
the program, which can be useful to distinguish from a simple error
status. Check for the trap case, and return an appropriate OS-specific
exit status.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2020 at 16:51):

sunfishcode updated PR #1274 from trap-exit to master:

Previously, the wasmtime CLI would return with a regular failure
error code, eg. 1 on Unix. However, a program trap indicates a bug in
the program, which can be useful to distinguish from a simple error
status. Check for the trap case, and return an appropriate OS-specific
exit status.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2020 at 17:26):

sunfishcode updated PR #1274 from trap-exit to master:

Previously, the wasmtime CLI would return with a regular failure
error code, eg. 1 on Unix. However, a program trap indicates a bug in
the program, which can be useful to distinguish from a simple error
status. Check for the trap case, and return an appropriate OS-specific
exit status.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2020 at 18:32):

sunfishcode updated PR #1274 from trap-exit to master:

Previously, the wasmtime CLI would return with a regular failure
error code, eg. 1 on Unix. However, a program trap indicates a bug in
the program, which can be useful to distinguish from a simple error
status. Check for the trap case, and return an appropriate OS-specific
exit status.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2020 at 19:12):

sunfishcode updated PR #1274 from trap-exit to master:

Previously, the wasmtime CLI would return with a regular failure
error code, eg. 1 on Unix. However, a program trap indicates a bug in
the program, which can be useful to distinguish from a simple error
status. Check for the trap case, and return an appropriate OS-specific
exit status.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2020 at 20:12):

sunfishcode merged PR #1274.


Last updated: Nov 22 2024 at 17:03 UTC