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

Silently Breaks without Bash #43

Open
jpulec opened this issue Apr 11, 2023 · 5 comments
Open

Silently Breaks without Bash #43

jpulec opened this issue Apr 11, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@jpulec
Copy link

jpulec commented Apr 11, 2023

It seems that trying to use spawn with a parameter (i.e. spawn`yarn build --filter=${workspace}`) breaks if bash is not present. This is because zx doesn't set a default quote function when it cannot find bash. Normally, this would throw an error, however, since we're wrapping $() with .nothrow() in createSpawn() this issue is silent and makes it appear that our onChange() handler is hanging forever.

Expected Behavior

Try to support shells besides bash, or at least document this.

Current Behavior

The spawn command just appears to hang.

Steps to Reproduce

Run spawn inside onChange() with a parameter, using an environment that doesn't have bash, i.e. Alpine linux.

@jpulec jpulec added the bug Something isn't working label Apr 11, 2023
@gajus
Copy link
Owner

gajus commented Apr 11, 2023

@jpulec Will improve error handling for this.

Just my awareness, in what scenario would bash be not available?

@jpulec
Copy link
Author

jpulec commented Apr 11, 2023

The most likely case is when using a minimal distro like Alpine Linux, which uses BusyBox as its default shell, and doesn't include bash. It's fairly common for people to use Alpine when building docker images for their applications to keep the app size down.

@gajus
Copy link
Owner

gajus commented Apr 11, 2023

That makes sense, though why would you attempt run turbowatch inside a busybox container?

@jpulec
Copy link
Author

jpulec commented Apr 11, 2023

We do all of our development in containers, and in an effort to keep them similar to our production containers, use the same Alpine base image instead of using a different base image for development.

@gajus
Copy link
Owner

gajus commented Apr 11, 2023

Useful context. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants