Skip to content

Comments

GH-34629: [Go] Fix transpose_ints to work on riscv64-freebsd#34647

Merged
zeroshade merged 2 commits intoapache:mainfrom
zeroshade:riscv64-freebsd-go
Mar 22, 2023
Merged

GH-34629: [Go] Fix transpose_ints to work on riscv64-freebsd#34647
zeroshade merged 2 commits intoapache:mainfrom
zeroshade:riscv64-freebsd-go

Conversation

@zeroshade
Copy link
Member

@zeroshade zeroshade commented Mar 20, 2023

Rationale for this change

Protecting the Go arrow packages from failing on new architectures by ensuring the pure go implementation gets loaded for any architecture that isn't one of the explicit ones we have assembly for.

What changes are included in this PR?

changing the go build constraint

@github-actions
Copy link

@zeroshade
Copy link
Member Author

@clausecker Please try building this branch. I've only tested using go1.20 and GOOS=freebsd GOARCH=riscv64 go build as I don't have access to a riscv64 system. But with that I was able to reproduce the failing build you showed in the issue, and then use this fix to make it build successfully.

@clausecker
Copy link

Thanks, will check. Is there are test suite or something I can run?

@zeroshade
Copy link
Member Author

there are unit tests you can run via go test. You could also try running ci/scripts/go_test.sh if you like.

@clausecker
Copy link

Package internal now builds. Others do not, largely because you depend on modernc.org/sqlite which is not available for this architecture. A go test ./internal/... yielded:

# github.com/apache/arrow/go/v12/internal/utils
internal/utils/transpose_ints_noasm.go:20:1: invalid non-alphanumeric build constraint: ||
internal/utils/transpose_ints_noasm.go:20:1: invalid non-alphanumeric build constraint: (!amd64
internal/utils/transpose_ints_noasm.go:20:1: invalid non-alphanumeric build constraint: &&
internal/utils/transpose_ints_noasm.go:20:1: invalid non-alphanumeric build constraint: &&
internal/utils/transpose_ints_noasm.go:20:1: invalid non-alphanumeric build constraint: &&
internal/utils/transpose_ints_noasm.go:20:1: invalid non-alphanumeric build constraint: !ppc64le)

which is something you might want to look into, too.

Thank you for the fixes!

@zeroshade
Copy link
Member Author

Thankfully modernc.org/sqlite is only used for the flight sql example package, so likely shouldn't affect most consumers.

For the issue with non-alphanumeric build constraints what version of Go were you using there? Since we intend for building against older versions of Go too, i'm guessing I need to modify the +build constraint since the syntax using || and && in the build constraints was added in go 1.16 i think....

@clausecker
Copy link

I am building with go 1.20, which is the most recent version. I haven't checked the source in detail. It is possible to use both types of build constraints at the same time and go fix (I think) should fix the code to have both in there if I recall correctly.

@zeroshade
Copy link
Member Author

@clausecker I ran go fix on the whole directory there, can you try again and confirm you don't get that invalid build constraint error anymore?

@clausecker
Copy link

I can confirm.

@zeroshade zeroshade merged commit ce0d20c into apache:main Mar 22, 2023
@zeroshade zeroshade deleted the riscv64-freebsd-go branch March 22, 2023 16:58
@ursabot
Copy link

ursabot commented Mar 22, 2023

Benchmark runs are scheduled for baseline = 532b9a5 and contender = ce0d20c. ce0d20c is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Finished ⬇️0.39% ⬆️0.03%] test-mac-arm
[Finished ⬇️0.0% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.35% ⬆️0.0%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] ce0d20c0 ec2-t3-xlarge-us-east-2
[Finished] ce0d20c0 test-mac-arm
[Finished] ce0d20c0 ursa-i9-9960x
[Finished] ce0d20c0 ursa-thinkcentre-m75q
[Finished] 532b9a57 ec2-t3-xlarge-us-east-2
[Finished] 532b9a57 test-mac-arm
[Finished] 532b9a57 ursa-i9-9960x
[Finished] 532b9a57 ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

ArgusLi pushed a commit to Bit-Quill/arrow that referenced this pull request May 15, 2023
…pache#34647)

### Rationale for this change
Protecting the Go arrow packages from failing on new architectures by ensuring the pure go implementation gets loaded for any architecture that isn't one of the explicit ones we have assembly for.

### What changes are included in this PR?
changing the go build constraint

* Closes: apache#34629

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Go] Doesn't build on riscv64-freebsd

3 participants