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

chore: Fix Loki arm builds #15936

Merged
merged 3 commits into from
Jan 24, 2025
Merged

chore: Fix Loki arm builds #15936

merged 3 commits into from
Jan 24, 2025

Conversation

chaudum
Copy link
Contributor

@chaudum chaudum commented Jan 24, 2025

ref: https://github.com/grafana/loki/actions/runs/12945628097/job/36109187406

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
@@ -409,7 +409,8 @@ func (b *bitpackBuffer) Flush(w streamio.Writer) error {
//
// To encode the width in 6 bits, we encode width-1. That reserves the bottom
// 7 bits for metadata, and the remaining 57 bits for the number of sets.
const maxSets = 1<<57 - 1
Copy link
Member

Choose a reason for hiding this comment

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

Could this be explicitly typed as const maxSets uint64 so we wouldn't have to decrease the value on 32 bit ARM?

(I'm fine with the other change to remove math.MinInt64)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You compare the value later with a variable s.sets of type int. We could change that field to uint64 if you want

Copy link
Member

Choose a reason for hiding this comment

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

Haha sorry, I was reviewing this from my phone 🤦 At my desk now; I think your change is fine, we'll see if anything breaks.

Can you update the doc comment on the bitpackBuffer struct? Right now it still says the max value for bit_packed_sets is 2^57-1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the field sets to type uint64, which seems to be the more appropriate option.

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
Copy link
Member

@rfratto rfratto left a comment

Choose a reason for hiding this comment

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

Thanks!

@chaudum chaudum marked this pull request as ready for review January 24, 2025 15:28
@chaudum chaudum requested a review from a team as a code owner January 24, 2025 15:28
@chaudum chaudum enabled auto-merge (squash) January 24, 2025 15:28
@chaudum chaudum merged commit ed863fe into main Jan 24, 2025
58 checks passed
@chaudum chaudum deleted the chaudum/fix-overflow-int branch January 24, 2025 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants