Skip to content

Commit

Permalink
feat(gnovm/pkg/gnolang): add build constraints to fail on 32-bit arch…
Browse files Browse the repository at this point in the history
…itectures

This change adds build constraints so as to panic if built for 32-bit
architectures as it is a project wide decision not to support them.

This allows the mainnet launch without sweating trying to make a bunch
of runtime changes for the gnovm.

Updates #3288
  • Loading branch information
odeke-em committed Jan 30, 2025
1 parent b392287 commit 725e608
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,6 @@ repository offers more resources to dig into. We are eager to see your first PR!
* [![Go Reference](https://pkg.go.dev/badge/hey/google)](https://gnolang.github.io/gno/github.com/gnolang/gno.html) \
(pkg.go.dev will not show our repository as it has a license it doesn't recognise)
</details>

## Declarations
* Gno is only available for 64-bit architectures!
13 changes: 13 additions & 0 deletions gnovm/pkg/gnolang/nocompile_386.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//go:build 386

// Please note that the above build constraint is redundant
// if the name of the file has the suffix "*_386.go" but just
// in case someone is overly zealous and renames this file,
// that guard will ensure that the desired outcomes are achieved.

package gnolang

func init() {
// Please see https://github.com/gnolang/gno/issues/3288
panic("Gno is not supported on 32-bit machines!")
}

0 comments on commit 725e608

Please sign in to comment.