hiulit / cross-compile-godot-raspberry-pi

A script to easily cross-compile Godot binaries for the Raspberry Pi from Linux x86_64 and an extra script to easily transfer the compiled Godot binaries to the Raspberry Pi using rsync
MIT License
27 stars 5 forks source link

Getting it to work on Alpine Linux #6

Open h0lley opened 1 year ago

h0lley commented 1 year ago

so I've spent a night trying to get the script to do its thing on Alpine Linux, but have to give up at this point. I'll list some findings though.

wget with -show-progress is GNU only, causing wget to be skipped. with the wget on here, the progress is just always shown unless -q is passed.

then, with default $GODOT_TOOLCHAIN_DIR, wget fails as the directory doesn't exist yet. so we need a mkdir -p "$GODOT_TOOLCHAIN_DIR" in prepartion.

according to the script we are supposed to pass the tags from godotengine repo as versions (e.g. 3.5.1-stable). this string is then used in git checkout, but tags and branches do not (no longer?) use the same naming sceme.

xargs with -d and --no-run-if-empty is GNU only. on here, the xargs applying to every line and ignoring empty lines is the default, so those arguments can just be omitted. it's not critical though as it doesn't make the script terminate.

then the more serious issues:

>> Compiling Godot ...
./cross-compile-godot-raspberry-pi.sh: line 621: /home/holly/Desktop/Godot/cross-compile-godot-raspberry-pi/arm-godot-linux-gnueabihf_sdk-buildroot/bin/scons: cannot execute: required file not found

the scons in arm-godot-linux-gnueabihf_sdk-buildroot/bin is a python script, so I think it needs to be passed to python.

however, when doing so I am getting these errors:

pkg_resources.VersionConflict: (SCons 4.4.0 (/usr/lib/python3.10/site-packages), Requirement.parse('SCons==4.1.0'))
pkg_resources.DistributionNotFound: The 'SCons==4.1.0' distribution was not found and is required by the application

also - altough this may very well just be me not being familiar with python - I am confused as to why this line ends on a \: https://github.com/hiulit/cross-compile-godot-raspberry-pi/blob/d1d5049fbedd212dbbd947f778f3eab569eb59e7/cross-compile-godot-raspberry-pi.sh#L617

when I change the SCons==4.1.0 requirement to >=, I am getting the next problem:

/home/holly/Desktop/Godot/cross-compile-godot-raspberry-pi/arm-godot-linux-gnueabihf_sdk-buildroot/bin/pkg-config: exec: line 8: /home/holly/Desktop/Godot/cross-compile-godot-raspberry-pi/arm-godot-linux-gnueabihf_sdk-buildroot/bin/pkgconf: not found
Error: pkg-config not found. Aborting.

this is probably due to Alpine Linux using musl, so instead we can just use the global pkgconf from /usr/bin.

then we are finally entering godot's SConscript where we error with:

gcc: fatal error: '-fuse-linker-plugin', but liblto_plugin.so not found
compilation terminated.

which is where I give up ^^' ultimately I guess the arm-godot-linux-gnueabihf_sdk-buildroot is just not compatible with Alipine Linux / musl.

Burnsedia commented 1 year ago

Alpine Linux does not use the GNU Core utilities; this often causes build errors. I ran into a similar problem, try running in a Ubuntu VM or a container.

hiulit commented 9 months ago

So it won't work? Should we add a disclaimer that this will only work on distros that use GNU core utilities?