6060 Commits

Author SHA1 Message Date
Mike McQuaid
c5dbd3ca24
Rearrange requires
This improves the load time of most brew commands. For an example of
one of the simplest commands this speeds up:

Without Bootsnap:
```
$ hyperfine 'git checkout master; brew help' 'git checkout optimise_requires; brew help'
Benchmark 1: git checkout master; brew help
  Time (mean ± σ):     525.0 ms ±  35.8 ms    [User: 229.9 ms, System: 113.1 ms]
  Range (min … max):   465.3 ms … 576.6 ms    10 runs

Benchmark 2: git checkout optimise_requires; brew help
  Time (mean ± σ):     383.3 ms ±  25.1 ms    [User: 133.0 ms, System: 72.1 ms]
  Range (min … max):   353.0 ms … 443.6 ms    10 runs

Summary
  git checkout optimise_requires; brew help ran
    1.37 ± 0.13 times faster than git checkout master; brew help
```

With Bootsnap:
```
$ hyperfine 'git checkout master; brew help' 'git checkout optimise_requires; brew help'
Benchmark 1: git checkout master; brew help
  Time (mean ± σ):     386.0 ms ±  30.9 ms    [User: 130.2 ms, System: 93.8 ms]
  Range (min … max):   359.5 ms … 469.3 ms    10 runs

Benchmark 2: git checkout optimise_requires; brew help
  Time (mean ± σ):     330.2 ms ±  32.4 ms    [User: 93.4 ms, System: 73.0 ms]
  Range (min … max):   302.9 ms … 413.9 ms    10 runs

Summary
  git checkout optimise_requires; brew help ran
    1.17 ± 0.15 times faster than git checkout master; brew help
```
2024-07-14 08:49:39 -04:00
William Woodruff
92ef6ef763
Merge pull request #17708 from Homebrew/sandbox-chmod 2024-07-13 16:38:44 -04:00
Rylan Polster
e054a3ccf6
Also restrict SUID/GSID writes in sandbox 2024-07-13 16:28:17 -04:00
Thierry Moisan
74bb9fb193
Add test 2024-07-13 16:14:12 -04:00
Mike McQuaid
0f9ca1d627
Merge pull request #17699 from Homebrew/ww/rm-marshal-from-spec 2024-07-13 15:53:00 -04:00
Mike McQuaid
2ee6f29934
Merge pull request #17700 from Homebrew/filter-special-chars-from-sandbox 2024-07-13 15:52:33 -04:00
William Woodruff
419d4f7ab6
curl_spec: use deep_dup
Signed-off-by: William Woodruff <william@yossarian.net>
2024-07-13 15:36:34 -04:00
William Woodruff
695f080ba8
Revert "curl_spec: remove no-op Marshal use"
This reverts commit f3847d263f69a9a36e004c75c4969f939a66de3b.
2024-07-13 15:33:16 -04:00
William Woodruff
6cfe118ae3
attestation: don't dupe stderr
Silences `system_command!`'s own stderr handling,
since we do it independently.

Signed-off-by: William Woodruff <william@yossarian.net>
2024-07-13 15:30:21 -04:00
Rylan Polster
f4e5e0c716
Don't allow special characters in sandbox rule paths
Co-authored-by: Thierry Moisan <thierry.moisan@gmail.com>
2024-07-13 14:41:05 -04:00
William Woodruff
f3847d263f
curl_spec: remove no-op Marshal use
Signed-off-by: William Woodruff <william@yossarian.net>
2024-07-13 14:38:57 -04:00
Rylan Polster
8b0a4a98bf
Restrict direct url installs to the file:// scheme 2024-07-13 13:30:36 -04:00
Mike McQuaid
f39b5c1426
Merge pull request #17554 from Homebrew/cask-install-receipt 2024-07-13 10:55:06 -04:00
Issy Long
868c3dc9cd
Merge pull request #17680 from Homebrew/building-bottles-needs-network-for-sboms 2024-07-12 17:28:37 +01:00
Bo Anderson
ae9d5f9f14
cli/named_args: raise priority of core casks 2024-07-12 05:27:57 +01:00
Issy Long
d7123d43c7
test/dev-cmd/bottle: Mark the bottling test as needs_network
- I was on a plane and this failed with:

```
expected block to not output to stderr, but output
"curl: (6) Could not resolve host: spdx.github.io\nWarning: Failed to fetch SBOM schema, cannot perform SBOM validation!
Warning: Could not fetch JSON schema to validate SBOM!\nWarning: SBOM is not valid, not writing to disk!"
```
2024-07-11 21:16:14 -04:00
Rylan Polster
fec84544a9
Remove arch and macos dependencies from cask tab 2024-07-10 11:25:05 -04:00
Rylan Polster
fbe422b768
Fix test 2024-07-09 20:01:43 -04:00
Rylan Polster
d17da89382
Include recursive dependencies in cask tabs 2024-07-09 15:25:57 -04:00
Rylan Polster
119e02ceb0
Cleanup tap_git_head and uninstall_flight_blocks?
Co-authored-by: Kevin <apainintheneck@gmail.com>
2024-07-09 13:22:00 -04:00
Rylan Polster
dd510a5606
Improve test coverage 2024-07-05 10:47:05 -04:00
Rylan Polster
e176159b23
Fix test 2024-07-04 12:27:45 -04:00
Rylan Polster
46cb7f2847
Update tests 2024-07-04 01:47:14 -04:00
Rylan Polster
c16a9b33b2
Use cached json API file for formulae and cask specified paths 2024-07-03 13:41:52 -04:00
Alexander Bayandin
65885590ca rubocops/class: allow disabled formulae to be without a test block 2024-07-03 10:25:26 +01:00
apainintheneck
16e605e056 Load tap migration renames from API with short names
This is a follow-up to 484498e. I added loading for tap migration
renames from the API but it apparently only worked for full names.

There was a bug in both the code and the tests which prevented
loading by short names. This fixes those bugs so everything should
be good now.
2024-07-01 18:53:31 -07:00
Mike McQuaid
3aeef5aef2
Merge pull request #17582 from rrotter/desc_search 2024-07-01 08:45:22 +01:00
Ryan Rotter
816fe36a41 test Search.search_descriptions 2024-06-30 23:23:52 -04:00
Ryan Rotter
4f6771ccab test brew desc -s works w/ API w/o --eval-all 2024-06-30 23:05:29 -04:00
apainintheneck
fb3b13e3c3 Add tests
Check for the following:
- Tap migration rename to core tap can be loaded by short name
- Tap migration rename to core tap can be loaded by long name
- Tap migration renam that clashes with existing core tap short name
  is ignored in favor of loading the cask/formula from the core tap
2024-06-30 13:55:41 -07:00
Rylan Polster
e28d455154
autoremove: skip formulae where installed_on_request is nil 2024-06-28 21:57:47 -04:00
Eric Knibbe
f627c6331d
cask/audit: support on_os blocks in audit_min_os 2024-06-21 19:25:51 -04:00
Kevin
c3c1528611
Revert "Use cp -c when copying files" 2024-06-17 21:17:10 -07:00
Sean Molenaar
bbd73a7243 feat: add shared checks for casks and formulae 2024-06-16 17:24:31 +02:00
John Bampton
f6ee19239d Fix spelling; Github -> GitHub 2024-06-15 19:08:53 +10:00
Mike McQuaid
a883f14b72
autoremove: don't remove formulae that were built from source
When a formula was built from source, it should not be removed by
`brew autoremove` as it will take a while to be installed again.

Fixes https://github.com/Homebrew/brew/issues/17433
2024-06-14 17:26:28 +01:00
Bo Anderson
fa91edadfd
Portable Ruby 3.3.3 2024-06-14 03:32:38 +01:00
Mike McQuaid
4f35bc1e12
Merge pull request #17449 from Homebrew/brew-mark 2024-06-13 09:11:00 +01:00
Mike McQuaid
1e0add6d66
Merge pull request #17373 from tesaguri/cp-reflink 2024-06-13 08:57:20 +01:00
Ruoyu Zhong
9cd5078efb
cmd/tab: new command
Add `brew tab`, a new command to edit tab information, as previously
discussed in https://github.com/Homebrew/brew/pull/17125#issuecomment-2068473483.
Currently, this supports marking or unmarking formulae as installed on
request.

Sample usage:

    $ brew tab --installed-on-request curl
    ==> curl is now marked as installed on request.
    $ brew autoremove --dry-run
    [no output]
    $ brew tab --no-installed-on-request curl
    ==> curl is now marked as not installed on request.
    $ brew autoremove --dry-run
    ==> Would autoremove 2 unneeded formulae:
    curl
    rtmpdump

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2024-06-13 11:44:14 +08:00
Leo Heitmann Ruiz
4ac57d85b2 Read ZDOTDIR environment variable 2024-06-12 16:53:43 +02:00
Daiki Mizukami
e4fefc94eb
Utils::Copy: Fix tests for generic OS 2024-06-12 19:30:04 +09:00
Daiki Mizukami
028cfe1ea6
Utils::Cp: Rename to Utils::Copy
As per review feedback:

https://github.com/Homebrew/brew/pull/17373#discussion_r1633217748
2024-06-11 20:31:34 +09:00
Daiki Mizukami
4edbbfd794
Utils::Cp: Add tests 2024-06-11 20:27:37 +09:00
Bo Anderson
7da94a8f01
Preliminary macOS 15 (Sequoia) support 2024-06-11 02:59:31 +01:00
Mike McQuaid
c13700af00
Use repository consistently instead of repo
The documentation linting job doesn't like `repo` so let's fix this
globally rather than naming it differently in documentation and code.
2024-06-10 09:31:53 +01:00
Kevin
f8b1d1f56c
Merge pull request #17385 from pe/migrations-broken
Fix migrations of formulae and casks to non homebrew taps
2024-06-08 19:34:14 -07:00
Philippe Eberli
20fb068085 Fix migrations of formulae and casks to non homebrew taps 2024-06-08 16:29:23 +02:00
William Woodruff
e2827f1d8c
Merge pull request #17438 from Homebrew/ww/fix-all-tag
attestation: handle `:all` bottles
2024-06-06 11:55:40 -04:00
William Woodruff
b92de887ee
attestation_spec: add :all tag test
Signed-off-by: William Woodruff <william@yossarian.net>
2024-06-06 11:35:43 -04:00