mix_test_interactive icon indicating copy to clipboard operation
mix_test_interactive copied to clipboard

Support for ash

Open anthonator opened this issue 4 years ago • 3 comments

I was wondering if there is any interest in supporting ash in addition to the current support for bash. I imagine a lot of people in the community use Alpine images and adding another shell might not be the most appealing option.

I'd be happy to work on this if you'd accept a PR.

anthonator avatar Nov 18 '21 17:11 anthonator

As near as I can tell, the only bash-ism in the project is the zombie_killer script. Is that what you're referring to?

Everything below is based on the assumption that you're referring to that script.

I'm definitely open to a change that makes it work for more people, but some things to be aware of:

  • The script is taken directly from the Elixir Port documentation.
  • The script there was originally written for /bin/sh, but was changed to bash due to an incompatibility on some OSes (ones that use dash instead of sh). See the PR that made this change.

Given the above, the best approach might be to come up with a more portable version of the script and submit that upstream to the Elixir repo. Once accepted there, we can update our version of the script here.

I won't have a good way to test an updated script on a variety of OSes/shells, so I'd want some confidence that any changes aren't going to break things for people running in other environments.

randycoulman avatar Nov 18 '21 18:11 randycoulman

Would you be open to a possible ENV var or other configuration setting that would make that configurable? We use a docker image that doesn't have bash installed by default (since it is an alpine based image).

I could see something like:

zombie_killer.sh
zombie_killer.bash

with an optional ENV var of MIX_TEST_INTERACTIVE_SHELL to switch between the two (obviously defaulting to the current bash implementation).

In an ideal world, I'd prefer to just have the one script, but like you said, trying to come up with a portable and well-tested script on a variety of OSes/shells is a difficult task.

jacobsmith avatar Nov 18 '21 19:11 jacobsmith

@jacobsmith I think that'd be OK as long as it doesn't turn into a massive number of different versions of the script.

Probably an env var is the best approach here rather than using app config, because I could imagine different people on the same project using different shells. An env var makes it relatively easy for each of them to use the appropriate script for their own system.

randycoulman avatar Nov 19 '21 01:11 randycoulman

I'm going to close this issue as stale. If you're still thinking you might work on this, feel free to re-open when you have a PR ready to go.

randycoulman avatar Sep 17 '24 03:09 randycoulman

Oof! My apologies! I guess this got lost in the shuffle. I don't think I'll have time to pick this back up but will open a PR if I do.

anthonator avatar Sep 17 '24 14:09 anthonator