Does MacPorts depend on Spotlight?

Craig Treleaven ctreleaven at
Thu Nov 18 15:32:47 UTC 2021

> On Nov 18, 2021, at 9:47 AM, Eric Gallager via macports-users <macports-users at> wrote:
> On Thu, Nov 18, 2021 at 3:02 AM Ryan Schmidt <ryandesign at> wrote:
>> MacPorts base doesn't do anything with Spotlight. It doesn't depend on it existing, nor does it tell Spotlight to index or not to index anything. MacPorts predates the existence of Spotlight.
>> As far as I know, ports don't depend on Spotlight having indexed the MacPorts prefix or the build directory. On the MacPorts buildbot machines, I exclude /opt/local and /Applications/MacPorts from the Spotlight index in order to reduce disk writes. As far as I know, this hasn't caused any build failures.
>> I do recall at least one port where we discovered that it was using `mdfind` (the command line utility for finding files using the Spotlight index) to find something it needed (Xcode, if I recall), and this failed for a user who had excluded either /Applications or maybe their whole disk from Spotlight or turned Spotlight off entirely, so I don't recommend doing that.
> Didn't MacPorts start doing `chflags hidden` on
> /opt/local/var/macports at some point to stop Spotlight from indexing
> it? If it wasn't actually to stop Spotlight from indexing it, then why
> hide it? Also Fink makes Spotlight avoid its build directory by giving
> it a `.build` suffix; apparently a `.noindex` suffix ought to work,
> too; I've thought for a while that MacPorts should use one of these
> suffixes as well. Also Fink supplies a package that provides an
> importer that allows Spotlight to index its info files, which is
> something that I've wondered if it could be ported to MacPorts to
> create an `.mdimporter` for Portfiles, too:

There was some discussion of alternative ways to avoid indexing, all the way back in 2014: <>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the macports-users mailing list