Opened 12 years ago

Closed 10 years ago

Last modified 4 years ago

#35045 closed enhancement (duplicate)

Don't warn about missing XCode when only Command Line Tools For XCode are installed

Reported by: schwern@… Owned by: macports-tickets@…
Priority: Low Milestone:
Component: base Version: 2.1.1
Keywords: Cc: m@…, cooljeanius (Eric Gallager), llamafilm, macports@…, macdeport, Dave-Allured (Dave Allured), isviridov
Port:

Description (last modified by ryandesign (Ryan Carsten Schmidt))

You can now download just the command line tools for XCode direct from Apple, a much smaller download and install. http://kennethreitz.com/xcode-gcc-and-homebrew.html

Unfortunately, MacPorts will continually warn:

Warning: Xcode does not appear to be installed; most ports will likely fail to build.

My experience says things go fine with just the Command Line Tools install and the warning is misleading clutter. It would be nice if MacPorts noticed the Command Line Tools install and did not warn. Thanks.

Change History (29)

comment:1 Changed 12 years ago by neverpanic (Clemens Lang)

Component: portsbase
Resolution: wontfix
Status: newclosed

This is by design. Some ports (e.g. those using the xcodebuild port group) require a full Xcode installation and will fail without Xcode.

comment:2 Changed 12 years ago by schwern@…

Resolution: wontfix
Status: closedreopened

I have 295 active ports and so far, I haven't encountered one that's failed because I don't have a full XCode install. Is it necessary to warn on every port because some need a full XCode install? If the purpose of the warning is to let the user know they need to install XCode to fix a problem, rather than report it as a bug, is it serving its purpose if the warning is more often wrong (and ignorable) than right?

Could there be a flag in the port files which do need a full xcode install and only those would trigger the warning? You mention there's already an xcodebuild group, maybe only the warning could trigger for those ports?

comment:3 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Not all ports that need Xcode use the xcode portgroup.

comment:4 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Type: defectenhancement

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

Description: modified (diff)

comment:6 in reply to:  3 Changed 12 years ago by schwern@…

Replying to ryandesign@…:

Not all ports that need Xcode use the xcode portgroup.

Is that by design or is it something that should be fixed? If by design, is there other pre-existing information in the ports the warning could trigger on? If not, is there something which could be grepped in portfiles which would tell us if they depend on the full XCode environment and then add that information to the relevant portfiles?

comment:7 Changed 12 years ago by neverpanic (Clemens Lang)

There is a a simple way to find out whether a port needs Xcode: Try to build them all without, try to build all those that failed with Xcode. The set of ports that fail without Xcode and install successfully with Xcode is the set that would have to be marked requiring Xcode. Or, you could just solve the halting problem, either way is fine with me.

MacPorts also uses the Xcode version to select different compilers and a number of Portfiles have conditionals depending on Xcode version. While I can see why people would like to see the Xcode dependency dropped, I still don't think the effort is worthwhile.

comment:8 in reply to:  7 Changed 12 years ago by schwern@…

Replying to cal@…:

There is a a simple way to find out whether a port needs Xcode: Try to build them all without, try to build all those that failed with Xcode. The set of ports that fail without Xcode and install successfully with Xcode is the set that would have to be marked requiring Xcode. Or, you could just solve the halting problem, either way is fine with me.

Thank you, that is singularly unhelpful. "Let's not even talk about how to solve the problem, because the problem is so obviously unsolvable" is a great way to have a lot of unsolved problems. If the best solution you can come up with is "brute force", this does not mean somebody else might not do better. Your solution is so unimaginative, that I presume it hasn't been given much thought or discussion.

So please, let's just skip over the part where you try to convince me to give up by repeatedly declaring the problem to be impossible. It just wastes everyone's time and energy. Either usefully reply with information, and 40% less drama, or quietly let me (and anyone who wants to help) "waste" my own time on finding a solution and get some work done. It's ok for somebody to be wrong on the Internet.

MacPorts also uses the Xcode version to select different compilers and a number of Portfiles have conditionals depending on Xcode version.

What do those conditionals look like? Can those be grep'd for or detected at runtime when Macports executes the Portfile?

It was also mentioned earlier that not all ports that need Xcode use the xcode portgroup. I didn't get answers to whether this is by design or an oversight. It would be also be useful to know if all members of the xcode portgroup use XCode, as it may be a good first order approximation and possibly the rest can be filled in as they fail and are reported.

There's more than one solution to the problem. What if the warning was only issued once per MacPorts process? What if it was issued only when a build failed? That's when it really matters, the warning provides a possible solution to the problem. No problem, no need to offer a solution.

Finally, there is the discussion about whether the warning, in its current form, is doing more harm than good. If it's wrong most of the time, maybe it should just be turned off? Do you all even consider the idea of MacPorts users not installing all of XCode an idea you want to support?

comment:9 Changed 12 years ago by landonf (Landon Fuller)

Finally, there is the discussion about whether the warning, in its current form, is doing more harm than good. If it's wrong most of the time, maybe it should just be turned off? Do you all even consider the idea of MacPorts users not installing all of XCode an idea you want to support?

I think it would certainly be better if this warning was only displayed when an actual build failure occurred.

comment:10 Changed 12 years ago by jmroot (Joshua Root)

This is probably effectively the same thing as #29172.

comment:11 Changed 11 years ago by m@…

Cc: m@… added

Cc Me!

comment:12 Changed 11 years ago by m@…

Even when I uninstall a port, I get a similar ("slightly misleading") warning:

port uninstall chmdump
Error:
Error: No valid Xcode installation is properly selected.
Error: Please use xcode-select to select an Xcode installation:
--->  Deactivating chmdump @20030521_0
--->  Cleaning chmdump
--->  Uninstalling chmdump @20030521_0
--->  Cleaning chmdump

comment:13 Changed 11 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

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

Resolution: duplicate
Status: reopenedclosed

comment:15 Changed 10 years ago by llamafilm

Cc: elliottbalsley@… added

Which ticket is this a duplicate of? EDIT: Sorry, didn't read, it's 29172.

Last edited 10 years ago by llamafilm (previous) (diff)

comment:16 Changed 9 years ago by macports@…

Cc: macports@… added

Cc Me!

comment:17 Changed 7 years ago by prohtex

This really needs to be fixed. I am a developer and do not want the full Xcode package eating up 8gb on my laptop. I have always installed only the Command Line Tools package and have used thousands of ports. None have failed to build without Xcode. I see this message nearly every day echoed over and over in Terminal. If anybody has a workaround I'd love to know it. The arguments for leaving this in are specious. This is NOT the same as removing Xcode dependency entirely.

Last edited 7 years ago by prohtex (previous) (diff)

comment:18 Changed 6 years ago by j-beda

Me!

comment:19 Changed 6 years ago by ddominguezcorcoba (Denis Domínguez Corcoba)

Warning: Xcode does not appear to be installed; most ports will likely fail to build.

It seems that a number of ports will fail to build, but I tend to think that certainly not most ports fall into this category. The warning, as it is, is simply disturbing, as one can see on the reactions.

Perhaps it would already help if we looked again at the warning text and modify it accordingly. And already the 2nd sentence in the first reply in this threat provides a good candidate!

Cheers

comment:20 Changed 6 years ago by athomps

This Warning message is highly misleading and thoroughly unhelpful. Many MacPort users purposely install the Xcode command line developer tools, but not the full application. They are subjected to a barrage of spurious warning messages, unnecessarily raising their heart rate when things are working, and leading them to pointlessly install the Xcode application when things are not. Why not differentiate the command line and the application dependencies and only generate a warning message for packages that require the application (if there are any).

comment:21 in reply to:  20 Changed 6 years ago by neverpanic (Clemens Lang)

Replying to athomps:

Why not differentiate the command line and the application dependencies and only generate a warning message for packages that require the application (if there are any).

The would be our goal. Unfortunately, it is not always easy to see whether a port requires Xcode or whether the Command Line Tools suffice.

We had an idea that we wanted a student to implement during Google Summer of Code on using our trace mode facilities to hide the Xcode installation unless a port declares a dependency. See wiki:SummerOfCode#xcode. This would allow us to programmatically find ports that require Xcode to build. Unfortunately, nobody has implemented this yet.

comment:22 Changed 6 years ago by macdeport

Cc: macdeport added

comment:23 Changed 5 years ago by Dave-Allured (Dave Allured)

Cc: Dave-Allured added

comment:24 Changed 5 years ago by isviridov

Cc: isviridov added

comment:25 Changed 5 years ago by gagarine (Simon)

A good start would be to add the warning once. Doing a sudo port upgrade outdated is full of this message.

Perhaps we can also only display this message when a port build fail as a possible reason for the build failure. "Warning: Xcode does not appear to be installed and may be required for this port to build"

comment:26 Changed 5 years ago by Satryaji Aulia <satraul@…>

In 057ce2b2bfe8d08cafe3f98296546f6a060790ab/macports-base (master):

port1.0: Implement use_xcode option

  • implement new option use_xcode to indicate Xcode dependency
  • default DEVELOPER_DIR to Command Line Tools unless port needs Xcode
  • hide Xcode files on trace mode unless port needs Xcode
  • fail fetch phase of Xcode-dependent port if Xcode is not installed

References #35045
References #58016

comment:27 Changed 5 years ago by Satryaji Aulia <satraul@…>

In 6f8aca0267707bd4d8e122148e3f88af57029a73/macports-base (master):

Remove Xcode uninstalled warning message

  • remove warning since we already error out on Xcode-dependent ports

References #35045
References #58016

comment:28 Changed 5 years ago by Satryaji Aulia <satraul@…>

In 8b9883313d3cbd3413f5cb1796a9f301ff4f6016/macports-base (master):

Remove xcodebuild warning

References #35045
References #58016

comment:29 Changed 4 years ago by breun (Nils Breunese)

After every macOS update (e.g. 10.15.5 to 10.15.6) this message returns:

Warning: cltversion: The Command Line Tools are installed, but MacPorts cannot determine the version.
Warning: cltversion: For a possible fix, please see: https://trac.macports.org/wiki/ProblemHotlist#reinstall-clt

Should MacPorts users just keep reinstalling the Command Line Tools after every macOS update?

Note: See TracTickets for help on using tickets.