Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Conversation

mem
Copy link
Contributor

@mem mem commented Jul 10, 2023

When trying to build for ARM (linux/arm), you get:

pkg/remote/client.go:120:35: cannot use 0xffffffff (untyped int constant 4294967295) as int value in argument to fmt.Errorf (overflows) 

Pass the constant as unsigned integer.

Fixes: #131

When trying to build for ARM (linux/arm), you get: ``` pkg/remote/client.go:120:35: cannot use 0xffffffff (untyped int constant 4294967295) as int value in argument to fmt.Errorf (overflows) ``` Pass the constant as unsigned integer. Signed-off-by: Marcelo E. Magallon <marcelo.magallon@grafana.com>
@mem mem requested a review from codebien July 10, 2023 22:31
Comment on lines 119 to +120
return nil, fmt.Errorf("the protobuf message is too large to be handled by Snappy encoder; "+
"size: %d, limit: %d", len(b), 0xffffffff)
"size: %d, limit: %d", len(b), uint(0xffffffff))
Copy link
Contributor

@codebien codebien Jul 11, 2023

Choose a reason for hiding this comment

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

@mem thanks for your contribution 🎉 🙇

It sounds to me the issue is more running on a 32-bit platform than being ARM. Am I missing something?

If my assumption is correct than doing the cast would generate a bad error message because the value is different based on the bit size for the Snappy library.

Something like the following should be more accurate:

maxLen = math.MaxInt32 if bits.UintSize == 64 { maxLen = 0xffffffff } 
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, you are right, nice catch

@mstoykov
Copy link
Contributor

Unfortunately k6 "dropped" 32 bit support a while back grafana/k6#1999 mostly due to lack of anyone using it and there being problems we will likely find only through a lot of usage.

I feel like the problem here is that @mem you compiled for the "wrong" arm variant?

Also the main k6 repo currently outputs:

$ GOARCH=386 go build . # github.com/grafana/xk6-output-prometheus-remote/pkg/remote vendor/github.com/grafana/xk6-output-prometheus-remote/pkg/remote/client.go:120:35: cannot use 0xffffffff (untyped int constant 4294967295) as int value in argument to fmt.Errorf (overflows) # go.k6.io/k6/output/cloud/expv2 output/cloud/expv2/metrics_client.go:89:35: cannot use 0xffffffff (untyped int constant 4294967295) as int value in argument to fmt.Errorf (overflows) # github.com/grafana/xk6-webcrypto/webcrypto vendor/github.com/grafana/xk6-webcrypto/webcrypto/aes.go:592:38: cannot use 549755813632 (untyped int constant) as int value in constant declaration (overflows) 
@mstoykov
Copy link
Contributor

I will close this now.

Please open an issue if this is still needed so we can dicuss it

@mstoykov mstoykov closed this Jul 26, 2023
@mstoykov mstoykov deleted the fix-arm-build branch July 26, 2023 13:26
@codebien codebien mentioned this pull request Jul 31, 2023
@mem mem mentioned this pull request Oct 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
3 participants