Homebrew / brew

🍺 The missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
41.09k stars 9.65k forks source link

Dependency on latest Xcode is anti-pattern. #16720

Closed otheus closed 7 months ago

otheus commented 7 months ago

brew doctor output

$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed kegs have no formulae!
This means they were either deleted or installed manually.
You should find replacements for the following formulae:
  mitmproxy

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  kubeval
  lua@5.3
  openssl@1.1

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  openssl@3

Warning: Your Xcode (14.3.1) is outdated.
Please update to Xcode 15.1 (or delete it).
Xcode can be updated from the App Store.

### Verification

- [X] My "`brew doctor` output" above says `Your system is ready to brew.` and am still able to reproduce my issue.
- [X] I ran `brew update` twice and am still able to reproduce my issue.
- [X] This issue's title and/or description do not reference a single formula e.g. `brew install wget`. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

### `brew config` output

```shell
HOMEBREW_VERSION: 4.2.9
ORIGIN: https://github.com/Homebrew/brew
HEAD: e5fefd73cd97cd36ae3af29551f529ae59b333d6
Last commit: 2 days ago
Core tap JSON: 21 Feb 14:36 UTC
Core cask tap JSON: 21 Feb 14:36 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 3.1.4 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 14.0.3 build 1403
Git: 2.39.2 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 8.1.2 => /usr/bin/curl
macOS: 13.5-arm64
CLT: N/A
Xcode: 14.3.1
Rosetta 2: false

FYI

Otheuss-MBP:~ otheus$ /usr/bin/git --version
git version 2.39.2 (Apple Git-143)
Otheuss-MBP:~ otheus$ /Applications/Xcode.app/Contents/Developer/usr/bin/git --version
git version 2.39.2 (Apple Git-143)

### What were you trying to do (and why)?

I cannot figure out how to install anything with brew because it insists I need latest versions of Xcode-tools, which is false. 

(If it is, then that's the bug: why does running brew gist-logs require the latest version of Xcode? This is an absolute anti-pattern)

xcode-tools now requires > 20 GB+ of space, which is simply ridiculous, because it's more than probable, that what is needed is actually git, which is already installed.

### What happened (include all command output)?

brew gist-logs mitmproxy Error: Your Xcode (14.3.1) is outdated. Please update to Xcode 15.1 (or delete it). Xcode can be updated from the App Store.


### What did you expect to happen?

For gist-logs not to depend on latest version of xcode

### Step-by-step reproduction instructions (by running `brew` commands)

```shell
Already stated in output
Bo98 commented 7 months ago

brew gist-logs does indeed turn warnings into errors. I think the motivation there is so bug reports aren't opened on configurations we don't test on CI. brew gist-logs is generally for sending information to us rather than a user-focussed command.

Locally, you can check ~/Library/Logs/Homebrew directly.

I cannot figure out how to install anything with brew because it insists I need latest versions of Xcode-tools, which is false.

This part shouldn't be true, unless you are using an older Xcode that cannot run on your OS (e.g. Xcode 14 while running macOS Sonoma), but that isn't the case in your scenario.

It might warn you if building from source, but it shouldn't block you. I've run older Xcode fine on various occasions.