github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/go/internal/work/exec.go (about)

     1  // Copyright 2011 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Action graph execution.
     6  
     7  package work
     8  
     9  import (
    10  	"github.com/shogo82148/std/context"
    11  
    12  	"github.com/shogo82148/std/cmd/go/internal/load"
    13  )
    14  
    15  // Do runs the action graph rooted at root.
    16  func (b *Builder) Do(ctx context.Context, root *Action)
    17  
    18  // VetTool is the path to an alternate vet tool binary.
    19  // The caller is expected to set it (if needed) before executing any vet actions.
    20  var VetTool string
    21  
    22  // VetFlags are the default flags to pass to vet.
    23  // The caller is expected to set them before executing any vet actions.
    24  var VetFlags []string
    25  
    26  // VetExplicit records whether the vet flags were set explicitly on the command line.
    27  var VetExplicit bool
    28  
    29  // PkgconfigCmd returns a pkg-config binary name
    30  // defaultPkgConfig is defined in zdefaultcc.go, written by cmd/dist.
    31  func (b *Builder) PkgconfigCmd() string
    32  
    33  // BuildInstallFunc is the action for installing a single package or executable.
    34  func BuildInstallFunc(b *Builder, ctx context.Context, a *Action) (err error)
    35  
    36  // AllowInstall returns a non-nil error if this invocation of the go command is
    37  // allowed to install a.Target.
    38  //
    39  // The build of cmd/go running under its own test is forbidden from installing
    40  // to its original GOROOT. The var is exported so it can be set by TestMain.
    41  var AllowInstall = func(*Action) error { return nil }
    42  
    43  // GccCmd returns a gcc command line prefix
    44  // defaultCC is defined in zdefaultcc.go, written by cmd/dist.
    45  func (b *Builder) GccCmd(incdir, workdir string) []string
    46  
    47  // GxxCmd returns a g++ command line prefix
    48  // defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
    49  func (b *Builder) GxxCmd(incdir, workdir string) []string
    50  
    51  // CFlags returns the flags to use when invoking the C, C++ or Fortran compilers, or cgo.
    52  func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, ldflags []string, err error)