Opened 10 years ago

Last modified 10 years ago

#44900 new enhancement

Installation of Xcode should be better than Homebrew's process

Reported by: tal@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: base Version: 2.3.1
Keywords: Cc:
Port:

Description

I'm a fan of MacPorts but I recently tried Homebrew since my coworkers use it. I switched back to MacPorts because it has the packages I need. However, while trying Homebrew I felt the way it handles installing Xcode is brilliant. We should steal that idea. It does everything for you so that it can't get messed up. With MacPorts, when walking people through the install procedure we always get tripped up while installing Xcode, especially the part accepting the Tersm of Service.

Attachments (1)

brew-install-480p.m4v (29.8 MB) - added by larryv (Lawrence Velázquez) 10 years ago.
H.264 version at 480p

Change History (7)

comment:1 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

How does Homebrew automate installing Xcode?

I don't think legally MacPorts can accept a license agreement, terms of service, or any other legal document on behalf of the user; the user must read and agree to the document personally.

comment:2 Changed 10 years ago by tal@…

Homebrew installs the minimal Xcode for you (if it isnt installed already) and runs "xcode-select --install" to pop up the ToS permission page for you to approve.

Here is a screen capture of a virgin Mac OS X machine where I run Terminal, the homebrew install command, and install "git" to show that the compiler works: http://whatexit.org/tal/brew-install.mov

(please let me know when you've seen the video so i can remove it from my tiny server)

comment:3 Changed 10 years ago by mf2k (Frank Schima)

Component: portsbase

Changed 10 years ago by larryv (Lawrence Velázquez)

Attachment: brew-install-480p.m4v added

H.264 version at 480p

comment:4 in reply to:  2 Changed 10 years ago by larryv (Lawrence Velázquez)

Replying to tal@…:

Homebrew installs the minimal Xcode for you (if it isnt installed already) and runs "xcode-select --install" to pop up the ToS permission page for you to approve.

It’s not installing Xcode at all; it’s installing the Command Line Tools only. We don’t currently support using MacPorts with just the CLT.

(please let me know when you've seen the video so i can remove it from my tiny server)

I’ve attached a downscaled version to this ticket.

comment:5 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Ok, I've taken a look at the video. Thanks. It shows the terminal command for installing Homebrew itself being entered and run. This causes xcode-select --install to run which pops up the dialog box asking the user if they would like to install the command line tools. The terminal window asks the user to press a key when the command line tools have been installed. Afterward, Homebrew itself gets installed, and it is shown that a package can then be installed using Homebrew. I didn't see anything in the video about accepting the Xcode license agreement.

MacPorts is of course installed via an installer package, not via the command line. The MacPorts installer package is supposed to require that Xcode already be installed. If it isn't, it's supposed to tell the user that, so that they can go install Xcode, then run the MacPorts installer again. Our method for detecting the presence of Xcode failed when Mavericks was released, so there was a time on Mavericks where our installer did not properly detect the absence of Xcode and erroneously allowed the user to proceed without it. I hope we have fixed that in the mean time.

Historically (i.e. on Snow Leopard and earlier) the command line tools were part of the Xcode installation. The MacPorts installer checks for that as well, on those older systems, but I get the impression we're not checking for it on newer systems (i.e. the method for detection must have changed). Perhaps we should update that code.

The reason we require Xcode and the command line tools to already be installed when the MacPorts installer runs is that the MacPorts installer finishes by running "sudo port selfupdate", which, if the user used an outdated MacPorts installer package, would cause the current version of MacPorts to be downloaded and compiled, for which of course a compiler must already be installed.

Downloading Xcode has historically required the user to register for at least the free level of Apple developer account; MacPorts could not automate this. These days you can get Xcode from either the Apple developer web page or via the Mac App Store, but both do require the user to present their credentials.

Last I checked (which was years ago), the installer did not give packages very much control. A package either succeeds, or fails at some point. The error message can be customized, but beyond that the behavior cannot. It would be nice if the MacPorts installer could detect the absence of Xcode and in response direct the user to the MacPorts installation instructions, from which we link to Xcode downloads, but I don't believe the installer gives us the possibility to do that.

comment:6 Changed 10 years ago by tal@…

I didn't see anything in the video about accepting the Xcode license agreement.

Around 0:48 there is a "Command Line Tools License Agreement: MAC SDK and XCODE AGREEMENT" pop-up.

Maybe I was experiencing the failure of Mavericks from detecting Xcode, but I'm pretty sure I've had this problem in many versions. Luckily I have Parallels and can spin up OS X installations easily to see how the installer works on a virgin machine. I'll try to record the MacPorts process soon.

In the meanwhile, please look at 0:48 in the video and see that the agreement is agreed to in the process. That kind of thing would make it easier for new people to adopt MacPorts.

Note: See TracTickets for help on using tickets.