add bundle git tag from pack.sh into builtin_actors_gen

This commit is contained in:
Mike Seiler 2023-02-07 02:23:23 +00:00
parent 23eaee49d4
commit ea82f554be
4 changed files with 14 additions and 6 deletions

View File

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

View File

@ -52,4 +52,4 @@ popd
echo "Generating metadata..."
make -C ../../ bundle-gen
make -C ../../ RELEASE="$RELEASE" bundle-gen

View File

@ -95,10 +95,11 @@ func loadManifests(netw string) error {
}
type BuiltinActorsMetadata struct {
Network string
Version actorstypes.Version
ManifestCid cid.Cid
Actors map[string]cid.Cid
Network string
Version actorstypes.Version
ManifestCid cid.Cid
Actors map[string]cid.Cid
BundleGitTag string
}
// ReadEmbeddedBuiltinActorsMetadata reads the metadata from the embedded built-in actor bundles.

View File

@ -20,6 +20,7 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
{{- range . }} {
Network: {{printf "%q" .Network}},
Version: {{.Version}},
{{if .BundleGitTag}} BundleGitTag: {{printf "%q" .BundleGitTag}}, {{end}}
ManifestCid: MustParseCid({{printf "%q" .ManifestCid}}),
Actors: map[string]cid.Cid {
{{- range $name, $cid := .Actors }}
@ -37,6 +38,12 @@ func main() {
panic(err)
}
if len(os.Args) > 1 {
for _, m := range metadata {
m.BundleGitTag = os.Args[1]
}
}
fi, err := os.Create("./build/builtin_actors_gen.go")
if err != nil {
panic(err)