expr-lang / expr

Expression language and expression evaluation for Go
https://expr-lang.org
MIT License
5.85k stars 378 forks source link

Overflow errors when building for `386` #655

Closed mbardelmeijer closed 1 month ago

mbardelmeijer commented 1 month ago

When trying to build our project with the current master branch (for the fix of #652), we're seeing the following errors:

GOARCH=386 GOOS=linux go build

# github.com/expr-lang/expr/compiler
../../../go/pkg/mod/github.com/expr-lang/expr@v1.16.8-0.20240517174020-eb70f943cc3d/compiler/compiler.go:348:19: math.MaxInt64 (untyped int constant 9223372036854775807) overflows int
../../../go/pkg/mod/github.com/expr-lang/expr@v1.16.8-0.20240517174020-eb70f943cc3d/compiler/compiler.go:348:49: math.MinInt64 (untyped int constant -9223372036854775808) overflows int
../../../go/pkg/mod/github.com/expr-lang/expr@v1.16.8-0.20240517174020-eb70f943cc3d/compiler/compiler.go:368:19: math.MaxUint32 (untyped int constant 4294967295) overflows int
antonmedv commented 1 month ago

Fixed. This was caused by my other fix.

I also added a workflow which going to text build on GOARCH=386 in CI: https://github.com/expr-lang/expr/blob/master/.github/workflows/build.yml

mbardelmeijer commented 1 month ago

Awesome, can confirm the fix works.