Any reason not to update to Xcode 12.2 on Catalina?
ryandesign at macports.org
Wed Nov 18 23:14:39 UTC 2020
> On Nov 18, 2020, at 10:39, Peter Hancock wrote:
> On 13/11/2020 10:42, Ryan Schmidt wrote:
>> On macOS 10.15, you can avoid even more problems by limiting yourself to Xcode 11.7 and the Xcode 11.5 version of the command line tools. Upgrading to Xcode 12 or the Xcode 12 version of the command line tools will cause some ports to fail to build with implicit declaration of function errors or other errors that are a consequence of earlier implicit declaration of function errors. This problem is pervasive and although we have fixed many ports already, there are many many more that have yet to be identified and fixed.
> Im on:
> Catalina 10.15.7, with Xcode 12.2 (12B45b).
> "pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version" gives
> "version: 184.108.40.206.1.1604628099"
> I have encountered "This problem".
> It was in the port "man" (that I don't actually need, on reflection).
> I found (and can't any longer...) a recent ticket on trac, closed, fixing (on big Sur?) what looked like
> the same problem (an undefined use of uint_t in signal.h) but the new version doesn't build for me.
> I'll open a new ticket, with my build log, if that's the right thing to do.
The ticket about the implicit declaration of function error in the man port was:
I thought I fixed it, though I only tested on macOS 10.13.
The problem you're describing sounds different. uint_t is a type, not a function, so it wouldn't be an implicit declaration of function error. Please report the problem to us in a ticket and attach the main.log as usual.
> However, I'd like to ask for some general advice/guidance.
> 1. My machine won't upgrade beyond Catalina.
> 2. I need (hopefully) only the Command Line Tools, and that for MacPorts.
> I seem to have receipts for a whole slew of ancient Xcodes, CLT's etc. It would be a joy to
> consign them all to the Trash, and somehow to persuade "Software Updates" to
> shutup scolding me to update to something useless and damaging.
> (ie. causing macports to fail building things actually important to me.)
> What version of the CLT's should I download and install from Apple's developer site?
> They are described as, eg. "Command Line Tools for Xcode 11.5", suggesting they are no
> good to me without Xcode 11.5.
> But would macports, reinstalled if advisable, likely work fine if I first uninstall
> and trash all the other stuff and just install that?
> (I anticipate dragging /Applications/Xcode.app" to the trash, and running a script I
> found in /Library/Developer/3.0/uninstall-devtools. I don't mind some lingering
> debris if only Software Update will shutup.)
If you don't need Xcode 12 for other reasons outside of MacPorts, you can save yourself the trouble of encountering implicit declaration of function errors by downgrading to Xcode 11 and the Xcode 11 command line tools. You should always use as matched a set as possible. The last version of Xcode 11 was 11.7 and the last version of the Xcode 11 command line tools was 11.5, so those are the versions I recommend for Catalina. It's what we use on the Catalina buildbot worker. If you don't want to install any of the ports that require Xcode, then you don't need to install Xcode.
If you install Xcode by downloading from the Apple developer site rather than using the App Store, I believe you will not be prompted about updating to the latest version.
I'm not sure how you would prevent software update from suggesting to you that you should update to the Xcode 12 version of the CLT. Deleting the receipt might do that, and in fact a bug in Catalina causes the receipt to be deleted automatically at some point, but that prevents MacPorts from being able to tell what version of the CLT you have installed, and MacPorts will ask you to reinstall the CLT so that the receipt is present.
More information about the macports-users