Skip to content

Conversation

@salvacorts
Copy link
Contributor

@salvacorts salvacorts commented Aug 4, 2025

Loki is failing to build for the linux/arm platform with (see):

59.88 # github.com/grafana/dskit/ring
59.88 vendor/github.com/grafana/dskit/ring/multi_partition_instance_ring.go:151:10: cannot use math.MaxInt64 (untyped int constant 9223372036854775807) as int value in return statement (overflows)
59.88 vendor/github.com/grafana/dskit/ring/multi_partition_instance_ring.go:155:10: cannot use math.MaxInt64 (untyped int constant 9223372036854775807) as int value in return statement (overflows)

linux/arm is a 32bits platform so int is 32 bits, but indexFromInstanceSuffix returns math.MaxInt64 instead of math.MaxInt.

What this PR does:

Which issue(s) this PR fixes:

Fixes PR - #725

Checklist

  • Tests updated

@salvacorts salvacorts changed the title fix: Return MaxInt on indexFromInstanceSuffix edge-cases to fix 32bit… fix: Return MaxInt on indexFromInstanceSuffix edge-cases to fix 32bit arch compatibility Aug 4, 2025
@salvacorts salvacorts changed the title fix: Return MaxInt on indexFromInstanceSuffix edge-cases to fix 32bit arch compatibility fix: return MaxInt on indexFromInstanceSuffix edge-cases to fix 32bit arch compatibility Aug 4, 2025
@salvacorts salvacorts marked this pull request as ready for review August 4, 2025 14:48
Copy link

@fcjack fcjack left a comment

Choose a reason for hiding this comment

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

lgtm

@salvacorts salvacorts enabled auto-merge (squash) August 4, 2025 14:51
@salvacorts salvacorts merged commit 6ac601c into main Aug 4, 2025
10 of 14 checks passed
@salvacorts salvacorts deleted the salvacorts/fix-32bits-build-for-indexFromInstanceSuffix branch August 4, 2025 14:54
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