diff --git a/docs/BUILD b/docs/BUILD index 9b692c57c..614fa68d4 100644 --- a/docs/BUILD +++ b/docs/BUILD @@ -59,7 +59,7 @@ genrule( plugins = { "python": "v1.7.3", "java": "v0.4.2", - "go": "v1.21.4", + "go": "v1.21.5", "cc": "v0.4.0", "shell": "v0.2.0", "go-proto": "v0.3.0", diff --git a/src/core/build_target.go b/src/core/build_target.go index 2b9ea38d3..ba97ff447 100644 --- a/src/core/build_target.go +++ b/src/core/build_target.go @@ -1193,7 +1193,7 @@ func (target *BuildTarget) AddProvide(language string, labels []BuildLabel) { if target.Provides == nil { target.Provides = map[string][]BuildLabel{language: labels} } else { - target.Provides[language] = labels + target.Provides[language] = slices.Clip(labels) // Clip so we don't have issues appending in provideFor } } @@ -1227,9 +1227,10 @@ func (target *BuildTarget) provideFor(other *BuildTarget) ([]BuildLabel, bool) { for _, require := range other.Requires { if label, present := target.Provides[require]; present { if ret == nil { - ret = make([]BuildLabel, 0, len(other.Requires)) + ret = label + } else { + ret = append(ret, label...) } - ret = append(ret, label...) found = true } } diff --git a/src/parse/asp/config.go b/src/parse/asp/config.go index 5d76b79d4..71f3620d2 100644 --- a/src/parse/asp/config.go +++ b/src/parse/asp/config.go @@ -108,10 +108,19 @@ func resolvePluginValue(values []string, subrepo string) []string { continue // I guess it wasn't a build label. Leave it alone. } // Force the full build label including empty subrepo so this is portable - v = fmt.Sprintf("///%v//%v:%v", l.Subrepo, l.PackageName, l.Name) + var buf strings.Builder + buf.Grow(len(l.Subrepo) + len(l.PackageName) + len(l.Name) + len(annotation) + 7) // +7 for the delimiters + buf.WriteString("///") + buf.WriteString(l.Subrepo) + buf.WriteString("//") + buf.WriteString(l.PackageName) + buf.WriteByte(':') + buf.WriteString(l.Name) if annotation != "" { - v = fmt.Sprintf("%v|%v", v, annotation) + buf.WriteByte('|') + buf.WriteString(annotation) } + v = buf.String() } ret[i] = v } @@ -155,7 +164,7 @@ func pluginConfig(pluginState *core.BuildState, pkgState *core.BuildState) pyDic continue } - fullConfigKey := fmt.Sprintf("%v.%v", pluginName, configKey) + fullConfigKey := pluginName + "." + configKey value, ok := extraVals[strings.ToLower(configKey)] if !ok { // The default values are defined in the subrepo so should be parsed in that scope @@ -230,9 +239,9 @@ func toPyObject(key, val, toType string, optional bool) pyObject { case "bool": switch strings.ToLower(val) { case "true", "yes", "on", "1": - return pyBool(true) + return True case "false", "no", "off", "0": - return pyBool(false) + return False default: log.Fatalf("%s: invalid bool value: %v", key, val) return pyNone{} @@ -243,7 +252,7 @@ func toPyObject(key, val, toType string, optional bool) pyObject { log.Fatalf("%s: invalid int value: %v", key, val) return pyNone{} } - return pyInt(i) + return newPyInt(i) default: log.Fatalf("%s: invalid plugin configuration field type: %v", key, toType) return pyNone{}