Skip to content

Commit

Permalink
Merge pull request #10200 from filecoin-project/mikers/pack_add_git_tag
Browse files Browse the repository at this point in the history
feat: pack: add git tag to builtin_actors_gen
  • Loading branch information
jennijuju authored Feb 8, 2023
2 parents 23eaee4 + 66d763e commit 4c6fb21
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
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

0 comments on commit 4c6fb21

Please sign in to comment.