You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--- a/stuff.txt
+++ b/stuff.txt
@@ -1,7 +1,7 @@
Hello
there
general
-Kenobi
+Homie
how
art
thou
Create stuff.txt and put this in it
Hello
there
general
Kenobi
how
art
thou
Control Scenario - Bun patch works, and direct patch works
Run patch -p1' --no-backup-if-mismatch -d '.' < './fix.patch. This is the normal gpatch behavior
As a result you should see a success message and stuff.txt should have “Homie” instead of “Kenobi”, meaning the patch worked
undo the patch in stuff.txt so it says Kenobi again.
Run bun run index.ts
You should see another success and stuff.txt is again changed to “Homie”.
Undo the patch again
Problem scenario - direct patch works, Bun command fails.
Make sure stuff.txt is in the original state, with Kenobi
Create an inner folder (I called mine src) and move stuff.txt into that folder.
Change fix.patch to point to the correct paths, aka:
--- a/src/stuff.txt
+++ b/src/stuff.txt
@@ -1,7 +1,7 @@
Hello
there
general
-Kenobi
+Homie
how
art
thou
From the original directory (aka not src), run the patch command again, i.e.: patch -p1' --no-backup-if-mismatch -d '.' < './fix.patch
Confirm that this succeeded and still changed the values in stuff.txt from Kenobi to Homie, and then reset it back to Kenobi
Run bun run index.ts again. You should see a failure with: /opt/homebrew/bin/patch: **** out of memory
What is the expected behavior?
Bun execution of gpatch should succeed in both cases, not produce an out of memory error.
What do you see instead?
/opt/homebrew/bin/patch: **** out of memory
Additional information
I understand this is a niche interaction of a particular shell command executed within Bun. But given the exact same scenario works with the direct command, I feel this could be a problem within Bun. I also wonder if the same bug causing this could be breaking other command executions
The text was updated successfully, but these errors were encountered:
What version of Bun is running?
1.1.36
What platform is your computer?
Darwin 23.6.0 arm64 arm
What steps can reproduce the bug?
Setup Steps
brew install gpatch
) - version 2.7.6. (Can checkpatch --version
to confirm)bun init
index.ts
with this:Control Scenario - Bun patch works, and direct patch works
-p1' --no-backup-if-mismatch -d '.' < './fix.patch
. This is the normal gpatch behaviorbun run index.ts
Problem scenario - direct patch works, Bun command fails.
-p1' --no-backup-if-mismatch -d '.' < './fix.patch
bun run index.ts
again. You should see a failure with:/opt/homebrew/bin/patch: **** out of memory
What is the expected behavior?
Bun execution of gpatch should succeed in both cases, not produce an
out of memory
error.What do you see instead?
/opt/homebrew/bin/patch: **** out of memory
Additional information
I understand this is a niche interaction of a particular shell command executed within Bun. But given the exact same scenario works with the direct command, I feel this could be a problem within Bun. I also wonder if the same bug causing this could be breaking other command executions
The text was updated successfully, but these errors were encountered: