Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: pack: add git tag to builtin_actors_gen #10200

Merged
merged 2 commits into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -354,7 +354,7 @@ docsgen-openrpc-gateway: docsgen-openrpc-bin
fiximports:
./scripts/fiximports

gen: actors-code-gen type-gen cfgdoc-gen docsgen api-gen circleci bundle-gen fiximports
gen: actors-code-gen type-gen cfgdoc-gen docsgen api-gen circleci fiximports
@echo ">>> IF YOU'VE MODIFIED THE CLI OR CONFIG, REMEMBER TO ALSO MAKE docsgen-cli"
.PHONY: gen

Expand Down
2 changes: 1 addition & 1 deletion build/actors/pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ popd

echo "Generating metadata..."

make -C ../../ bundle-gen
make -C ../../ RELEASE="$RELEASE" bundle-gen
9 changes: 5 additions & 4 deletions build/builtin_actors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions gen/bundle/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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)
Expand Down