build.go (go1.19.src) | : | build.go (go1.19.1.src) | ||
---|---|---|---|---|
skipping to change at line 406 | skipping to change at line 406 | |||
return pkgs | return pkgs | |||
} | } | |||
var pkgsFilter = func(pkgs []*load.Package) []*load.Package { return pkgs } | var pkgsFilter = func(pkgs []*load.Package) []*load.Package { return pkgs } | |||
var RuntimeVersion = runtime.Version() | var RuntimeVersion = runtime.Version() | |||
func runBuild(ctx context.Context, cmd *base.Command, args []string) { | func runBuild(ctx context.Context, cmd *base.Command, args []string) { | |||
modload.InitWorkfile() | modload.InitWorkfile() | |||
BuildInit() | BuildInit() | |||
var b Builder | b := NewBuilder("") | |||
b.Init() | ||||
pkgs := load.PackagesAndErrors(ctx, load.PackageOpts{LoadVCS: true}, args ) | pkgs := load.PackagesAndErrors(ctx, load.PackageOpts{LoadVCS: true}, args ) | |||
load.CheckPackageErrors(pkgs) | load.CheckPackageErrors(pkgs) | |||
explicitO := len(cfg.BuildO) > 0 | explicitO := len(cfg.BuildO) > 0 | |||
if len(pkgs) == 1 && pkgs[0].Name == "main" && cfg.BuildO == "" { | if len(pkgs) == 1 && pkgs[0].Name == "main" && cfg.BuildO == "" { | |||
cfg.BuildO = pkgs[0].DefaultExecName() | cfg.BuildO = pkgs[0].DefaultExecName() | |||
cfg.BuildO += cfg.ExeSuffix | cfg.BuildO += cfg.ExeSuffix | |||
} | } | |||
skipping to change at line 731 | skipping to change at line 730 | |||
case p.ConflictDir != "": | case p.ConflictDir != "": | |||
base.Errorf("go: no install location for %s: hidd en by %s", p.Dir, p.ConflictDir) | base.Errorf("go: no install location for %s: hidd en by %s", p.Dir, p.ConflictDir) | |||
default: | default: | |||
base.Errorf("go: no install location for director y %s outside GOPATH\n"+ | base.Errorf("go: no install location for director y %s outside GOPATH\n"+ | |||
"\tFor more details see: 'go help gopath' ", p.Dir) | "\tFor more details see: 'go help gopath' ", p.Dir) | |||
} | } | |||
} | } | |||
} | } | |||
base.ExitIfErrors() | base.ExitIfErrors() | |||
var b Builder | b := NewBuilder("") | |||
b.Init() | ||||
depMode := ModeBuild | depMode := ModeBuild | |||
if cfg.BuildI { | if cfg.BuildI { | |||
depMode = ModeInstall | depMode = ModeInstall | |||
} | } | |||
a := &Action{Mode: "go install"} | a := &Action{Mode: "go install"} | |||
var tools []*Action | var tools []*Action | |||
for _, p := range pkgs { | for _, p := range pkgs { | |||
// If p is a tool, delay the installation until the end of the bu ild. | // If p is a tool, delay the installation until the end of the bu ild. | |||
// This avoids installing assemblers/compilers that are being exe cuted | // This avoids installing assemblers/compilers that are being exe cuted | |||
// by other steps in the build. | // by other steps in the build. | |||
End of changes. 2 change blocks. | ||||
4 lines changed or deleted | 3 lines changed or added |