Open headius opened 3 years ago
On a related question. MRI runs rubyspec in GHA right? Is there some option we can provide to run the job with a pty/tty?
ruby/spec's CI is on GHA (https://github.com/ruby/spec/blob/master/.github/workflows/ci.yml), so it seems the current spec works fine on CRuby on GHA
Is it on ubuntu-latest
?
If id
works better than logname then it sounds fine to only try id
.
In that case, please make a PR and let's see if the CI works with it.
Maybe it's an issue of the JVM/JRuby not inheriting the controlling terminal for subprocesses?
Since the code was using which logname
, maybe for ruby/spec and ruby/ruby that command is not available but for JRuby's GHA setup it's installed and hence it'd only fail there?
The comment above does seem to indicate logname
is preferable.
Running the specs on JRuby on Github Actions, we see the following message and failing spec:
This can occur when
logname
is run without a controlling terminal. I'm unsure whether this GHA env is not setting up a tty, or if there's an issue launching the command in JRuby that prevents it inheriting the parent terminal, but it seems likeid
would be a more reliable command to use:However I think we are also stacking too many conditions here. I'm unsure of the "best" way to get the current login, but clearly
logname
has issues that make it undesirable.FWIW some forums suggest
logname -t
which will ensure a tty is created, but this flag is not present on BSD-likes.