If this attribute is set to true and distributed building is enabled, then, if possible, the derivaton will be built locally instead of forwarded to a remote machine. This is appropriate for trivial builders where the cost of doing a download or remote build would exceed the cost of building locally.
The reason why the minecraft-server does this is that the “build” process is essentially pulling down a large .jar file. There’s really no expensive build process involved with creating the build artifacts.
IIRC, allowSubstitutes will allow for a remote machine to download build dependencies. Generally this is the desired case if the remote machine has a faster connection, such as being located in a datacenter
I find allowSubstitutes strange as it’s not always a property of the package but a combination of the local host and proximity to caching infrastructure. For example, I always want to be able to substitute builds from our on-premises cache. But that’s not possible if allowSubstitutes=false.
Can’t agree more - in enterprise settings often only dedicated “build” machines have access “outside” and many machines only have access to the internal binary cache (or the internal build servers). Seemingly random (until I discovered allowSubstituters) ignoring of prebuilt derivations available in the cache (which is a high speed connection away) has been a head-scratcher. From now on I will be setting always-allow-substituters to true everywhere.
Is there a similar override option for preferLocalBuild? The justification “This is appropriate for trivial builders where the cost of doing a download or remote build would exceed the cost of building locally.” is not well thought-through in my opinion. How would the developer of a random derivation know what is faster (or even possible due to firewalls, etc.) in my environment?