Problem

BSD make (bmake) pauses for a couple of seconds when run in an automounted directory under /net. During the pause, messages like the following appear in /var/log/messages:

Dec  1 15:06:41 zinger automountd[27737]: "/etc/autofs/special_hosts noexist", pid 27738, terminated with exit status 1
Dec  1 15:06:41 zinger kernel: WARNING: autofs_trigger_one: request for /net/ completed with error 5, pid 27726 (ls)
Dec  1 15:06:41 zinger automountd[27737]: failed to handle special map "-hosts"

This does not happen with GNU make. It works differently.

Solution / Workaround

Create a directory share/mk in the top level directory of your project.

$ mkdir -p share/mk

Explanation

A common automounter setup is to use /net as a convenient way to mount any NFS exports on the network without any other configuration. (Assuming permissions allow.) You can simply change directory to /net/hostname/share and hostname:share will be mounted. For example, this automounts the zdata/dl export from a host named dumbo:

$ cd /net/dumbo/zdata/dl

If the host doesn’t exist, the operation times out and fails:

$ ls /net/noexist/file
ls: /net/noexist/file: Input/output error

This is what happens when BSD make pauses. To support it’s include mechanism, make searches for the directory share/mk, starting in the current directory, and working up towards the root.

So when make starts, it looks for the following directories, stopping when it finds one:

./share/mk
../share/mk
../../share/mk
...
/share/mk

If you are running from a directory under /net, then the second to last directory checked would be /net/share/mk.

At this point, the automounter thinks make is trying to mount an export named mk from a host named share. Since the host doesn’t exist, there is a pause.

If you create an empty share/mk directory at the top of your project, make will stop searching there, and won’t continue up to the /net directory, and won’t trigger the automounter.