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

Problems with bashcov on bash for Windows #87

Open
ale5000-git opened this issue Jul 30, 2024 · 1 comment
Open

Problems with bashcov on bash for Windows #87

ale5000-git opened this issue Jul 30, 2024 · 1 comment

Comments

@ale5000-git
Copy link

ale5000-git commented Jul 30, 2024

I run it like this (bashcov 3.1.2 on Windows 10):

bash
BASHCOV_BASH_PATH='bash' bashcov -- ./my_script.sh

and I get:

bashcov: warning: running as root is NOT recommended, Bashcov may not work properly.
C:/Ruby-x64/lib/ruby/gems/3.0.0/gems/bashcov-3.1.2/lib/bashcov/runner.rb:59:in `spawn': wrong file descriptor (4) (ArgumentError)
        from C:/Ruby-x64/lib/ruby/gems/3.0.0/gems/bashcov-3.1.2/lib/bashcov/runner.rb:59:in `block in run'
        from C:/Ruby-x64/lib/ruby/gems/3.0.0/gems/bashcov-3.1.2/lib/bashcov/runner.rb:118:in `with_xtrace_flag'
        from C:/Ruby-x64/lib/ruby/gems/3.0.0/gems/bashcov-3.1.2/lib/bashcov/runner.rb:58:in `run'
        from C:/Ruby-x64/lib/ruby/gems/3.0.0/gems/bashcov-3.1.2/bin/bashcov:12:in `<top (required)>'
        from C:/Ruby-x64/bin/bashcov:32:in `load'
        from C:/Ruby-x64/bin/bashcov:32:in `<main>'
  1. It isn't root, the detection doesn't work.
  2. If I comment the line 34 options[fd] = fd # bind FDs to the child process, then the script go on (obviously without this line doesn't work correctly).
@infertux
Copy link
Owner

I don't have a Windows machine to debug this but looking at the Ruby documentation, it seems Windows doesn't provide IO.pipe: Not available on all platforms.

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

No branches or pull requests

2 participants