💾 Archived View for uscoffings.net › tech › haiku › developing-on-haiku.gmi captured on 2023-03-20 at 18:09:43. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-06-03)

-=-=-=-=-=-=-

Developing on Haiku

[date: 2015-02-10]

This is the first time in a while that I have tried to build one of my projects on Haiku. Here is a quick rundown of my experience.

VM Specs

Downloaded `haiku-nightly-hrev48786-x86_gcc2_hybrid-anyboot.zip`.

Running in a VM hosted on VirtualBox 4.3.20 on FreeBSD 10.1, given 512 MB RAM and 8 GB disk.

Networking

The `AMD` network adapter provided by VirtualBox seems to not work well with Haiku. The networking stack was perpetually stuck trying to acquire a DHCP address. I changed the VirtualBox settings from NAT to bridged mode, but Haiku still could not acquire an IP.

I then changed the network adapter to an `Intel PRO/100 MT Desktop`, and Haiku recognized it flawlessly.

Packages

This build comes with default repos set. There is no need for `pkgman add-repo`.

I installed some build tools:

~> pkgman update
~> pkgman install cmake_x86 ninja_x86 vim

NFS

Mounted my home directory from the hosting machine via NFS:

~> mount_nfs server:/pool/chuck /pool/chuck 1000 1001

Instability

Attempting to build on NFS (so that there is a heavy read and write load on NFS) caused a kernel panic in Haiku. Moving the build directory onto the local (virtual) disk, so that NFS was only handling a read load, avoided the problem. Also, attempting to edit a file inside Haiku, which I had previously edited in the host, resulted in a similar kernel panic. Every time the panic was:

PANIC: dec_vnode_ref_count: called on busy vnode

I recall this same panic from years past. I would love to have the time to familiarize myself with the Haiku kernel.

Building

CMake

~> cmake --version
cmake version 3.0.0

I modified my projects to recognized Haiku like this:

    if("${CMAKE_SYSTEM_NAME}" STREQUAL "Haiku")

gcc

The gcc included with this Haiku is the ancient gcc-2.95. This yields many bogus warnings in C++ code these days. Personally I don't care about the binary-compatibility it offers with the original BeOS.

To use the GCC 4 compiler with CMake, configure like this:

~/build> cmake -DCMAKE_C_COMPILER=gcc-x86 -DCMAKE_CXX_COMPILER=g++-x86 -DCMAKE_BUILD_TYPE=Debug path