-
Notifications
You must be signed in to change notification settings - Fork 79
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
Add support for NetBSD #268
Add support for NetBSD #268
Conversation
The example still has the dependency on golang.org/x/sys. Updates ebitengine#270
@0-wiz-0 I'm trying to finish up this PR so it can be merged but I can't figure out how to install go in the NetBSD environment. Could you look at the |
Thank you for working on this, @TotallyGamerJet !
(Btw, cross-compilation to NetBSD should also work as usual in go.) |
Thanks for the help. I'm getting some weird error when opening the archive. Thoughts?
This PR currently only supports Cgo. Once I get it in a usable state I can work on getting the entirely go version working which would enable cross compiling |
I see:
you can ignore this, it's a bogus warning that will be fixed in 10.1.
Seems we need to add
before the tar command. |
It's definitely there! Why doesn't it see it? |
.github/workflows/test.yml
Outdated
export PATH=$PATH:/usr/local/go/bin/ | ||
|
||
chmod +x .github/scripts/bsd_tests.sh | ||
run: bash .github/scripts/bsd_tests.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this already in a vm? In this case, shouldn't we copy the bsd_test.sh into the vm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The repo is checked out which includes the bsd_tests.sh file. There isn't a need to copy it I don't think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this result indicates the file existence...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the .github folder though in that ls call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok it looks like it's not there at least in FreeBSD
.
..
.cshrc
.k5login
.login
.profile
.sh_history
.shrc
.ssh
go1.20.14.freebsd-amd64.tar.gz
work
./.ssh:
.
..
authorized_keys
config
id_rsa
id_rsa.pub
known_hosts
chmod: .github/scripts/bsd_tests.sh: No such file or directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure but what about $GITHUB_WORKSPACE/.github/scripts/bsd_tests.sh
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
closer now since some of the NetBSD ones passed. FreeBSD still failed tho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, $GITHUB_WORKSPACE
seems empty now...
.github/scripts/bsd_tests.sh
Outdated
@@ -0,0 +1,79 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If bash command is not found, does this work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to use bash, we need to specify the correct path (/usr/bin/bash
or /usr/local/bin/bash
? I don't know...)
|
||
# SPDX-License-Identifier: Apache-2.0 | ||
# SPDX-FileCopyrightText: 2025 The Ebitengine Authors | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add set -e
to abort this script whenever any command fails.
EDIT: Hmm this might work only with Bash.
I'm trying https://github.com/hajimehoshi/purego/tree/pr/268 right now.. |
Maybe we can use regular actions? I don't know... https://github.com/vmactions/netbsd-vm?tab=readme-ov-file#7-custom-shell |
https://github.com/hajimehoshi/purego/actions/runs/13740503731/job/38429163182 Mine worked. Feel free to copy it. diff --git a/.github/scripts/bsd_tests.sh b/.github/scripts/bsd_tests.sh
index 6bbc34b..fb1c51e 100755
--- a/.github/scripts/bsd_tests.sh
+++ b/.github/scripts/bsd_tests.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2025 The Ebitengine Authors
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 6e4b92c..257decf 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -149,7 +149,8 @@ jobs:
run:
shell: bash
steps:
- - uses: actions/checkout@v4
+ - name: Chckout
+ uses: actions/checkout@v4
- name: Run in freebsd
if: matrix.os == 'FreeBSD'
uses: vmactions/freebsd-vm@v1
@@ -159,11 +160,8 @@ jobs:
fetch https://go.dev/dl/go${{matrix.go}}.freebsd-amd64.tar.gz
rm -fr /usr/local/go && tar -C /usr/local -xf go${{matrix.go}}.freebsd-amd64.tar.gz
ln -s /usr/local/go/bin/go /usr/local/bin
- ls -a -R
chmod +x $GITHUB_WORKSPACE/.github/scripts/bsd_tests.sh
- run: |
- ls -a -R
- $GITHUB_WORKSPACE/.github/scripts/bsd_tests.sh
+ run: $GITHUB_WORKSPACE/.github/scripts/bsd_tests.sh
- name: Run in netbsd
# there are no prebuilt download links for these versions of Go for NetBSD
if: matrix.os == 'NetBSD' && !startsWith(matrix.go, '1.18.') && !startsWith(matrix.go, '1.19.') && !startsWith(matrix.go, '1.20.') The points are:
|
Ugh, this might not work well.. I'm investigating now. An experimental version hajimehoshi@fc9e26c passed the test, but hajimehoshi@420b528 doesn't. Why...?? |
https://github.com/hajimehoshi/purego/actions/runs/13740761223/job/38429706509 OK, exporting diff --git a/.github/scripts/bsd_tests.sh b/.github/scripts/bsd_tests.sh
index fb1c51e..1c5b9d2 100755
--- a/.github/scripts/bsd_tests.sh
+++ b/.github/scripts/bsd_tests.sh
@@ -10,6 +10,8 @@
echo "Running tests on $(uname -a) at $PWD"
+PATH=$PATH:/usr/local/go/bin
+
# verify Go is available
go version
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index f660bb2..205c3ab 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -149,7 +149,8 @@ jobs:
run:
shell: bash
steps:
- - uses: actions/checkout@v4
+ - name: Checkout
+ uses: actions/checkout@v4
- name: Run in freebsd
if: matrix.os == 'FreeBSD'
uses: vmactions/freebsd-vm@v1
@@ -158,7 +159,6 @@ jobs:
prepare: |
fetch https://go.dev/dl/go${{matrix.go}}.freebsd-amd64.tar.gz
rm -fr /usr/local/go && tar -C /usr/local -xf go${{matrix.go}}.freebsd-amd64.tar.gz
- ln -s /usr/local/go/bin/go /usr/local/bin
chmod +x $GITHUB_WORKSPACE/.github/scripts/bsd_tests.sh
run: $GITHUB_WORKSPACE/.github/scripts/bsd_tests.sh
- name: Run in netbsd
@@ -172,7 +172,5 @@ jobs:
ftp https://go.dev/dl/go${{matrix.go}}.netbsd-amd64.tar.gz
mkdir /usr/local
rm -fr /usr/local/go && tar -C /usr/local -xf go${{matrix.go}}.netbsd-amd64.tar.gz
- ln -s /usr/local/go/bin/go /usr/local/bin
- export PATH=$PATH:/usr/local/go/bin/
chmod +x $GITHUB_WORKSPACE/.github/scripts/bsd_tests.sh
run: $GITHUB_WORKSPACE/.github/scripts/bsd_tests.sh |
What issue is this addressing?
Close #249
What type of issue is this addressing?
feature
What this PR does | solves
Allows cross/compiling with purego on NetBSD