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

Build failure when using make install #3368

Closed
stefann-01 opened this issue Dec 19, 2024 · 3 comments
Closed

Build failure when using make install #3368

stefann-01 opened this issue Dec 19, 2024 · 3 comments
Labels
🐞 bug Something isn't working

Comments

@stefann-01
Copy link
Contributor

Build failure: BeginTransaction missing GasMeter argument

Description

After pulling the latest commit from master, when using make install command, the installation fails during gno installation due to a type mismatch in the BeginTransaction function call. The compiler indicates that a required GasMeter argument is missing in the function call in the linting code.

Your environment

  • Go version go1.23.2
  • OS and CPU architecture linux/amd64
  • Gno commit hash causing the issue d69b552

Steps to reproduce

  1. Clone the Gno repository
  2. Checkout commit d69b552
  3. Run make install from the root directory
  4. Build fails during the gno installation step

Expected behaviour

The make install command should complete successfully.

Actual behaviour

The build fails.

Logs

go install ./cmd/gnokey
[+] 'gnokey' has been installed. Read more in ./gno.land/
make --no-print-directory -C ./gnovm    install
go install -ldflags "-X github.com/gnolang/gno/gnovm/pkg/gnoenv._GNOROOT=/home/stefan/gno_workspace/gno_orig/gno" ./cmd/gno
# github.com/gnolang/gno/gnovm/cmd/gno
cmd/gno/lint.go:147:34: not enough arguments in call to ts.BeginTransaction
        have ("github.com/gnolang/gno/tm2/pkg/store/types".Store, "github.com/gnolang/gno/tm2/pkg/store/types".Store)
        want ("github.com/gnolang/gno/tm2/pkg/store/types".Store, "github.com/gnolang/gno/tm2/pkg/store/types".Store, "github.com/gnolang/gno/tm2/pkg/store/types".GasMeter)
make[1]: *** [Makefile:43: install] Error 1
make: *** [Makefile:42: install.gno] Error 2```
@moul
Copy link
Member

moul commented Dec 19, 2024

CI on #3315 should have identified the issue.

There is a fix for this problem: #3369. However, please do not close this issue before resolving the CI.

@n0izn0iz
Copy link
Contributor

n0izn0iz commented Dec 19, 2024

The problem is that this PR was merged without being based on latest master
It adds the offending line, but it was passing the CI because it did not have the gas meter changes in it's base

The root problem is that we don't enforce that branches are up to date before merge. The full way to fix that is:

  • don't allow to merge branches that are not up-to-date
  • disallow any branch-protection bypass (for example "Allow maintainers to bypass branch protections" option)
  • optional: enable merge queue to be able to merge PRs without having to maintain them up-to-date manually

I must warn that the merge queue has tradeoffs and requires to modify workflows files to also target the merge-queue as well as properly marking required jobs in the repo config

thehowl pushed a commit that referenced this issue Dec 19, 2024
#3369)

Addresses #3368 

…all in lint.io

lint.go: add missing 'gasMeter' param to 'BeginTransaction' call

Impact: caused 'make install' to fail on branch 'master' with the
following error:

cmd/gno/lint.go:147:34: not enough arguments in call to
ts.BeginTransaction
        have ("github.com/gnolang/gno/tm2/pkg/store/types".Store,
              "github.com/gnolang/gno/tm2/pkg/store/types".Store)
        want ("github.com/gnolang/gno/tm2/pkg/store/types".Store,
              "github.com/gnolang/gno/tm2/pkg/store/types".Store,
              "github.com/gnolang/gno/tm2/pkg/store/types".GasMeter)
    make[1]: *** [install] Error 1

Testing: This fix resolves test failure commanded by `make test`:

    FAIL	github.com/gnolang/gno/gnovm/cmd/gno [build failed]
@thehowl
Copy link
Member

thehowl commented Dec 20, 2024

Moving discussion to #3395, and closing this because the issue is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
Development

No branches or pull requests

4 participants