github.phpd.cn/thought-machine/please@v12.2.0+incompatible/src/build/worker_stub.go (about)

     1  // +build bootstrap
     2  
     3  // Contains a stub for the buildMaybeRemotely function which is used during the
     4  // initial bootstrap when we don't have protobufs etc available.
     5  
     6  package build
     7  
     8  import (
     9  	"fmt"
    10  
    11  	"core"
    12  )
    13  
    14  // buildMaybeRemotely builds a target, either sending it to a remote worker if needed,
    15  // or locally if not.
    16  func buildMaybeRemotely(state *core.BuildState, target *core.BuildTarget, inputHash []byte) ([]byte, error) {
    17  	worker, _, localCmd := workerCommandAndArgs(state, target)
    18  	if worker == "" {
    19  		return runBuildCommand(state, target, localCmd, inputHash)
    20  	}
    21  	return nil, fmt.Errorf("Remote worker support has not been compiled in")
    22  }
    23  
    24  // StopWorkers does nothing, because in the stub we don't have any workers.
    25  func StopWorkers() {}