include the version that pack is running on for filtering the build gen metadata

This commit is contained in:
mike seiler 2023-02-16 14:01:45 -07:00
parent ea03e1b6e7
commit 0f6cbf1be2
3 changed files with 22 additions and 12 deletions

View File

@ -298,7 +298,7 @@ actors-gen: actors-code-gen fiximports
.PHONY: actors-gen .PHONY: actors-gen
bundle-gen: bundle-gen:
$(GOCC) run ./gen/bundle $(RELEASE) $(RELEASE_OVERRIDES) $(GOCC) run ./gen/bundle $(VERSION) $(RELEASE) $(RELEASE_OVERRIDES)
$(GOCC) fmt ./build/... $(GOCC) fmt ./build/...
.PHONY: bundle-gen .PHONY: bundle-gen

View File

@ -52,4 +52,4 @@ popd
echo "Generating metadata..." echo "Generating metadata..."
make -C ../../ RELEASE="$RELEASE" RELEASE_OVERRIDES="${RELEASE_OVERRIDES[*]}" bundle-gen make -C ../../ VERSION="$VERSION" RELEASE="$RELEASE" RELEASE_OVERRIDES="${RELEASE_OVERRIDES[*]}" bundle-gen

View File

@ -45,24 +45,34 @@ func main() {
panic(err) panic(err)
} }
var metadataSpecificVersion []*build.BuiltinActorsMetadata
// see ./build/actors/pack.sh // see ./build/actors/pack.sh
// expected args are git bundle tag then number of per network overrides // expected args are git bundle tag then number of per network overrides
// overrides are in the format network_name=override // overrides are in the format network_name=override
overrides := map[string]string{}
for _, override := range os.Args[2:] {
network, version := splitOverride(override)
overrides[network] = version
}
if len(os.Args) > 1 { if len(os.Args) > 1 {
version := os.Args[1]
overrides := map[string]string{}
for _, override := range os.Args[3:] {
k, v := splitOverride(override)
overrides[k] = v
}
for _, m := range metadata { for _, m := range metadata {
if strings.HasPrefix(version, fmt.Sprintf("v%d", m.Version)) {
// correct version
override, ok := overrides[m.Network] override, ok := overrides[m.Network]
if ok && strings.HasPrefix(override, fmt.Sprintf("v%d", m.Version)) { if ok {
m.BundleGitTag = override m.BundleGitTag = override
} else { } else {
m.BundleGitTag = os.Args[1] m.BundleGitTag = os.Args[2]
}
fmt.Println("hi")
metadataSpecificVersion = append(metadataSpecificVersion, m)
} }
} }
metadata = metadataSpecificVersion
} }
fi, err := os.Create("./build/builtin_actors_gen.go") fi, err := os.Create("./build/builtin_actors_gen.go")