Progress on running Haiku on VisionFive 2

I’ve tried three different platforms to build Haiku for VF2. I first tried to build it under StarFive Debian on the VF2. The cross compilation tools built fine but building Haiku didn’t get very far. GCC too old? ext4 causing probs? Lets not bother eh?

Next I tried building it under Debian testing amd64 with gcc 12.2.0 and using btrfs. It got much further but the build fails with the same error that I get when I try to build it under the latest amd64 Haiku nightly:

You need to clone haiku sources from https://review.haiku-os.org and not from Github as the latter doesn’t have tags. Alternatively, you can set it manually.

But Haiku upstream do not support VisionFive 2 yet…

1 Like

It would be best to clone from our Git to get all the tags, then add X512’s GitHub fork as another remote, pull that, then switch to the visionfive2 branch. Or if the haiku repo has already been cloned from GitHub and our build system requires hrev tags the latest one could be added manually with the git tag command.

2 Likes
dan@zbook:~/src$ git clone https://review.haiku-os.org/haiku
Cloning into 'haiku'...
remote: Counting objects: 786276, done
remote: Finding sources: 100% (786276/786276)
remote: Total 786276 (delta 605059), reused 786164 (delta 605059)
Receiving objects: 100% (786276/786276), 399.92 MiB | 28.39 MiB/s, done.
Resolving deltas: 100% (605059/605059), done.
Updating files: 100% (25407/25407), done.
dan@zbook:~/src$ cd haiku
dan@zbook:~/src/haiku$ git remote add vf2 https://github.com/X547/haiku.git
dan@zbook:~/src/haiku$ git remote -v
origin	https://review.haiku-os.org/haiku (fetch)
origin	https://review.haiku-os.org/haiku (push)
vf2	https://github.com/X547/haiku.git (fetch)
vf2	https://github.com/X547/haiku.git (push)
dan@zbook:~/src/haiku$ git checkout visionfive2
error: pathspec 'visionfive2' did not match any file(s) known to git
dan@zbook:~/src/haiku$

I’ve never used gits remote repo feature before so I’m not sure how its supposed to work. I’ve tried running git fetch after adding the remote and before running git checkout or switch with visionfive2 but no joy.

Try git checkout vf2/visionfive2. You need to tell git the remote and branch to check out remote branches.

Here are the build commands I used previously:

git clone https://review.haiku-os.org/buildtools
git clone https://github.com/X547/haiku.git
cd haiku
git checkout visionfive2
mkdir generated.riscv64; cd generated.riscv64
../configure --use-gcc-pipe -j4 --cross-tools-source ../../buildtools --build-cross-tools riscv64
jam -j4 -q @minimum-raw
$ git checkout vf2/visionfive2
error: pathspec 'vf2/visionfive2' did not match any file(s) known to git

git branch -r will show remote branches, make sure that seems sensible and you see the visionfive2 branch in the vf2 remote.

an@zbook:~/src/haiku$ git branch -r
  origin/HEAD -> origin/master
  origin/master
  origin/r1alpha1
  origin/r1alpha2
  origin/r1alpha3
  origin/r1alpha4
  origin/r1beta1
  origin/r1beta2
  origin/r1beta3
  origin/r1beta4

No sign of vf2 according to branch. I must be missing a step?

Set which tag(s) manually? How?

Here’s what I was doing:

git clone https://review.haiku-os.org/buildtools
git clone https://github.com/X547/haiku.git
cd haiku
git checkout visionfive2
mkdir generated.riscv64; cd generated.riscv64
../configure --use-gcc-pipe -j4 --cross-tools-source ../../buildtools --build-cross-tools riscv64
jam -j4 -q @minimum-raw

The only fatal error in your output is thus:

Error: you are using a Haiku clone without tags, please set
the revision tag to use (e.g. HAIKU_REVISION=hrev43210)

…/build/scripts/determine_haiku_revision … build/haiku-revision

…failed DetermineHaikuRevision1 build/haiku-revision …

The easiest way to fix this, as noted by the error is to add HAIKU_REVISION=hrev56998 in the build command. On the note of these hrev numbers, woo, we are close to hrev57000.

As a small history lesson Haiku used to use the Subversion source control system, which had revision numbers to describe the code changes that incremented. When we moved to Git we decided to sort of keep those by using Git tags. Those are easier to talk about and copy and paste than Git’s SHA1 hashes. Unfortunately this is sort of an abuse of Git tags (maybe), in that GitHub certainly doesn’t like dealing with them, so none of these “hrev” tags are on GitHub. This is the extra thing you get when you Git clone from our official Git server. The build system needs this to embed in various things in the build (About Haiku for example.)

Without adding the HAIKU_REVISION= described above you could also just add a Git tag which matches the latest commit in your local repo, using something like git tag -a hrev56998 c10c49daf70c55f73866ee6e901ffb2d4e4ed7df. This is what I was suggesting before I knew that you could add it in your command.

2 Likes

Thanks leavengood

I think I’m getting closer but still no image.

git clone https://review.haiku-os.org/buildtools
git clone https://github.com/X547/haiku.git
cd haiku
git checkout visionfive2
mkdir generated.riscv64; cd generated.riscv64
../configure --use-gcc-pipe -j8 --cross-tools-source ../../buildtools --build-cross-tools riscv64
HAIKU_REVISION=hrev57000 jam -j8 -q @minimum-raw

I don’t know which hrev X512 forked from so I just used hrev57000 - I don’t suppose the hrev matters for a personal test build does it?

stdlib.h is missing now it seems

The output in the gist is not much, you should probably update that and paste in more. But in general probably only X512 can help you with any errors which are specific to the VisionFive 2 port. But at least I got you past the issue with the revision numbers and you now know what those are about.

1 Like

Yes sorry about that. There’s a bug in MATE terminal (libvte actually) that stops select all text working properly, which resulted in my truncated gist. Here’s how it should’ve looked:

Starting from build/jam: update riscv64 package definitions additional packages are added to build and now it it supposed to build nightly profile instead of minimum with jam -q @nightly-raw. It now requires additional HaikuPorts packages built from sources and probably will not build anymore without additional packages. Packages include various tools for building, libpng, ffmpeg etc. for image and video display and more.

6 Likes

You’re saying I’d need to build several Haiku riscv64 packages before I can build Haiku for VF2? If you could document the build process or upload an image that would be much appreciated thanks.

3 Likes

I think I can see which packages its missing in that build log but I’m not sure how I’d cross compile them under Haiku (or Debian) amd64 or under Debian riscv64?

Maybe there are useful clues in this new minimal OS: GitHub - yhzhang0128/egos-2000: A minimal operating system (2K LOC) on QEMU and a RISC-V board

If X512 is unwilling to explain the build process to me then it looks like kallisti5 should be able to tell me what I need to do here.

I’ve found this repo which sounds like exactly what I need but I don’t know how to use it. The README could do with some work.

How do I use this repo in conjuction with the riscv toolchain to build the required packages? If someone can talk me through using this to build one riscv64 hpkg then I should be able to work the rest out.

I have DM’d kallisti5 asking him to explain hpkg cross compilation. I suspect I’ll only be able to cross compile hpkgs from within Haiku x86 but I can live with that.