Jam failure on @release-cd for arm64: ...found 1 target(s)... can't find 1 target(s)

Working on making a Haiku build as an ISO image for installation to standard VM options on macOS (eg, Parallels) running Apple Silicon (arm64/AArch64) for further testing and development.

I’ve gotten to the point where it appears that the system built preliminarily and successfully on macOS. I’ll just outline my steps that got me to the point where jam’s ISO building is failing so others can have context:

brew install git cmake flex bison gawk cdrtools
mkdir -p ~/dev/os/haiku
cd ~/dev/os/haiku

# important due to Haiku's build system needing case sensitivity; create a big sparse image for prolonged use and growability:
hdiutil create -size 100g -fs "Case-sensitive APFS" -type SPARSE -volname HaikuBuild HaikuBuild.sparseimage
hdiutil attach HaikuBuild.sparseimage

# just for convenience in navigation:
ln -s /Volumes/HaikuBuild build
cd build
git clone https://review.haiku-os.org/haiku && git clone https://review.haiku-os.org/buildtools

# just to keep size down; (brew install applesauce):
applesauce compress LZFSE ./
cd ..
hdiutil detach /Volumes/HaikuBuild
hdiutil compact HaikuBuild.sparseimage
hdiutil attach HaikuBuild.sparseimage

# get jam ready early:
cd build/buildtools/jam
make

cd ../../
mkdir -p haiku/generated.arm64
cd haiku/generated.arm64
../configure --cross-tools-source ../../buildtools --build-cross-tools arm64

So at this point I believe it built “okay” and here’s the log of the build if you’d like to review anything:

Now at this point is where I can’t seem to build a CD ISO image:

$ ../../buildtools/jam/jam0 -q -j$(sysctl -n hw.ncpu) @release-cd

Starting build of type regular ...
build-feature packages unavailable on arm64: 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!
AddHaikuImagePackages: package wget not available!
AddHaikuImagePackages: package bzip2 not available!
AddHaikuImagePackages: package ffmpeg6 not available!
AddHaikuImagePackages: package glu not available!
AddHaikuImagePackages: package gutenprint9 not available!
AddHaikuImagePackages: package gzip not available!
AddHaikuImagePackages: package lame not available!
AddHaikuImagePackages: package libedit not available!
AddHaikuImagePackages: package libicns not available!
AddHaikuImagePackages: package mesa not available!
AddHaikuImagePackages: package mesa_devel not available!
AddHaikuImagePackages: package mesa_swpipe not available!
AddHaikuImagePackages: package netcat not available!
AddHaikuImagePackages: package sharutils not available!
AddHaikuImagePackages: package unzip not available!
AddHaikuImagePackages: package which not available!
AddHaikuImagePackages: package zip not available!
AddHaikuImagePackages: package diffutils not available!
AddHaikuImagePackages: package grep not available!
AddHaikuImagePackages: package tar not available!
AddHaikuImagePackages: package tcpdump not available!
AddHaikuImagePackages: package zstd not available!
../src/add-ons/kernel/debugger/disasm/arm64/Jamfile: No such file or directory
../src/bin/debug/ltrace/arch/arm64/Jamfile: No such file or directory
don't know how to make @release-cd
...patience...
...found 1 target(s)...
...can't find 1 target(s)...

Any thoughts on where to go from here to get to an installable CD image?

You can’t use jam0 directly to build Haiku. It is only useful to build the actual jam.

So:

  • run jam0 inside the buildtools/jam directory
  • then use the generated complete jam to build haiku

moreover, the “cd” profile is not supported anymore. You should probably use @release-anyboot instead, this will generate an image that can be booted as a cd, or as an usb disk with both bios and efi systems.

I am not sure that anyboot will work for non-x86 targets (topic is about arm64). @nightly-mmc or @minimum-mmc should be used.

Ah, yes, I missed that, sorry.

The anyboot image may still work? It has an EFI partition so, for EFI booting it should be fine. And there is no special support in the MMC image for Apple Silicon at the moment (I think there is for some other boards which need a specific partition layout).

I see, so this got slightly further, but still a wall…

$ ../../buildtools/jam/bin.macosx/jam -q -j$(sysctl -n hw.ncpu) @release-anyboot                                                                      1 ↵
Starting build of type regular ...
Building Haiku R1/development preview
AddHaikuImagePackages: package bepdf not available!
AddHaikuImagePackages: package keymapswitcher not available!
AddHaikuImagePackages: package mandoc not available!
AddHaikuImagePackages: package noto_sans_cjk_jp not available!
...
1 warning generated.
1 warning generated.

BUILD FAILURE:
...failed updating 1 target(s)...
...skipped 197 target(s)...
...updated 149 target(s)...

And if I utilize @minimum-mmc:

$ ../../buildtools/jam/bin.macosx/jam -q -j$(sysctl -n hw.ncpu) @minimum-mmc
Starting build of type minimum ...
Building Haiku Minimum Target
AddHaikuImagePackages: package openssl3 not available!
build-feature packages unavailable on arm64: 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!
AddHaikuImagePackages: package wget not available!
/Volumes/HaikuBuild/haiku/src/add-ons/kernel/debugger/disasm/arm64/Jamfile: No such file or directory
/Volumes/HaikuBuild/haiku/src/bin/debug/ltrace/arch/arm64/Jamfile: No such file or directory
...patience...
...patience...
...patience...
...patience...
...patience...
...patience...
...found 55676 target(s)...
...updating 8827 target(s)...
InitScript1 haiku.image-init-vars
Link /Users/user/dev/os/haiku/build/haiku/generated.arm64/objects/darwin/lib/libbe_build.so
MkDir1 objects/darwin/release/tools/bfs_shell
...
../headers/private/fs_shell/fssh_defs.h:47:38: note: expanded from macro 'fssh_offsetof'
#define fssh_offsetof(type,member)   __builtin_offsetof(type, member)
                                     ^                        ~~~~~~
ld: warning: search path '/opt/local/lib' not found
Chmod1 objects/darwin/release/tools/fs_shell/fs_shell_command
6 warnings generated.
MergeObjectFromObjects1 objects/darwin/release/tools/fs_shell/fs_shell_kernel.o
Archive objects/darwin/release/tools/fs_shell/fs_shell.a
ar: creating archive objects/darwin/release/tools/fs_shell/fs_shell.a
Ranlib objects/darwin/release/tools/fs_shell/fs_shell.a
Link objects/darwin/release/tools/bfs_shell/bfs_shell
ld: warning: search path '/opt/local/lib' not found
Chmod1 objects/darwin/release/tools/bfs_shell/bfs_shell

BUILD FAILURE:
...failed updating 2 target(s)...
...skipped 17 target(s)...
...updated 74 target(s)...

For thoroughness, @nightly-mmc:

$ ../../buildtools/jam/bin.macosx/jam -q -j$(sysctl -n hw.ncpu) @nightly-mmc

warning: Invalid jamfile cache: Failed to read file info.
Starting build of type regular ...
Building Haiku Nightly
AddHaikuImagePackages: package mandoc not available!
AddHaikuImagePackages: package openssh not available!
AddHaikuImagePackages: package openssl3 not available!
AddHaikuImagePackages: package pe not available!
AddHaikuImagePackages: package vision not available!
AddHaikuImagePackages: package wpa_supplicant not available!
AddHaikuImagePackages: package nano not available!
AddHaikuImagePackages: package p7zip not available!
AddHaikuImagePackages: package xz_utils not available!
WebPositive not available on arm64
build-feature packages unavailable on arm64: 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!
AddHaikuImagePackages: package wget not available!
...
In file included from ../headers/build/os/support/String.h:1:
../headers/build/../os/support/String.h:453:28: warning: cast from 'char *' to 'int32 *' (aka 'int *') increases required alignment from 1 to 4 [-Wcast-align]
        return fPrivateData ? (*(((int32*)fPrivateData) - 1) & 0x7fffffff) : 0;
                                  ^~~~~~~~~~~~~~~~~~~~
1 warning generated.
1 warning generated.

BUILD FAILURE:
...failed updating 1 target(s)...
...skipped 24 target(s)...
...updated 14 target(s)...
  • full jam build output for @nightly-mmc.txt: https://p153.p0.n0.cdn.zight.com/items/o0uAmPol/9cd6c43c-0d26-4cfb-b507-3dfa345ac5ea.txt

(Sorry, Discourse is only allow me two links per post atm.)

You have to dig into the build log abit, but the main error seems to be:

ld: warning: ignoring file '/usr/local/Cellar/zstd/1.5.6/lib/libzstd.1.5.6.dylib': found architecture 'x86_64', required architecture 'arm64'

You have some x86_64 files in your linker path.

Jam also gives you the command line it ran:

gcc -lm -ldl -L/opt/local/lib -L/usr/local/lib -dynamic -dynamiclib -Xlinker -flat_namespace
-o "/Users/user/dev/os/haiku/build/haiku/generated.arm64/objects/darwin/lib/libbe_build.so"
"objects/darwin/release/build/libroot/libroot_build_function_remapper.a" 
"/Users/user/dev/os/haiku/build/haiku/generated.arm64/objects/darwin/lib/libroot_build.so" 
"objects/darwin/release/build/libbe/app/app_kit.o" "objects/darwin/release/build/libbe/icon/icon_kit.o" 
"objects/darwin/release/build/libbe/interface/interface_kit.o" 
"objects/darwin/release/build/libbe/storage/storage_kit.o" 
"objects/darwin/release/build/libbe/support/support_kit.o" 
"objects/darwin/release/build/libshared/libshared_build.a" -lz -lzstd -lgcc_s.1 -lstdc++

This doesn’t include /usr/local/Cellar, so I assume this got included via some environment variable or compiler/linker configuration (unless /opt/local/lib or /usr/local/lib are somehow linking to it?)

The error happens not when building code to run in Haiku, but code for Mac OS that is used as part of the compilation process (we need to run a few of our own tools on the host machine). This means you may be able to reproduce this by trying to write a simple test file that links against zstd, and compile it, outside of Haiku buildsystem.