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

Fix a bug where stdout was copying stderr #3

Merged
merged 3 commits into from
Nov 6, 2023

Conversation

schneems
Copy link
Owner

@schneems schneems commented Nov 6, 2023

In the migration of the Ruby buildpack to use this crate I noticed a regression:

  - Running `bash -c "ps aux | grep cargo"`

            rschneeman       26398   0.0  0.0 408417520   9600 s004  S+   11:24AM   0:00.13 /Users/rschneeman/.cargo/bin/cargo-watch watch -c -x ltest
      rschneeman       17561   0.0  0.0 408494848    848 s000  R+    2:39PM   0:00.00 grep cargo
      rschneeman       17559   0.0  0.0 408627920   3088 s000  S+    2:39PM   0:00.00 bash -c ps aux | grep cargo
      rschneeman       15128   0.0  0.0 408433904  10176 s006  S+    2:35PM   0:00.40 /Users/rschneeman/.cargo/bin/cargo-watch watch -c -x ltest

  - Done (< 0.1s)

I isolated it to the fun_run PR heroku/buildpacks-ruby#232 and after some debugging found it was due to accidentally copying child.stdout for child_stderr. I added a test that verifies that stderr is redirected correctly.

Richard Schneeman added 3 commits November 6, 2023 15:27
In the migration of the Ruby buildpack to use this crate I noticed a regression:

```
  - Running `bash -c "ps aux | grep cargo"`

            rschneeman       26398   0.0  0.0 408417520   9600 s004  S+   11:24AM   0:00.13 /Users/rschneeman/.cargo/bin/cargo-watch watch -c -x ltest
      rschneeman       17561   0.0  0.0 408494848    848 s000  R+    2:39PM   0:00.00 grep cargo
      rschneeman       17559   0.0  0.0 408627920   3088 s000  S+    2:39PM   0:00.00 bash -c ps aux | grep cargo
      rschneeman       15128   0.0  0.0 408433904  10176 s006  S+    2:35PM   0:00.40 /Users/rschneeman/.cargo/bin/cargo-watch watch -c -x ltest

  - Done (< 0.1s)
```

I isolated it to the `fun_run` PR heroku/buildpacks-ruby#232 and after some debugging found it was due to accidentally copying `child.stdout` for `child_stderr`. I added a test that verifies that stderr is redirected correctly.
@schneems schneems merged commit 03b258c into main Nov 6, 2023
2 checks passed
@schneems schneems deleted the schneems/double-indent-bug branch November 6, 2023 21:32
schneems pushed a commit to heroku/buildpacks-ruby that referenced this pull request Nov 6, 2023
Fixes double indenting the first line of streamed commands schneems/fun_run#3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant