From 725e608a4a35fdb1a31a2c4314ff45b5be0b396e Mon Sep 17 00:00:00 2001 From: Emmanuel T Odeke Date: Thu, 30 Jan 2025 12:46:51 +0200 Subject: [PATCH] feat(gnovm/pkg/gnolang): add build constraints to fail on 32-bit architectures 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 --- README.md | 3 +++ gnovm/pkg/gnolang/nocompile_386.go | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 gnovm/pkg/gnolang/nocompile_386.go diff --git a/README.md b/README.md index 89bfd96d74f..5da0176d006 100644 --- a/README.md +++ b/README.md @@ -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) + +## Declarations +* Gno is only available for 64-bit architectures! diff --git a/gnovm/pkg/gnolang/nocompile_386.go b/gnovm/pkg/gnolang/nocompile_386.go new file mode 100644 index 00000000000..415e428136c --- /dev/null +++ b/gnovm/pkg/gnolang/nocompile_386.go @@ -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!") +}