Closed claui closed 4 years ago
The actual output is printed a little bit above, though I don't know where the number in the error is coming from.
though I don't know where the number in the error is coming from.
@Bo98 I think I can explain that part.
In patch.rb
, we return the output of Ruby’s IO#write
, which according to the API documentation, is the number of bytes written.
Where I’m actually stuck is in deciding whether it’s a bug in patch.rb
or rather in Homebrew’s Utils::popen
. The latter simply returns the result of the block to which it yields.
Oh I was looking ExternalPatch
by mistake. That makes sense.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
After leaving this sitting for a while, I’m now pretty sure that patch.rb
just fails to observe the contracts of both Utils::popen
and IO#write
.
What the block should actually do is capture and return the process’s standard output.
Edit: see below.
Changed my mind. Coordinating reads and writes from/to a child process, maybe even interleaved with each other, isn’t something you can do in a single line.
It would be unreasonable to demand from the caller of safe_popen_write
to do that. The caller should only concern themselves with writing to stdin, while safe_popen_write
should transparently capture stdout, ignoring the block return value.
PR incoming.
Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.
brew update
and can still reproduce the problem?brew doctor
, fixed all issues and can still reproduce the problem? Error seems unrelated, and I have no idea how to fix this anyway.brew config
andbrew doctor
and included their output with your issue?What you were trying to do (and why)
I was trying to version bump a formula whose inline (
:DATA
) patch would no longer apply to the newer version.What happened (include command output)
An error message is printed along with the length of the output.
(To make the case reproducible with minimal effort, I’m using the
rp
formula in the following output.)Command output
What you expected to happen
An error message is printed along with the actual output of the failed command.
Step-by-step reproduction instructions (by running
brew
commands)brew edit rp
.BeaEngine
toBeerEngine
.(Note that neither
-i
nor--ignore-dependencies
are needed for the error to occur, it’s just to make reproduction easier.)Output of
brew config
andbrew doctor
commands