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

[Go] Fails to build on 32-bit platforms #35133

Closed
srebhan opened this issue Apr 14, 2023 · 2 comments · Fixed by #35159
Closed

[Go] Fails to build on 32-bit platforms #35133

srebhan opened this issue Apr 14, 2023 · 2 comments · Fixed by #35159
Assignees
Milestone

Comments

@srebhan
Copy link
Contributor

srebhan commented Apr 14, 2023

Describe the bug, including details regarding any error messages, version, and platform.

The current code fails to build on 32-bit platforms (at least on armel, armhf, mips, mipsel, linux-386 and windows-386) with the following error

github.com/apache/arrow/go/v12/arrow/array
/go/pkg/mod/github.com/apache/arrow/go/v12@v12.0.0-20230414125938-59fe4ce90e2f/arrow/array/dictionary.go:1564:22: math.MaxUint32 (untyped int constant 4294967295) overflows int

Component(s)

Go

@raulcd
Copy link
Member

raulcd commented Apr 17, 2023

@zeroshade should this bug fix be added to 12.0.0?

@zeroshade
Copy link
Member

probably a good idea, otherwise we'd likely have to patch it in. I'll set the milestone and merge it

@zeroshade zeroshade added this to the 12.0.0 milestone Apr 17, 2023
zeroshade pushed a commit that referenced this issue Apr 17, 2023
… arch (#35159)

### Rationale for this change

When compiling on i386 arch, an error like `math.MaxUint32 (untyped int constant 4294967295) overflows int` will appear. The Int type is 32-bit and in 32-bit arch it overflows. In my PR, I cast `int` to `unint` to avoid this error.

* Closes: #35133

Authored-by: sunpeng <sunpeng.dev@gmail.com>
Signed-off-by: Matt Topol <zotthewizard@gmail.com>
raulcd pushed a commit that referenced this issue Apr 19, 2023
… arch (#35159)

### Rationale for this change

When compiling on i386 arch, an error like `math.MaxUint32 (untyped int constant 4294967295) overflows int` will appear. The Int type is 32-bit and in 32-bit arch it overflows. In my PR, I cast `int` to `unint` to avoid this error.

* Closes: #35133

Authored-by: sunpeng <sunpeng.dev@gmail.com>
Signed-off-by: Matt Topol <zotthewizard@gmail.com>
liujiacheng777 pushed a commit to LoongArch-Python/arrow that referenced this issue May 11, 2023
…32-bit arch (apache#35159)

### Rationale for this change

When compiling on i386 arch, an error like `math.MaxUint32 (untyped int constant 4294967295) overflows int` will appear. The Int type is 32-bit and in 32-bit arch it overflows. In my PR, I cast `int` to `unint` to avoid this error.

* Closes: apache#35133

Authored-by: sunpeng <sunpeng.dev@gmail.com>
Signed-off-by: Matt Topol <zotthewizard@gmail.com>
ArgusLi pushed a commit to Bit-Quill/arrow that referenced this issue May 15, 2023
…32-bit arch (apache#35159)

### Rationale for this change

When compiling on i386 arch, an error like `math.MaxUint32 (untyped int constant 4294967295) overflows int` will appear. The Int type is 32-bit and in 32-bit arch it overflows. In my PR, I cast `int` to `unint` to avoid this error.

* Closes: apache#35133

Authored-by: sunpeng <sunpeng.dev@gmail.com>
Signed-off-by: Matt Topol <zotthewizard@gmail.com>
rtpsw pushed a commit to rtpsw/arrow that referenced this issue May 16, 2023
…32-bit arch (apache#35159)

### Rationale for this change

When compiling on i386 arch, an error like `math.MaxUint32 (untyped int constant 4294967295) overflows int` will appear. The Int type is 32-bit and in 32-bit arch it overflows. In my PR, I cast `int` to `unint` to avoid this error.

* Closes: apache#35133

Authored-by: sunpeng <sunpeng.dev@gmail.com>
Signed-off-by: Matt Topol <zotthewizard@gmail.com>
zeroshade added a commit that referenced this issue Jun 14, 2023
### Rationale for this change
It looks like #35133 only addressed 32-bit build failures in the Arrow library but didn't address the Parquet library failing to build on 32-bit systems. So this fixes building the Go Parquet library for GOARCH=386

### What changes are included in this PR?
Simplify and clean up build tags and specialized asm in Go Parquet library so that we don't need to keep adding new files explicitly for architectures that we didn't generate optimized assembly for. So we set up the appropriate defaults so that those architectures will default to the pure go implementation properly.

Also fixes the usage of `math.Uint32` so that it isn't seen as an untyped int constant which would overflow on 32-bit architectures.

### Are these changes tested?
Yes, added a small workflow that builds the Go arrow and parquet libraries with `GOARCH=386`.

* Closes: #36052

Authored-by: Matt Topol <zotthewizard@gmail.com>
Signed-off-by: Matt Topol <zotthewizard@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment