Skip to content

cmd/deps: allow pruning deps tree for TestBot#20817

Merged
MikeMcQuaid merged 2 commits intomainfrom
test-bot-prune-tree
Oct 6, 2025
Merged

cmd/deps: allow pruning deps tree for TestBot#20817
MikeMcQuaid merged 2 commits intomainfrom
test-bot-prune-tree

Conversation

@cho-m
Copy link
Member

@cho-m cho-m commented Oct 5, 2025

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Mainly required for Qt where brew deps --tree on Linux is slow when using split out modules (Homebrew/homebrew-core#246844). When saved in a file it is over 8GB, which causes OOM on GitHub runner and seems to take hours on self-hosted (locally takes ~30min when dumping to a file)

I think we run this in CI to catch circular dependencies, so can ignore already tested parts.

I've also seen CI runner spend 5+ minutes on brew deps --tree for other formulae so may help speed those up too.

Later on, may see if there is any performance issue of brew deps --tree or expected when storing in memory.


For qtwebengine output tree size comparison

brew deps --tree --include-build --include-test --os linux qtwebengine | wc -c
 616702319brew deps --tree --prune --include-build --include-test --os linux qtwebengine | wc -c
   71937

qtdeclarative time comparison (easier to test than qtwebengine)

hyperfine "brew deps --tree --include-build --include-test --os linux --prune qtdeclarative" "brew deps --tree --include-build --include-test --os linux qtdeclarative"
Benchmark 1: brew deps --tree --include-build --include-test --os linux --prune qtdeclarative
  Time (mean ± σ):      1.052 s ±  0.139 s    [User: 0.742 s, System: 0.109 s]
  Range (min … max):    0.948 s …  1.374 s    10 runs

Benchmark 2: brew deps --tree --include-build --include-test --os linux qtdeclarative
  Time (mean ± σ):     21.471 s ±  0.202 s    [User: 20.911 s, System: 0.276 s]
  Range (min … max):   21.178 s … 21.822 s    10 runs

Summary
  brew deps --tree --include-build --include-test --os linux --prune qtdeclarative ran
   20.40 ± 2.71 times faster than brew deps --tree --include-build --include-test --os linux qtdeclarative

@cho-m cho-m marked this pull request as ready for review October 5, 2025 14:17
@cho-m
Copy link
Member Author

cho-m commented Oct 5, 2025

Added some integration tests. Only takes a couple seconds locally

brew tests --only cmd/deps
Randomized with seed 7617
1 process for 1 spec, ~ 1 spec per process
.....
Took 2 seconds

@cho-m cho-m force-pushed the test-bot-prune-tree branch from 6d447a7 to a648bb2 Compare October 5, 2025 17:32
@cho-m cho-m force-pushed the test-bot-prune-tree branch from a648bb2 to 5827251 Compare October 5, 2025 17:33
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Note if this is literally only for brew test-bot we should consider inline it there rather than shelling out.

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Oct 6, 2025
Merged via the queue into main with commit c237ba5 Oct 6, 2025
38 checks passed
@MikeMcQuaid MikeMcQuaid deleted the test-bot-prune-tree branch October 6, 2025 08:40
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.

2 participants