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

tauri.js CLI: Errors from the Rust CLI don't propagate up to the JS CLI #231

Closed
rajivshah3 opened this issue Dec 26, 2019 · 2 comments · Fixed by #233
Closed

tauri.js CLI: Errors from the Rust CLI don't propagate up to the JS CLI #231

rajivshah3 opened this issue Dec 26, 2019 · 2 comments · Fixed by #233

Comments

@rajivshah3
Copy link
Member

Describe the bug
It seems like errors reported by the Rust CLI do not propagate to the JS CLI. In other words, the Rust CLI exits with a non-zero exit code, yet the JS CLI does not. Since the JS CLI returns an exit code of 0, the command is considered to have passed. This poses a problem for our own smoke tests in particular -- in the event that this occurs, GitHub Actions will mark the step as "passed" even though it actually should fail.

Examples where this has occurred:
https://github.com/tauri-apps/tauri/pull/187/checks?check_run_id=357905199#step:11:112
https://github.com/tauri-apps/tauri/pull/214/checks?check_run_id=363576771#step:14:130

To Reproduce
Steps to reproduce the behavior:

  1. Run a command from the JS CLI (e.g. yarn tauri build) which causes an error to be thrown from the Rust CLI

Expected behavior
Non-zero error codes from the Rust CLI should result in a non-zero error code from the JS CLI

Platform (please complete the following information):
This doesn't appear to be a platform-specific issue

@rajivshah3
Copy link
Member Author

Ah looks like this was previously reported in #202 . I'm investigating right now to see what's causing the issue

@tensor-programming
Copy link
Member

tensor-programming commented Dec 26, 2019

I already know what the problem is. When an error is reported from Rust it gets obscured by the Node runtime. If you go into the bundler and try to use println! to print a message you'll notice that it won't make it through the I/O. Best way to get around this is with the stdout/stderr pipe and some of the functions from the common.rs module. I'll look tomorrow, its really just a matter of adding a piece of code to invoke the error logger when an error propagates and maybe even directly throwing out an exit code. (which I see you've done in the PR haha)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants