apple / pkl-go

Pkl bindings for the Go programming language
https://pkl-lang.org/go/current/index.html
Apache License 2.0
259 stars 24 forks source link

Go build error for linux/386 nocgo #37

Closed ericzbeard closed 6 months ago

ericzbeard commented 6 months ago

Building a Go binary for linux/386 nocgo fails

go build -buildvcs=false -ldflags=-w -o dist/rain-v1.8.2-test3_linux-i386-nocgo/ ./cmd/rain

# github.com/apple/pkl-go/pkl
/go/pkg/mod/github.com/apple/pkl-go@v0.6.0/pkl/values.go:111:29: Second * 60 (constant 60000000000 of type DurationUnit) overflows int
/go/pkg/mod/github.com/apple/pkl-go@v0.6.0/pkl/values.go:238:7: Terabytes (untyped int constant 1000000000000) overflows int
/go/pkg/mod/github.com/apple/pkl-go@v0.6.0/pkl/values.go:240:7: Tebibytes (untyped int constant 1099511627776) overflows int
/go/pkg/mod/github.com/apple/pkl-go@v0.6.0/pkl/values.go:242:7: Petabytes (untyped int constant 1000000000000000) overflows int
/go/pkg/mod/github.com/apple/pkl-go@v0.6.0/pkl/values.go:244:7: Pebibytes (untyped int constant 1125899906842624) overflows int
/go/pkg/mod/github.com/apple/pkl-go@v0.6.0/pkl/values.go:279:10: cannot use Terabytes (untyped int constant 1000000000000) as DataSizeUnit value in return statement (overflows)
/go/pkg/mod/github.com/apple/pkl-go@v0.6.0/pkl/values.go:281:10: cannot use Tebibytes (untyped int constant 1099511627776) as DataSizeUnit value in return statement (overflows)
/go/pkg/mod/github.com/apple/pkl-go@v0.6.0/pkl/values.go:283:10: cannot use Petabytes (untyped int constant 1000000000000000) as DataSizeUnit value in return statement (overflows)
/go/pkg/mod/github.com/apple/pkl-go@v0.6.0/pkl/values.go:285:10: cannot use Pebibytes (untyped int constant 1125899906842624) as DataSizeUnit value in return statement (overflows)
Error: Process completed with exit code 1.
bioball commented 6 months ago

This was fixed in https://github.com/apple/pkl-go/pull/32.

For now, you should be able to fix your build errors by pinning to the main branch.

ericzbeard commented 6 months ago

Confirmed that installing from main fixes it.