Skip to content

Commit

Permalink
Revert "rlp/rlpgen: remove build tag (ethereum#28106)"
Browse files Browse the repository at this point in the history
This reverts commit ec2a227.
  • Loading branch information
devopsbo3 authored Nov 10, 2023
1 parent 90de8d2 commit d53feae
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
3 changes: 3 additions & 0 deletions core/types/gen_account_rlp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions core/types/gen_header_rlp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions core/types/gen_log_rlp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions core/types/gen_withdrawal_rlp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions rlp/rlpgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ type Config struct {
func (cfg *Config) process() (code []byte, err error) {
// Load packages.
pcfg := &packages.Config{
Mode: packages.NeedName | packages.NeedTypes,
Dir: cfg.Dir,
Mode: packages.NeedName | packages.NeedTypes | packages.NeedImports | packages.NeedDeps,
Dir: cfg.Dir,
BuildFlags: []string{"-tags", "norlpgen"},
}
ps, err := packages.Load(pcfg, pathOfPackageRLP, ".")
if err != nil {
Expand Down Expand Up @@ -116,6 +117,8 @@ func (cfg *Config) process() (code []byte, err error) {
// This is done here to avoid processing these lines with gofmt.
var header bytes.Buffer
fmt.Fprint(&header, "// Code generated by rlpgen. DO NOT EDIT.\n\n")
fmt.Fprint(&header, "//go:build !norlpgen\n")
fmt.Fprint(&header, "// +build !norlpgen\n\n")
return append(header.Bytes(), code...), nil
}

Expand Down

0 comments on commit d53feae

Please sign in to comment.