Coder Social home page Coder Social logo

Command "brew update" shows "/dev/stdin: No such file or directory - /tmp/sh-thd-2853475760 (deleted) (Errno::ENOENT)" about brew HOT 8 OPEN

azhongzl avatar azhongzl commented on May 23, 2024
Command "brew update" shows "/dev/stdin: No such file or directory - /tmp/sh-thd-2853475760 (deleted) (Errno::ENOENT)"

from brew.

Comments (8)

MikeMcQuaid avatar MikeMcQuaid commented on May 23, 2024

How are you running this? SSH?

from brew.

azhongzl avatar azhongzl commented on May 23, 2024

Steps to reproduce:

  1. launch iTerm2 on Mac
  2. ssh to the remote host
  3. run command brew update

Same happens if I

  1. launch dcv-viewer and connect to the remote host
  2. launch a terminal
  3. run command brew update

It worked before but just failed recently

from brew.

MikeMcQuaid avatar MikeMcQuaid commented on May 23, 2024

@azhongzl Can you reproduce on any other hosts or Linux machines? How long has this been happening? What user are you running as?

from brew.

azhongzl avatar azhongzl commented on May 23, 2024

How long has this been happening?

It worked before but just started to fail yesterday

What user are you running as?

I run with my own user but should have every permissions.

from brew.

Bo98 avatar Bo98 commented on May 23, 2024

Sounds like something weird is happening with the way your system interacts with herestrings.

I'm guessing changing

if [[ -x "${ruby}" ]] && "${ruby}" /dev/stdin <<<"exit(RUBY_VERSION >= '1.8.7')"
then
"${ruby}" /dev/stdin <<<"File.new(${lock_fd}).flock(File::LOCK_EX | File::LOCK_NB) || exit(1)"

to be (echo "exit(RUBY_VERSION >= '1.8.7')" | "${ruby}" /dev/stdin) might fix things? And similarly on the line below.

from brew.

azhongzl avatar azhongzl commented on May 23, 2024

Thanks @Bo98. So the issue is caused by using an old version of ruby.

/usr/bin/ruby is hardcoded in above code.

local ruby="/usr/bin/ruby"

In my env, /usr/bin/ruby is old

/usr/bin/ruby -v
ruby 2.0.0p648 (2015-12-16) [x86_64-linux]

The one on the path is latest

ruby -v
ruby 2.7.8p225 (2023-03-30 revision 1f4d455848) [x86_64-linux]

Run with old ruby, there are errors:

/usr/bin/ruby /dev/stdin <<< "exit(RUBY_VERSION >= '1.8.7')"
/dev/stdin: No such file or directory - /tmp/zshFl0HSh (deleted) (Errno::ENOENT)

Run with latest ruby, no issues:

ruby /dev/stdin <<< "exit(RUBY_VERSION >= '1.8.7')"

Can brew code use the default ruby on path instead of hardcoding?

from brew.

Bo98 avatar Bo98 commented on May 23, 2024

Maybe, though ideally we'd fix 2.0 otherwise we would need to bump the 1.8.7 requirement (though the requirement check itself is broken which is not good).

There's perhaps also an argument of hoisting the flock condition to the top:

elif [[ -x "$(type -P flock)" ]]
then
flock -n "${lock_fd}"

from brew.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.