Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#58016 closed enhancement (fixed)

Unnecessary warning about Xcode and xcodebuild when installing port

Reported by: gagarine (Simon) Owned by:
Priority: Normal Milestone: MacPorts 2.6.0
Component: base Version: 2.5.4
Keywords: Cc: isviridov
Port:

Description

I only installed the command line tools without installing the full Xcode.

I do have the necessary tools:

$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

But macports is printing two warnings when using port install:

Warning: xcodebuild exists but failed to execute
Warning: Xcode does not appear to be installed; most ports will likely fail to build.

Change History (16)

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

The message that Xcode does not appear to be installed dates from a time before the command line tools were a separate installation. Perhaps we need to revisit it. Nevertheless, we do currently still recommend you install Xcode, not just the command line tools. Not installing Xcode will cause some ports to fail to build.

The message that xcodebuild exists but failed to execute is more curious and should probably not be happening. What happens when you run e.g. xcodebuild -version?

comment:2 Changed 6 years ago by gagarine (Simon)

simon@computer /> xcodebuild -version
Xcode 10.1
Build version 10B61

I notice I didn't compile any package I believe (only installed already compiled binaries). Is their a way I can force compiling so I can test it really works?

comment:3 in reply to:  1 Changed 6 years ago by jmroot (Joshua Root)

Replying to ryandesign:

The message that xcodebuild exists but failed to execute is more curious and should probably not be happening. What happens when you run e.g. xcodebuild -version?

It's not curious if Xcode is actually not installed; xcodebuild -version does fail in that case and that's how base knows Xcode is not installed. See e.g. comment:ticket:57994:4

comment:4 Changed 6 years ago by gagarine (Simon)

I just installed Xcode and both messages disappear.

comment:5 in reply to:  2 Changed 6 years ago by jmroot (Joshua Root)

Replying to gagarine:

I notice I didn't compile any package I believe (only installed already compiled binaries). Is their a way I can force compiling so I can test it really works?

Sure, use the -s option, e.g. sudo port -vs destroot pinentry-mac (this is a port that needs xcodebuild)

comment:6 Changed 6 years ago by gagarine (Simon)

Oh yes. I'm sorry. So I tried now to uninstall xcode and I get this after uninstalling xcode (but not the tools)

simon@computer /> xcodebuild -version
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

comment:7 Changed 6 years ago by gagarine (Simon)

@jmort yes sudo port -vs destroot pinentry-mac fail without xcode.

But I was able to install gmp without. So perhaps a better message would be "some port may fail" when xcode is not installed but command line tools are?

comment:8 Changed 6 years ago by jmroot (Joshua Root)

So yeah, the "most ports" part of the message may be an exaggeration these days, but there are still quite a few that won't build without a full Xcode installation.

comment:9 Changed 6 years ago by gagarine (Simon)

I know those are details, but it can help a lot to avoid confusion. Especially "port install" is going to be the first command that a new user try. Having a warning their is certainly not the best experience.

To avoid "Warning: xcodebuild exists but failed to execute" we can know if dev tool are installed using

xcode-select -p

or

xcode-select -version

Then for the "Warning: Xcode does not appear to be installed; most ports will likely fail to build." perhaps somethings like "Xcode does not appear to be installed; some ports may fail to build. To hide this message in the future type 'port xcode-warning-hide'".

comment:10 Changed 6 years ago by isviridov

Cc: isviridov added

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

Summary: Unecessary Warning about Xcode and xcodebuild when installing portUnnecessary warning about Xcode and xcodebuild when installing port

comment:12 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:13 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:14 Changed 5 years ago by neverpanic (Clemens Lang)

Milestone: MacPorts Future
Resolution: fixed
Status: newclosed

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

In 8b9883313d3cbd3413f5cb1796a9f301ff4f6016/macports-base (master):

Remove xcodebuild warning

References #35045
References #58016

comment:16 Changed 5 years ago by jmroot (Joshua Root)

Milestone: MacPorts FutureMacPorts 2.6.0
Note: See TracTickets for help on using tickets.