Use `brew --prefix` to get brew package config path for install script
We noticed the Bun package manager is excluding the install script for your package because it is slow.
https://github.com/oven-sh/bun/blob/a305e99af5d9dbe74ffabfa5a3c0cfdf815ac71a/src/install/postinstall_optimizer.zig#L14-L19
In Deno we were looking into making a similar optimization, but we don't believe it would be good to override your preferences just so we can do better on an install benchmark.
I was looking at the code and I believe that it should actually get the value from `brew --prefix` then `./lib/pkgconfig`. I'm not sure though. It is much faster to do this on my machine.
```
% hyperfine --warmup 5 "brew --prefix" "brew environment --plain"
Benchmark 1: brew --prefix
Time (mean ± σ): 22.9 ms ± 1.6 ms [User: 8.3 ms, System: 8.8 ms]
Range (min … max): 18.8 ms … 29.1 ms 120 runs
Benchmark 2: brew environment --plain
Time (mean ± σ): 789.2 ms ± 65.3 ms [User: 209.1 ms, System: 139.0 ms]
Range (min … max): 714.9 ms … 884.1 ms 10 runs
Summary
brew --prefix ran
34.41 ± 3.68 times faster than brew environment --plain
```
合并状态:未合并 关闭于 2026-03-12 1 条评论