Hello,
I’ve tried to compile haiku for PowerPC. However, as
especially gcc_syslibs is still on version 8.3.0 (iirc) and
seems to cause a linking failure, I’ve tried running the
bootstrap process as described in https://www.haiku-os.org/docs/develop/packages/Bootstrapping.html
I’ve tried following it using Debian 12 amd64 as a host and ran:
I’m not sure anyone ran a complete bootstrapping for ppc in the last few years. The command line you listed seems the right one and is supposed to automate everything, but, with the process being a bit fragile and not tested very often, it’s not uncommon to have build breakages there.
I don’t know what causes the error you listed. Maybe with a more detailed listing of earlier problems you got, and how you fixed them, we could have some more ideas of wqat’s wrong.
Hello again,
I’ve got the process running by using a completly clean build environment and using an up-to-date jam version. The cross packages seem to build mostly. I’ve applied the Patches from buildtools to gcc and updated some package versions in the PPC file, I’ll submit that as a PR shortly.
However, currently it seems to fail on
libsolv_bootstrap_source-0.3.0_haiku_2014_12_22-1-source.hpkg does not have a cross-devel package defined!
When commenting out the source package, it errors out with: FetchPackage: package libsolv_source not available!
I’ve attached the failing build log below.
Log
Starting build of type bootstrap ...
Building Haiku Bootstrap
AddHaikuImagePackages: package less not available!
AddHaikuImagePackages: package libedit not available!
AddHaikuImagePackages: package libedit_devel not available!
AddHaikuImagePackages: package icu74 not available!
AddHaikuImagePackages: package libedit not available!
AddHaikuImagePackages: package libedit_devel not available!
build-feature packages unavailable on ppc: giflib glu mesa ffmpeg fluidlite libvorbis fontconfig gutenprint webkit libpng libicns jasper jpeg libedit qrencode_kdl tiff libdvdread libdvdnav libraw libwebp libavif live555 zstd
AddHaikuImagePackages: package bc not available!
AddHaikuImagePackages: package icu74 not available!
Asked for openfirmware target boot platform
Unknown path to handle adding to image
...patience...
...patience...
...patience...
...patience...
...patience...
...patience...
...patience...
...patience...
...found 78125 target(s)...
...updating 5332 target(s)...
InitScript1 haiku.image-init-vars
AddTargetVariableToScript1 <unique!target>_target_481
AddTargetVariableToScript1 <unique!target>_target_581
AddTargetVariableToScript1 <unique!target>_target_681
AddTargetVariableToScript1 <unique!target>_target_781
AddTargetVariableToScript1 <unique!target>_target_881
AddTargetVariableToScript1 <unique!target>_target_981
AddTargetVariableToScript1 <unique!target>_target_091
AddTargetVariableToScript1 <unique!target>_target_191
AddTargetVariableToScript1 <unique!target>_target_291
AddTargetVariableToScript1 <unique!target>_target_391
AddTargetVariableToScript1 <unique!target>_target_491
AddTargetVariableToScript1 <unique!target>_target_591
InitScript1 objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_ppc.hpkg/scripts/haiku.package-init-vars
AddTargetVariableToScript1 <unique!target>_target_841
AddTargetVariableToScript1 <unique!target>_target_941
AddTargetVariableToScript1 <unique!target>_target_051
AddTargetVariableToScript1 <unique!target>_target_151
AddTargetVariableToScript1 <unique!target>_target_251
AddTargetVariableToScript1 <unique!target>_target_351
AddTargetVariableToScript1 <unique!target>_target_451
AddTargetVariableToScript1 <unique!target>_target_551
AddTargetVariableToScript1 <unique!target>_target_651
AddVariableToScript1 objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_ppc.hpkg/scripts/haiku.package-init-vars
InitScript1 objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_ppc.hpkg/scripts/haiku.package-make-dirs
CreateContainerMakeDirectoriesScript1 objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_ppc.hpkg/scripts/haiku.package-make-dirs
InitScript1 objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_ppc.hpkg/scripts/haiku.package-copy-files
InitScript1 objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_stage0_ppc.hpkg/scripts/haiku.package-init-vars
AddTargetVariableToScript1 <unique!target>_target_211
AddTargetVariableToScript1 <unique!target>_target_311
AddTargetVariableToScript1 <unique!target>_target_411
AddTargetVariableToScript1 <unique!target>_target_511
AddTargetVariableToScript1 <unique!target>_target_611
AddTargetVariableToScript1 <unique!target>_target_711
AddTargetVariableToScript1 <unique!target>_target_811
AddTargetVariableToScript1 <unique!target>_target_911
AddTargetVariableToScript1 <unique!target>_target_021
AddVariableToScript1 objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_stage0_ppc.hpkg/scripts/haiku.package-init-vars
InitScript1 objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_stage0_ppc.hpkg/scripts/haiku.package-make-dirs
CreateContainerMakeDirectoriesScript1 objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_stage0_ppc.hpkg/scripts/haiku.package-make-dirs
InitScript1 objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_stage0_ppc.hpkg/scripts/haiku.package-copy-files
AppendToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_stage0_ppc.hpkg>haiku.package-copy-files-dummy-develop/lib
AddDirectoryToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_stage0_ppc.hpkg>develop/headers/config/-/<copy-directory-to-container>../headers/config
AddDirectoryToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_stage0_ppc.hpkg>develop/headers/glibc/-/<copy-directory-to-container>../headers/glibc
AddDirectoryToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_stage0_ppc.hpkg>develop/headers/os/-/<copy-directory-to-container>../headers/os
AddDirectoryToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_stage0_ppc.hpkg>develop/headers/posix/-/<copy-directory-to-container>../headers/posix
AddDirectoryToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_stage0_ppc.hpkg>develop/headers/bsd/-/<copy-directory-to-container>../headers/compatibility/bsd
AddDirectoryToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_stage0_ppc.hpkg>develop/headers/gnu/-/<copy-directory-to-container>../headers/compatibility/gnu
InitScript1 objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_stage0_ppc.hpkg/scripts/haiku.package-extract-files
BuildHaikuPackage1 objects/haiku/ppc/packaging/packages/haiku_cross_devel_sysroot_stage0_ppc.hpkg
haiku_cross_devel_sysroot_stage0_ppc.hpkg: Removing and re-creating package contents dir ...
haiku_cross_devel_sysroot_stage0_ppc.hpkg: Collecting package contents ...
haiku_cross_devel_sysroot_stage0_ppc.hpkg: mimeset'ing package contents ...
haiku_cross_devel_sysroot_stage0_ppc.hpkg: Creating the package ...
AppendToContainerCopyFilesScriptSingleFile <hpkg_-haiku_cross_devel_sysroot_ppc.hpkg>haiku.package-copy-files-dummy-develop/lib-kernel.so
InitScript1 objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_stage1_ppc.hpkg/scripts/haiku.package-init-vars
AddTargetVariableToScript1 <unique!target>_target_031
AddTargetVariableToScript1 <unique!target>_target_131
AddTargetVariableToScript1 <unique!target>_target_231
AddTargetVariableToScript1 <unique!target>_target_331
AddTargetVariableToScript1 <unique!target>_target_431
AddTargetVariableToScript1 <unique!target>_target_531
AddTargetVariableToScript1 <unique!target>_target_631
AddTargetVariableToScript1 <unique!target>_target_731
AddTargetVariableToScript1 <unique!target>_target_831
AddVariableToScript1 objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_stage1_ppc.hpkg/scripts/haiku.package-init-vars
InitScript1 objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_stage1_ppc.hpkg/scripts/haiku.package-make-dirs
CreateContainerMakeDirectoriesScript1 objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_stage1_ppc.hpkg/scripts/haiku.package-make-dirs
InitScript1 objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_stage1_ppc.hpkg/scripts/haiku.package-copy-files
AppendToContainerCopyFilesScriptSingleFile <hpkg_-haiku_cross_devel_sysroot_stage1_ppc.hpkg>haiku.package-copy-files-dummy-develop/lib-kernel.so
AppendToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_stage1_ppc.hpkg>haiku.package-copy-files-dummy-develop/lib
AddDirectoryToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_stage1_ppc.hpkg>develop/headers/config/-/<copy-directory-to-container>../headers/config
AddDirectoryToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_stage1_ppc.hpkg>develop/headers/glibc/-/<copy-directory-to-container>../headers/glibc
AddDirectoryToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_stage1_ppc.hpkg>develop/headers/os/-/<copy-directory-to-container>../headers/os
AddDirectoryToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_stage1_ppc.hpkg>develop/headers/posix/-/<copy-directory-to-container>../headers/posix
AddDirectoryToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_stage1_ppc.hpkg>develop/headers/bsd/-/<copy-directory-to-container>../headers/compatibility/bsd
AddDirectoryToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_stage1_ppc.hpkg>develop/headers/gnu/-/<copy-directory-to-container>../headers/compatibility/gnu
InitScript1 objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_stage1_ppc.hpkg/scripts/haiku.package-extract-files
BuildHaikuPackage1 objects/haiku/ppc/packaging/packages/haiku_cross_devel_sysroot_stage1_ppc.hpkg
haiku_cross_devel_sysroot_stage1_ppc.hpkg: Removing and re-creating package contents dir ...
haiku_cross_devel_sysroot_stage1_ppc.hpkg: Collecting package contents ...
haiku_cross_devel_sysroot_stage1_ppc.hpkg: mimeset'ing package contents ...
haiku_cross_devel_sysroot_stage1_ppc.hpkg: Creating the package ...
AppendToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_ppc.hpkg>haiku.package-copy-files-dummy-develop/lib
AppendToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_ppc.hpkg>haiku.package-copy-files-dummy-data/locale/catalogs/x-vnd.Haiku-libbe
AddDirectoryToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_ppc.hpkg>data/mime_db/-/<mimedb-app->libbe.so_mimedb
AddDirectoryToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_ppc.hpkg>data/mime_db/-/<mimedb-app->libpackage.so_mimedb
AppendToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_ppc.hpkg>haiku.package-copy-files-dummy-data/locale/catalogs/x-vnd.Haiku-libpackage
AddDirectoryToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_ppc.hpkg>develop/headers/config/-/<copy-directory-to-container>../headers/config
AddDirectoryToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_ppc.hpkg>develop/headers/glibc/-/<copy-directory-to-container>../headers/glibc
AddDirectoryToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_ppc.hpkg>develop/headers/os/-/<copy-directory-to-container>../headers/os
AddDirectoryToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_ppc.hpkg>develop/headers/posix/-/<copy-directory-to-container>../headers/posix
AddDirectoryToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_ppc.hpkg>develop/headers/bsd/-/<copy-directory-to-container>../headers/compatibility/bsd
AddDirectoryToContainerCopyFilesScript <hpkg_-haiku_cross_devel_sysroot_ppc.hpkg>develop/headers/gnu/-/<copy-directory-to-container>../headers/compatibility/gnu
InitScript1 objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_ppc.hpkg/scripts/haiku.package-extract-files
BuildHaikuPackage1 objects/haiku/ppc/packaging/packages/haiku_cross_devel_sysroot_ppc.hpkg
haiku_cross_devel_sysroot_ppc.hpkg: Removing and re-creating package contents dir ...
haiku_cross_devel_sysroot_ppc.hpkg: Collecting package contents ...
haiku_cross_devel_sysroot_ppc.hpkg: mimeset'ing package contents ...
haiku_cross_devel_sysroot_ppc.hpkg: Creating the package ...
BootstrapRepositoryFetchPackage1 /media/teamySSD/maite/haikuBuildenv/haiku/generated.ppc/objects/haiku/ppc/packaging/repositories/HaikuPortsCross-build/packages/libsolv_bootstrap_source-0.3.0_haiku_2014_12_22-1-source.hpkg
/media/teamySSD/maite/haikuBuildenv/haiku/generated.ppc/objects/haiku/ppc/packaging/repositories/HaikuPortsCross-build/packages/libsolv_bootstrap_source-0.3.0_haiku_2014_12_22-1-source.hpkg does not have a cross-devel package defined!
package="/media/teamySSD/maite/haikuBuildenv/haiku/generated.ppc/objects/haiku/ppc/packaging/repositories/HaikuPortsCross-build/packages/libsolv_bootstrap_source-0.3.0_haiku_2014_12_22-1-source.hpkg"
if [ -e "$package" ]; then
exit 0
fi
if [ "x$haikuCrossDevelPackage" = "x" ]; then
echo "$package does not have a cross-devel package defined!"
exit 1
fi
if [ "x$haikuCrossDevelPackage" = "x${haikuCrossDevelPackage#/}" ]; then
haikuCrossDevelPackage="`pwd`/$haikuCrossDevelPackage"
fi
secondaryCrossDevelPackages=
if [ -n ]; then
for secondaryCrossDevelPackage in ; do
if [ "x$secondaryCrossDevelPackage" = "x${secondaryCrossDevelPackage#/}" ]; then
secondaryCrossDevelPackage="`pwd`/$secondaryCrossDevelPackage"
fi
if [ -n "$secondaryCrossDevelPackages" ]; then
secondaryCrossDevelPackages="$secondaryCrossDevelPackages,$secondaryCrossDevelPackage"
else
secondaryCrossDevelPackages="--secondary-cross-devel-package=$secondaryCrossDevelPackage"
fi
done
fi
portSpec=`basename "$package" | sed 's@-.*@@'`
cd /media/teamySSD/maite/haikuBuildenv/haiku/generated.ppc/objects/haiku/ppc/packaging/repositories/HaikuPortsCross-build
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/media/teamySSD/maite/haikuBuildenv/haiku/generated.ppc/objects/linux/lib"
if [ -n "$secondaryCrossDevelPackages" ]; then
/media/teamySSD/maite/haikuBuildenv/haiku/generated.ppc/../../haikuporter/haikuporter \
--all-dependencies \
--cross-devel-package "$haikuCrossDevelPackage" \
"$secondaryCrossDevelPackages" $portSpec
else
/media/teamySSD/maite/haikuBuildenv/haiku/generated.ppc/../../haikuporter/haikuporter \
--all-dependencies \
--cross-devel-package "$haikuCrossDevelPackage" $portSpec
fi
if [ ! -e "$package" ]; then
echo "Supposedly built package $package does not exist; version mismatch?"
exit 1
fi
...failed BootstrapRepositoryFetchPackage1 /media/teamySSD/maite/haikuBuildenv/haiku/generated.ppc/objects/haiku/ppc/packaging/repositories/HaikuPortsCross-build/packages/libsolv_bootstrap_source-0.3.0_haiku_2014_12_22-1-source.hpkg ...
BUILD FAILURE:
...failed updating 1 target(s)...
...skipped 8 target(s)...
...updated 88 target(s)...
Honestly, it still kind of feels weird running haikuporter under linux and seeing it actually working.
I’ve tried compiling Haikuports.cross for x86_64 since I’d guess it’s the most updated and it also fails with the same error. Just to be sure that my build environment is sane, could someone else try to compile haikuports.cross? You have to replace some md5 sums and some links have changed, I’ll create a PR with that. I’m also confused about what the cross-devel package is, as the devel packages themselfes are being created.
It’s stopped because it’s broken, not the other way around. There is no point in running builds that we know will fail.
I am confused by a few things in your PR:
You have made changes to several versions of ICU. You only need one (better to start fresh with the latest one, I guess).
You added some $secondaryArchSuffix changes, this is not needed unless you build for x86 32bit and enable both versions of the compiler (gcc2 and gcc13). Maybe let’s ignore that for now and try to get the other architectures working
Whenever you change packages in haikuports.cross, you also need to update them in the corresponding package repositories file definitions on Haiku side (build/jam/repositories/…). If there is a mismatch, some packages will not be found.
I think I have only tried ARM and ARM64 and SPARC somewhat recently. I will see if I can set up a PPC build and see what I find.
About it failing: I tried debugging the build process a bit, it looks like the source packages are also passed to BootstrapRepositoryFetchPackage1 but there are no devel packages that can be found. I’ll also try to learn how jam actually works
I had some cache problems with jam and switched back to an old ICU version. I’ll try to get newer libraries working in cross-devel (libsolv_bootstrap for example is still from 2014).
Is dash usable as a Jam shell? I just used the default debian shell, setting it to bash makes it error out, however that could be because of generated files, I didn’t check yet.
I’ll reorganize the changes again and create multiple separate PRs and do some cleanup in the process aswell.
I’ll check that again, could be that I missed some.
I’m writing some exams in the next 2 weeks and will probably no do as much work on haiku until then, I should really begin learning some stuff.
I had problem using mksh as my shell (not even as the jam shell, just starting the bootstrap process from a mksh session). I recommend using bash as much as possible (unless you want to investigate the releated problems).
In the past (but I think this has since been solved) there were also issues with different Linux distributions (Debian vs OpenSUSE) when building Python. Definitely there is room for a lot of improvements.
Next step was apparently we are trying to bootstrap using Python 2.7, which isn’t available anymore on the host, so we may need to update that to some version of Python 3 instead. I didn’t hit the other problems you have mentioned at the moment. I may continue playing with this this weekend.
After all these changes, I got to a point where I finally hit the same error message you have listed. A bit of investigation shows that the main problem is source packages not being created. This is my fault, it turns out. I modified Haikuporter a while ago to not create source packages by default anymore (changing the default value of the CREATE_SOURCE_PACKAGES setting). The bootstrap process did not set that setting explicitly so it inherited this change. But it does rely on source packages being created. So, since that change, all bootstrap had been broken.
Here’s the diff to Haiku sources, that I will push in a few minutes or hours once I’ve confirmed that fixes the problem:
The next problem was undefined references to functions that should be in libgcc while linking the bootloader. I checked libgcc and indeed the functions are not there.
The haikuports.cross build uses a fixed version of the buildtools, for now I adjusted the patch there (I guess, when this is all working, we can make a new release source archive of the buildtools to avoid having to duplicate these patches).
This means I’m now rebuilding gcc… again (and questioning wether it was a good idea to do this the one weekend when temperatures reach 40º outside). LEt’s see how far we get this time!
And now we’re getting into the interesting part, I think.
I had to remove some “?ppc” from a few recipes in haikuports (why did people mark things as specifically untested on PowerPC? I don’t know). For example in curl, bison, icu, …
Then starts the problem of untangling dependencies that have gotten more and more complex on haikuports side.
Haiku needs freetype (seems pretty reasonable).
Freetype is now built with meson (ok, why not)
meson needs Python (sure, makes sense)
Python needs liblzma (so far so good, we can add that to the bootstrap)
liblzma is part of xz_utils which needs doxygen (ok, to build documentation, makes sense)
doxygen needs Qt5 (because it has a GUI)
Qt5 needs gstreamer and its plugins
Well, now building Haiku depends on Qt5. This is going to be fun.
My main problem now is that gstreamer and its plugin currently depend on cmd:python, which is not provided by anything anymore (python2 is retired). So I will try removing that requirement (keeping only cmd:python3) and see what happens. If someone from haikuports team has a comment about that dependency, your help is welcome.
Now I will let the bootstrap process try to download Qt5 and all its dependencies, which I think is not ideal. We’ll see how far that goes…
This doesn’t make sense to me. Why would one need doxygen if all they want is to provide liblzma dependency, and not to read its documentation? Building doxygen documentation should be optional, and quick check of the xz/PACKAGERS at master · tukaani-project/xz · GitHub shows it indeed is:
Does Haiku specify the --enable-doxygen option somehow? If not, and it’s still required it looks like a bug on the xz-utils side. But I’d rather assume there’s some wrong configuration on our (or Python) side.