Skip to content

Commit

Permalink
Do not stream bundle exec rake -P output
Browse files Browse the repository at this point in the history
This output is meant to be machine readable only, it should be timed and not streamed.

I.e. we want the output to be

```
- Rake assets install
  - Rake detected (`rake` gem found, `Rakefile` found ad `/workspace/Rakefile`)
  - Running `bundle exec rake -P --trace` .... (2.1s)
  - Compiling assets with cache (detected `rake assets:precompile` and `rake assets:clean` via `bundle exec rake -P`)
```

And not

```
- Rake assets install
  - Rake detected (`rake` gem found, `Rakefile` found ad `/workspace/Rakefile`)
  - Running `bundle exec rake -P --trace`

      rake about
          environment
      rake action_mailbox:ingress:environment
      rake action_mailbox:ingress:exim
          action_mailbox:ingress:environment
      rake action_mailbox:ingress:postfix
          action_mailbox:ingress:environment
      rake action_mailbox:ingress:qmail
          action_mailbox:ingress:environment
      rake action_mailbox:install
      rake action_mailbox:install:migrations
      rake action_text:install
      rake action_text:install:migrations
      rake active_storage:install
          environment
      rake active_storage:install:migrations
      rake active_storage:update

	  [...]

  - Done (2.111s)
  - Compiling assets with cache (detected `rake assets:precompile` and `rake assets:clean` via `bundle exec rake -P`)

```
  • Loading branch information
schneems committed Oct 6, 2023
1 parent 4b2e4c3 commit 1e866f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions buildpacks/ruby/src/gem_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ impl GemList {
let mut cmd = Command::new("bundle");
cmd.arg("list").env_clear().envs(envs);

log_step_stream(format!("Running {}", fmt::command(cmd.name())), |stream| {
let output = cmd.stream_output(stream.io(), stream.io())?;
let output = log_step_timed(format!("Running {}", fmt::command(cmd.name())), || {
cmd.named_output()
})?;

GemList::from_str(&output.stdout_lossy())
})
GemList::from_str(&output.stdout_lossy())
}

#[must_use]
Expand Down

0 comments on commit 1e866f6

Please sign in to comment.