Does MacPorts depend on Spotlight?

Eric Gallager egall at
Thu Nov 18 14:47:43 UTC 2021

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:

More information about the macports-users mailing list