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

fix: avoid int overflow errors with DurationUnit && DataSizeUnit #32

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

jstrachan
Copy link

I hit this bug when trying to use goreleaser on a project using pkl-go as it failed with errors like the following.

Note I'm not sure why goreleaser finds these issues but other go targets don't; I guess its one of the golang linters maybe?

pkl/values.go:111:29: Second * 60 (constant 60000000000 of type DurationUnit) overflows int;
pkl/values.go:238:7: Terabytes (untyped int constant 1000000000000) overflows int;
pkl/values.go:240:7: Tebibytes (untyped int constant 1099511627776) overflows int;
pkl/values.go:242:7: Petabytes (untyped int constant 1000000000000000) overflows int;
pkl/values.go:244:7: Pebibytes (untyped int constant 1125899906842624) overflows int;
pkl/values.go:279:10: cannot use Terabytes (untyped int constant 1000000000000) as DataSizeUnit value in return statement (overflows);
pkl/values.go:281:10: cannot use Tebibytes (untyped int constant 1099511627776) as DataSizeUnit value in return statement (overflows);
pkl/values.go:283:10: cannot use Petabytes (untyped int constant 1000000000000000) as DataSizeUnit value in return statement (overflows);
pkl/values.go:285:10: cannot use Pebibytes (untyped int constant 1125899906842624) as DataSizeUnit value in return statement (overflows);

@holzensp
Copy link
Contributor

Could goreleaser somehow force 32-bit word size?

Copy link
Contributor

@holzensp holzensp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@holzensp holzensp merged commit fcfb0ac into apple:main Mar 12, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants