tests/vm: Make the haiku VM usable again
PATCH 1/1 tests/vm: Make the haiku VM usable again
From: Thomas Huth <[email protected]>
The haiku VM bitrotted in the course of time. Make sure to use the latest version of the repositories here and install missing pieces like "pip" and "tomli" now.
We also have to add a little "hack" to our configure script: For some weird reasons, the meson binary shows up as pyvenv/non-packaged/bin/meson here, and not in the expected location pyvenv/bin/meson. Use a symlink to fix it.
For this new version, we also have to compile with "-pie", otherwise the linker complains about bad relocations in the object files, so allow compiling with PIE in the configure script now.
--- configure | 8 +++++++- tests/vm/haiku.x86_64 | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-)
configure +7 -1
@@ -967,6 +967,12 @@ mkvenv="$python ${source_path}/python/scripts/mkvenv.py" $mkvenv ensuregroup --dir "${source_path}/python/wheels" \ ${source_path}/pythondeps.toml meson || exit 1 +# For some unknown reason, the meson binary shows up in the wrong +# folder on Haiku. Use a symlink to fix it. +if test "$host_os" = "haiku" && test ! -e pyvenv/bin/meson ; then + ln -s "$PWD"/pyvenv/non-packaged/bin/meson pyvenv/bin/meson +fi + # At this point, we expect Meson to be installed and available. # We expect mkvenv or pip to have created pyvenv/bin/meson for us. # We ignore PATH completely here: we want to use the venv's Meson
@@ -1068,7 +1074,7 @@ static THREAD int tls_var; int main(void) { return tls_var; } EOF -if test "$host_os" = windows || test "$host_os" = haiku; then +if test "$host_os" = windows ; then if test "$pie" = "yes"; then error_exit "PIE not available due to missing OS support" fi
tests/vm/haiku.x86_64 +4 -0
@@ -78,6 +78,8 @@ class HaikuVM(basevm.BaseVM): "devel:libusb_1.0", "devel:libz", "ninja", + "pip", + "tomli_python310", ] BUILD_SCRIPT = """
@@ -109,6 +111,8 @@ class HaikuVM(basevm.BaseVM): self.wait_ssh(wait_root=True, cmd="exit 0") # Install packages + self.ssh_root("echo yes | pkgman add-repo https://eu.hpkg.haiku-os.org/haiku/r1beta5/$(getarch)/current") + self.ssh_root("echo yes | pkgman add-repo https://eu.hpkg.haiku-os.org/haikuports/r1beta5/$(getarch)/current") self.ssh_root("pkgman install -y %s" % " ".join(self.requirements)) self.graceful_shutdown()
Signature · 1 line
2.52.0
Quoted 8 lines · Thomas Huth
The haiku VM bitrotted in the course of time. Make sure to use the latest version of the repositories here and install missing pieces like "pip" and "tomli" now.
We also have to add a little "hack" to our configure script: For some weird reasons, the meson binary shows up as pyvenv/non-packaged/bin/meson here, and not in the expected location pyvenv/bin/meson. Use a symlink to fix it.
-> https://github.com/haiku/haiku/blob/master/docs/user/storage/storageintro.dox
* Packages not available in the HPKG format are installed under the "/non-packaged/" directory, it seems.
Quoted 50 lines
For this new version, we also have to compile with "-pie", otherwise the linker complains about bad relocations in the object files, so allow compiling with PIE in the configure script now.
Signed-off-by Thomas Huth <[email protected]>--- configure | 8 +++++++- tests/vm/haiku.x86_64 | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-)configure +7
-1@@ -967,6 +967,12 @@ mkvenv="$python ${source_path}/python/scripts/mkvenv.py" $mkvenv ensuregroup --dir "${source_path}/python/wheels" \ ${source_path}/pythondeps.toml meson || exit 1 +# For some unknown reason, the meson binary shows up in the wrong +# folder on Haiku. Use a symlink to fix it. +if test "$host_os" = "haiku" && test ! -e pyvenv/bin/meson ; then + ln -s "$PWD"/pyvenv/non-packaged/bin/meson pyvenv/bin/meson +fi + # At this point, we expect Meson to be installed and available. # We expect mkvenv or pip to have created pyvenv/bin/meson for us. # We ignore PATH completely here: we want to use the venv's Meson@@ -1068,7 +1074,7 @@ static THREAD int tls_var; int main(void) { return tls_var; } EOF -if test "$host_os" = windows || test "$host_os" = haiku; then +if test "$host_os" = windows ; then if test "$pie" = "yes"; then error_exit "PIE not available due to missing OS support" fitests/vm/haiku.x86_64 +2
-0@@ -78,6 +78,8 @@ class HaikuVM(basevm.BaseVM): "devel:libusb_1.0", "devel:libz", "ninja", + "pip", + "tomli_python310", ] BUILD_SCRIPT = """
tests/vm/haiku.x86_64 class HaikuVM(basevm.BaseVM):
Quoted 9 lines
tests/vm/haiku.x86_64 +2
-1@@ -109,6 +111,8 @@ class HaikuVM(basevm.BaseVM): self.wait_ssh(wait_root=True, cmd="exit 0") # Install packages + self.ssh_root("echo yes | pkgman add-repo https://eu.hpkg.haiku-os.org/haiku/r1beta5/$(getarch)/current") + self.ssh_root("echo yes | pkgman add-repo https://eu.hpkg.haiku-os.org/haikuports/r1beta5/$(getarch)/current") self.ssh_root("pkgman install -y %s" % " ".join(self.requirements)) self.graceful_shutdown() --
* Instead of creating a symlink for meson, could we add '/non-packaged/' directory to an appropriate PATH variable, so that all such binaries are accessible from 'non-packaged/bin/' directory? That way we avoid creating symlinks for many /non-packaged/ binaries.
* Otherwise change looks okay.
Thank you.
---
- Prasad
Quoted 10 lines · Prasad Pandit
Quoted 8 lines · Thomas Huth
The haiku VM bitrotted in the course of time. Make sure to use the latest version of the repositories here and install missing pieces like "pip" and "tomli" now.
We also have to add a little "hack" to our configure script: For some weird reasons, the meson binary shows up as pyvenv/non-packaged/bin/meson here, and not in the expected location pyvenv/bin/meson. Use a symlink to fix it.
Quoted 4 lines
-> https://github.com/haiku/haiku/blob/master/docs/user/storage/storageintro.dox* Packages not available in the HPKG format are installed under the "/non-packaged/" directory, it seems.
Ah, great, that could be the reason, indeed! Thanks for the pointer, I somehow did not manage to to find this though tried to search the internet for "non-packaged" ...
I'll add that information to v2 of the patch.
Quoted 24 lines
Quoted 24 lines
For this new version, we also have to compile with "-pie", otherwise the linker complains about bad relocations in the object files, so allow compiling with PIE in the configure script now.
Signed-off-by Thomas Huth <[email protected]>--- configure | 8 +++++++- tests/vm/haiku.x86_64 | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-)configure +6
-0@@ -967,6 +967,12 @@ mkvenv="$python ${source_path}/python/scripts/mkvenv.py" $mkvenv ensuregroup --dir "${source_path}/python/wheels" \ ${source_path}/pythondeps.toml meson || exit 1 +# For some unknown reason, the meson binary shows up in the wrong +# folder on Haiku. Use a symlink to fix it. +if test "$host_os" = "haiku" && test ! -e pyvenv/bin/meson ; then + ln -s "$PWD"/pyvenv/non-packaged/bin/meson pyvenv/bin/meson +fi +
...
Quoted 4 lines
* Instead of creating a symlink for meson, could we add '/non-packaged/' directory to an appropriate PATH variable, so that all such binaries are accessible from 'non-packaged/bin/' directory? That way we avoid creating symlinks for many /non-packaged/ binaries.
The problem is that our "configure" script explicitly expects the meson binary in this location and does *not* use the meson from $PATH. We also have hard-coded this in a couple of other spots (see "grep -r bin/meson *") ... so I think using a symlink is still the easiest solution?
Quoted 2 lines
* Otherwise change looks okay.
Reviewed-by Prasad Pandit <[email protected]>
Thanks!
Thomas