Skip to content

Decode sizes and revisions as int64 - #89

Merged
ilyabrin merged 1 commit into
mainfrom
fix/int64-sizes
Oct 7, 2026
Merged

ilyabrin merged 1 commit into
mainfrom
fix/int64-sizes

Conversation

@ilyabrin

@ilyabrin ilyabrin commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Why

On 32-bit systems int is 32 bits wide. Disk sizes, file sizes over 2 GB
and every revision (a microsecond timestamp) overflowed it, so decoding
failed and even DiskInfo returned an error on 386 and 32-bit ARM. yad
needs this before it can ship builds for those platforms.

What

  • Resource.Size, Resource.Revision and Disk.TotalSpace, UsedSpace,
    TrashSize, MaxFileSize and Revision are now int64.
  • Counts (limit, offset, total, views) stay int.
  • Tests for values over 2^31; CI also runs the tests with GOARCH=386.
  • README (EN and RU): an "Upgrading to v1.3" section.

Compatibility

Code that keeps one of these fields in an int stops compiling and needs
int(...) or an int64 variable. The compiler points at each spot.

Checked locally

go vet on amd64 and 386, go test ./... on amd64 and 386,
golangci-lint v2.13.2, markdownlint.

As int they overflowed on 32-bit systems: a Disk or a file over 2 GB,
or any revision (a microsecond timestamp), failed to decode, so even
DiskInfo returned an error on 386 and 32-bit ARM.

Resource.Size, Resource.Revision and Disk.TotalSpace, UsedSpace,
TrashSize, MaxFileSize and Revision are now int64. Code that stores
one of them in an int needs a conversion; the README shows how.
CI now runs the tests as 386 too.

BREAKING CHANGE: the fields above changed type from int to int64.
@ilyabrin
ilyabrin merged commit ef36103 into main Oct 7, 2026
13 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.

1 participant