Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use xcode-select for CLDT detection #757

Closed
wants to merge 1 commit into from
Closed

Use xcode-select for CLDT detection #757

wants to merge 1 commit into from

Conversation

jamestut
Copy link

CLDT is not required when Xcode is installed, as Xcode is a superset of CLDT. I think having both installed is just a waste of disk space.

This PR updates the installer to use the macOS' built-in xcode-select command rather than checking for a hardcoded path. xcode-select -p will return an error code if there is no CLDT or Xcode installed.

@SMillerDev
Copy link
Member

As far as I know it is not a superset. Do you have a list of all tools available in both so we can compare?

@jamestut
Copy link
Author

jamestut commented Mar 24, 2023 via email

Copy link
Member

@carlocab carlocab left a comment

Choose a reason for hiding this comment

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

Checking for the CLT specifically (rather than just any Xcode install) is intentional here. If you'd rather not install the CLT with Homebrew use an alternative installation method.

Note that alternative installation methods are unsupported, and you will not be able to use bottles for some formulae (e.g. python@3.*) if you do not have a CLT installation at /Library/Developer/CommandLineTools. You are also likely to experience problems with building formulae from source unless you are on the latest version of macOS.

Copy link
Member

@carlocab carlocab left a comment

Choose a reason for hiding this comment

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

I meant to request changes, not comment.

@MikeMcQuaid
Copy link
Member

CLDT is not required when Xcode is installed,

This is not true. Closing.

@jamestut
Copy link
Author

Hi @MikeMcQuaid, I'd curious what formulae would specifically require CLDT and won't work with only Xcode installed?

I've installed Pillow, Numpy, and other Python 3 libraries, and all of them works fine without CLDT. I encountered some formulas (I think it was llvm) which explicitly asked for CLDT, but I modified the formula to take the path from xcode-select -p, and it installed and worked fine. In fact, I was on Xcode-beta at that time which again homebrew did not properly detect due to hardcoding the path to /Applications/Xcode.app.

I did grep in the homebrew-core:/Formula and indeed it was only llvm and git formula that have the string /Library/Developer/CommandLineTools hardcoded to it.

I apologize beforehand if I might sound pushy, but I really curious why you all insist to have CLDT installed, and would like to know the real reason. 🙏

@MikeMcQuaid
Copy link
Member

@jamestut @carlocab has given some examples above. To find more: go digging in homebrew/core.

I really curious why you all insist to have CLDT installed

We don't. The official installer will install it. You can choose to not use this installer.

and would like to know the real reason.

We told you the real reason.

Another reason: we've been running a package manager for millions of people for over a decade. We would rather have a default behaviour that definitely works for most of those people, even if it installs things unnecessary for some people, than change it because someone like yourself consider it redundant which then breaks things for many more users.

@jamestut jamestut deleted the cldt-detect branch March 24, 2023 09:17
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants