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

Fails to build Go project for Windows x86 #34784

Closed
abemedia opened this issue Mar 30, 2023 · 3 comments · Fixed by #35767
Closed

Fails to build Go project for Windows x86 #34784

abemedia opened this issue Mar 30, 2023 · 3 comments · Fixed by #35767
Assignees
Milestone

Comments

@abemedia
Copy link

abemedia commented Mar 30, 2023

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

When compiling a Go project using github.com/apache/arrow/go/v10 v10.0.1 on Go 1.19.3 windows/amd64 with GOOS=windows and GOARCH=386 I get the following errors:

failed to build for windows_386: exit status 2: # github.com/apache/arrow/go/v10/internal/utils
..\..\..\go\pkg\mod\github.com\apache\arrow\go\v10@v10.0.1\internal\utils\transpose_ints_def.go:76:4: undefined: TransposeInt8Int8
..\..\..\go\pkg\mod\github.com\apache\arrow\go\v10@v10.0.1\internal\utils\transpose_ints_def.go:78:4: undefined: TransposeInt8Int16
..\..\..\go\pkg\mod\github.com\apache\arrow\go\v10@v10.0.1\internal\utils\transpose_ints_def.go:80:4: undefined: TransposeInt8Int32
..\..\..\go\pkg\mod\github.com\apache\arrow\go\v10@v10.0.1\internal\utils\transpose_ints_def.go:82:4: undefined: TransposeInt8Int64
..\..\..\go\pkg\mod\github.com\apache\arrow\go\v10@v10.0.1\internal\utils\transpose_ints_def.go:84:4: undefined: TransposeInt8Uint8
..\..\..\go\pkg\mod\github.com\apache\arrow\go\v10@v10.0.1\internal\utils\transpose_ints_def.go:86:4: undefined: TransposeInt8Uint16
..\..\..\go\pkg\mod\github.com\apache\arrow\go\v10@v10.0.1\internal\utils\transpose_ints_def.go:88:4: undefined: TransposeInt8Uint32
..\..\..\go\pkg\mod\github.com\apache\arrow\go\v10@v10.0.1\internal\utils\transpose_ints_def.go:90:4: undefined: TransposeInt8Uint64
..\..\..\go\pkg\mod\github.com\apache\arrow\go\v10@v10.0.1\internal\utils\transpose_ints_def.go:95:4: undefined: TransposeInt16Int8
..\..\..\go\pkg\mod\github.com\apache\arrow\go\v10@v10.0.1\internal\utils\transpose_ints_def.go:97:4: undefined: TransposeInt16Int16
..\..\..\go\pkg\mod\github.com\apache\arrow\go\v10@v10.0.1\internal\utils\transpose_ints_def.go:97:4: too many errors

I tried using the build tag noasm but then I get the following error:

failed to build for windows_386: exit status 2: # github.com/apache/arrow/go/v10/arrow/array
..\..\..\go\pkg\mod\github.com\apache\arrow\go\v10@v10.0.1\arrow\array\dictionary.go:1499:22: math.MaxUint32 (untyped int constant 4294967295) overflows int

Component(s)

Go

@zeroshade
Copy link
Member

This should be addressed and fixed with #34647 can you upgrade to v12@latest and give it a try to confirm? Assuming that fixes this too, the fix would go out with the v12 release in a few weeks

@maxcoulombe
Copy link

maxcoulombe commented May 25, 2023

Hi, we tried using go/v12.0.0 as suggested and it does fix the undefined errors, but we still get the overflow error mentioned in the original issue description:

Error: ../../../go/pkg/mod/github.com/apache/arrow/go/v12@v12.0.0/arrow/compute/internal/exec/utils.go:247:18: cannot use math.MaxInt64 (untyped int constant 9223372036854775807) as int value in assignment (overflows)

Any workaround or fix in progress?

@zeroshade
Copy link
Member

@maxcoulombe I've put a fix up via PR, as we are looking at releasing a v12.0.1 patch release, I'll see if I can get the fix into that release.

zeroshade added a commit that referenced this issue May 26, 2023
### Rationale for this change
Two locations in the code cause issues when building with `GOARCH=386` (e.g. 32-bit systems).

### What changes are included in this PR?
In the `compute` package we assume a 64-bit system when using an untyped `int` to hold `math.MaxInt64` which overflows on a 32-bit system. So we just explicitly identify it as an `int64`

In the `cdata` package we use the older `*(*[maxlen]*C.void)(unsafe.Pointer(.....))[:]` syntax to retrieve the `void**` for the buffers, with maxlen set to a very large constant. Unfortunately on a 32-bit system this is larger than the address space. Instead we switch to using the `unsafe.Slice` method that was added in go1.17.

* Closes: #34784

Authored-by: Matt Topol <zotthewizard@gmail.com>
Signed-off-by: Matt Topol <zotthewizard@gmail.com>
@zeroshade zeroshade added this to the 12.0.1 milestone May 26, 2023
raulcd pushed a commit that referenced this issue May 30, 2023
### Rationale for this change
Two locations in the code cause issues when building with `GOARCH=386` (e.g. 32-bit systems).

### What changes are included in this PR?
In the `compute` package we assume a 64-bit system when using an untyped `int` to hold `math.MaxInt64` which overflows on a 32-bit system. So we just explicitly identify it as an `int64`

In the `cdata` package we use the older `*(*[maxlen]*C.void)(unsafe.Pointer(.....))[:]` syntax to retrieve the `void**` for the buffers, with maxlen set to a very large constant. Unfortunately on a 32-bit system this is larger than the address space. Instead we switch to using the `unsafe.Slice` method that was added in go1.17.

* Closes: #34784

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants