ravynsoft / ravynos

A BSD-based OS project that aims to provide source and binary compatibility with macOS® and a similar user experience.
https://www.ravynos.com
Other
5.68k stars 192 forks source link

Cannot buildworld #390

Closed elgithubo closed 11 months ago

elgithubo commented 1 year ago

When trying to build in a bhyve vm, building and installing the kernel works fine. buildworkd fails with the following error:

===> cddl/lib/libzpool (install)
install -U  -C -o root -g wheel -m 444   libzpool.a /usr/obj/root/git/ravynos/amd64.amd64/tmp/usr/lib/
install -U  -s -o root -g wheel -m 444   -S  libzpool.so.2 /usr/obj/root/git/ravynos/amd64.amd64/tmp/lib/
install -U  -o root -g wheel -m 444    libzpool.so.2.debug /usr/obj/root/git/ravynos/amd64.amd64/tmp/usr/lib/debug/lib/
install -U -l rs -o root -g wheel -m 755 -S   /usr/obj/root/git/ravynos/amd64.amd64/tmp/lib/libzpool.so.2 /usr/obj/root/git/ravynos/amd64.amd64/tmp/usr/lib/libzpool.so
===> cddl/lib/libzutil (install)
install -U  -C -o root -g wheel -m 444   libzutil.a /usr/obj/root/git/ravynos/amd64.amd64/tmp/usr/lib/
install -U  -s -o root -g wheel -m 444   -S  libzutil.so.2 /usr/obj/root/git/ravynos/amd64.amd64/tmp/lib/
install -U  -o root -g wheel -m 444    libzutil.so.2.debug /usr/obj/root/git/ravynos/amd64.amd64/tmp/usr/lib/debug/lib/
install -U -l rs -o root -g wheel -m 755 -S   /usr/obj/root/git/ravynos/amd64.amd64/tmp/lib/libzutil.so.2 /usr/obj/root/git/ravynos/amd64.amd64/tmp/usr/lib/libzutil.so
install -U  -C -o root -g wheel -m 444  /root/git/ravynos/sys/contrib/openzfs/lib/libzutil/zutil_import.h /usr/obj/root/git/ravynos/amd64.amd64/tmp/usr/include/
===> cddl/lib/pam_zfs_key (install)
install -U  -s -o root -g wheel -m 444   -S  pam_zfs_key.so.6 /usr/obj/root/git/ravynos/amd64.amd64/tmp/usr/lib/
install -U  -o root -g wheel -m 444    pam_zfs_key.so.6.debug /usr/obj/root/git/ravynos/amd64.amd64/tmp/usr/lib/debug/usr/lib/
install -U -l rs -o root -g wheel -m 755 -S  /usr/obj/root/git/ravynos/amd64.amd64/tmp/usr/lib/pam_zfs_key.so.6  /usr/obj/root/git/ravynos/amd64.amd64/tmp/usr/lib/pam_zfs_key.so
===> gnu/lib (obj,all,install)
===> gnu/lib/libobjc2 (all)
mkdir -p /usr/obj/root/git/ravynos/amd64.amd64/gnu/lib/libobjc2/root/git/ravynos/gnu/lib/libobjc2
cd /usr/obj/root/git/ravynos/amd64.amd64/gnu/lib/libobjc2/root/git/ravynos/gnu/lib/libobjc2; cmake  -DCMAKE_C_FLAGS="-D__RAVYNOS__ -DNO_SELECTOR_MISMATCH_WARNINGS"  -DCMAKE_BUILD_TYPE=Debug  -DCMAKE_INSTALL_PREFIX=/usr  -DOLDABI_COMPAT=false -DLEGACY_COMPAT=false  -S /root/git/ravynos/gnu/lib/libobjc2
/bin/sh: cmake: not found
*** Error code 127

Stop.
make[5]: stopped in /root/git/ravynos/gnu/lib/libobjc2
*** Error code 1

Stop.
make[4]: stopped in /root/git/ravynos/gnu/lib
*** Error code 1

Stop.
make[3]: stopped in /root/git/ravynos
*** Error code 1

Stop.
make[2]: stopped in /root/git/ravynos
      858.63 real       751.59 user       106.51 sys
*** Error code 1

Stop.
make[1]: stopped in /root/git/ravynos
*** Error code 1

Stop.
make: stopped in /root/git/ravynos
root@ravynos:~/git/ravynos # 

cmake is installed

root@ravynos:~/git/ravynos # which cmake
/usr/local/bin/cmake
root@ravynos:~/git/ravynos # 
elgithubo commented 1 year ago

Any idea?

mszoek commented 1 year ago

Are you building that on FreeBSD or on ravynOS? Building on FreeBSD or with FreeBSD ports/packages will NOT work.

elgithubo commented 1 year ago

Good morning @mszoek

Thank you for your reply.

I assume I had all required build time dependencies installed on FreeBSD since 'make buildkernel' and 'make installkernel' worked like a charm, also after reboot. Therefore I am trying to build world in a hybrid (ravynOS kernel / FreeBSD userland) bhyve VM. I will try building HEAD again on an AWS VM to see if the behavior has improved.

Kind regards, Engel

mszoek commented 1 year ago

Hi!

I assume I had all required build time dependencies installed on FreeBSD since 'make buildkernel' and 'make installkernel' worked like a charm, also after reboot. Therefore I am trying to build world in a hybrid (ravynOS kernel / FreeBSD userland) bhyve VM. I will try building HEAD again on an AWS VM to see if the behavior has improved.

You'll need the ravynOS userland to build everything. There are 3 phases to the build:

The kernel has minimal dependencies. Userland needs some additional packages like cmake to build libobjc2 and also needs libmach, migcom, and other pieces from the ravynOS system to be installed. It should build our toolchain (a modified clang) as part of world. The frameworks also need the full ravynOS runtime and toolchain installed in order to build - regular FreeBSD clang doesn't understand the concept of bundles or the "-framework" option. Building the frameworks and apps also needs a bunch of additional libraries like libpng, ghostscript, libjpeg, wayland-protocols, etc. You'll also need /usr/share/mk/rvn.*.mk, make.conf from the source tree, and some other config bits.

elgithubo commented 1 year ago

Ok I guess the following should work:

  1. Setup FreeBSD HEAD in a bhyve VM (on FreeBSD HEAD).
  2. Build ravynOS kernel in the VM and reboot.
  3. Mount latest ravynOS ISO (e.g. to /mnt) in the VM.
  4. Alias the required commands (e.g. cmake) in the VM to the /mnt/** equivalents (check if aliases are exported).
  5. Compile the ravynOS userland (world) LD_PRELOAD'in the required libs from /mnt/** in the VM.

What do you think?

RangerRick commented 1 year ago

FYI, it doesn't necessarily map perfectly 1:1, but the bootstrapping arm64 page is mostly arch-agnostic and might be a good reference to try to figure out how to fresh bootstrap from FreeBSD.

elgithubo commented 1 year ago

Thank you for the very helpful link. Unfortunately I will have to wait for AWS to sort out their SSH and pwd logon problem to FreeBSD cloud images before I can continue. My Azure VMs work but I ignore them as long as they have Tux as logo for FreeBSD in the Azure app.

mszoek commented 1 year ago

My Azure VMs work but I ignore them as long as they have Tux as logo for FreeBSD in the Azure app.

Oh that's just wrong