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

Bash scripts? #180

Open
MSP-Greg opened this issue Jul 5, 2020 · 2 comments
Open

Bash scripts? #180

MSP-Greg opened this issue Jul 5, 2020 · 2 comments

Comments

@MSP-Greg
Copy link
Contributor

MSP-Greg commented Jul 5, 2020

Recently was working on adding the MSYS2 shell to GitHub Actions, allowing CI to run from bash scripts. This isn't common, but there are some repos with their CI tied to bash scripts, so I started testing Ruby builds using it.

Ruby 2.3.3's rake script's shebang line is the following:

#!C:/Users/Justin/Projects/rubyinstaller/sandbox/ruby23_mingw/bin/ruby.exe

Also, Ruby 2.7.1-1 has a rake issue, and ruby-head is missing bundle/bundler scripts, along with other scripts that cause some err output; all bad scripts do not start with a shebang line.

This is kind of a ruby/ruby issue, but adjusting the scripts isn't difficult. Any thoughts?

See:
https://github.com/MSP-Greg/ruby-setup-ruby/runs/839007970

@larskanis
Copy link
Member

This is right, bash is currently not fully supported - only CMD and Powershell are. There have been only a few adjustments for bash. RubyInstaller works to some extend in bash, but has known issues. In particular bash compatibility is not tested at all. And maybe recent ruby versions have worsen the support.

My assumption was, that people using bash will probably use MSYS2 or it's MINGW tools anyway, where bash support is (hopefully) better. So I focused on CMD and Powershell first.

Nevertheless if there is some greater demand in better bash support, I'm open to add it. Most things should be fixable straightforward. The hard issues that come to mind are

  1. MinTTY support of Reline (tty support is not compiled in MINGW build) and
  2. ridk enable and ridk disable (env vars can not be changed by a subprocess)

@MSP-Greg
Copy link
Contributor Author

MSP-Greg commented Jul 5, 2020

I think there's two issues here.

  1. Do the bash scripts located in the bin folder run. That is the main issue I'm concerned with. The script issues are what are showing as failures in the CI run I linked to.

  2. Can irb, byebug, etc be used in a bash terminal. I rarely use either, so I don't know. I did run the reline tests in my Windows Terminal MSYS2 window, and they all passed.

You're probably aware, but I believe that anytime Windows Ruby 'shells out', it uses the cmd shell, regardless of what shell it was started in.

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

No branches or pull requests

2 participants