-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linuxmusl arm64 #73
Linuxmusl arm64 #73
Conversation
changed the arm builds to run under their own docker image. Also use buildx to run it on any platform and integrate the build script directly in the image build process.
now fully working
Thanks for the PR, I'd prefer that all the platforms/OSs provide the same set of dependencies, so we'll need to include librsvg. Does this relate to the - .libs/librsvg-2.lax/librsvg_c_api.a//deps/svg/./.libs/librsvg_c_api.a
+ .libs/librsvg-2.lax/librsvg_c_api.a/ /deps/svg/./.libs/librsvg_c_api.a |
Switched to use the standard name linuxmusl-arm64v8 (note the v8 at the end) and made alias for linuxmusl-arm64 Also adjusted your GitHub build action. But as for the librsvg the problem is that it is just already included by other package like probably mango, so it is already available. So the dependencies are the same, but in linuxmusl somehow librsvg is already included. The compilation seems to go all fine now. At the end is reported:
Wasn't sure about the missing so, files but I think it is ok as those should be available system wide. |
This script needs to build librsvg as a static library and cannot rely on a shared library provided via package manager. Without it I suspect libvips is being built without support for SVG input. Do you have an example build log (e.g. GitHub Actions) you could share to verify this? |
Here are two build logs, with and without librsvg. Second one fails. Hope you can spot the difference and have an idea for solution. linuxmusl-arm64v8_no_librsvg.log |
The first log file includes the following lines that state libvips was built without support for librsvg:
Please can you update this PR to include librsvg, even if there is an error, and we try to can work back from there. |
done it should build now with librsvg as it used to be. Maybe this will go just fine in the building actions as they are running on new instances. I would suggest to eventually switch to docker buildx building as GitHub Actions, as it is much cleaner, like what is suggested for sqllite3: TryGhost/node-sqlite3#1362 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please can this be adapted to cross-compile for the aarch64-unknown-linux-musl
host (see the existing linux-arm64v8
directory for example settings that can be adapted).
@lovell sorry for the delay, hope it is ok now. |
Thanks for the updates, I can see cross-compilation settings for rust but not for the rest of the (C-based) dependencies. Am I missing something? Perhaps we could use one of the toolchains from https://musl.cc/ ? These are available as Docker images for running on Intel hardware - |
echo "- darwin-x64" | ||
echo | ||
exit 1 | ||
fi | ||
VERSION_VIPS="$1" | ||
PLATFORM="${2:-all}" | ||
|
||
# alias arm64 to arm64v8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need these aliases? It looks like using linuxmusl-arm64v8
as the PLATFORM
might be sufficient.
sorry @lovell this is a bit above my head... feel free to pickup the changes further. I'm also still getting the libtool error on librsvg.. tried about everything but can't really find a solution. It happens to me btw also on the regular linux-arm64v8
|
I've started a work-in-progress branch at https://github.com/lovell/sharp-libvips/tree/add-linuxmusl-arm64v8 that uses a complete cross-compiler toolchain so we can generate linuxmusl-arm64v8 binaries on x64 hardware. Sadly it doesn't work yet because... surprise... it runs into the same original problem with librsvg that @gpetrov ran into with native compilation:
My best guess is that this relates to the (lack of?) libtool sysroot, but it needs more investigation. |
This is basically what libtool does: AR=aarch64-linux-musl-ar
f_ex_an_ar_dir=.libs/librsvg-2.lax/librsvg_c_api.a/
f_ex_an_ar_oldlib=/deps/svg/./.libs/librsvg_c_api.a
if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
:
else
echo "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" >&2
fi So, it checks whether the contents of the Comparing the diff between the output of diff --git a/librsvg_c_api-sort.a b/librsvg_c_api-sort-unique.a
index 1111111..2222222 100644
--- a/librsvg_c_api-sort.a
+++ b/librsvg_c_api-sort-unique.a
@@ -164,7 +164,6 @@ floatsitf.o
floatunditf.o
floatunsitf.o
fp_mode.o
-fp_mode.o
int_util.o
muldc3.o
mulsc3.o Notice that I'm looking for a way to fix this. Perhaps it needs a similar hack as the now-reverted GNOME/librsvg@4162693 commit. |
Great work, here's the relevant logic in rustc that affects the aarch64 and musl combo: |
I noticed that too. I'm now building with |
This commit seems to fix it for me: kleisauke@9f54bfd, see the relevant GitHub actions build: Unfortunately, this requires a nightly version of Rust (due to the |
@kleisauke Thank you! I'm OK with the use of nightly rust. Feel free to add this commit to the Thanks too for improving the (rather hacked together) toolchain filesystem paths. I'll remove the offending I'll add a native ARM64 linuxmusl-arm64v8 Travis CI environment to sharp so we can test the output. There are possible ABI differences between musl 1.1.x (Alpine 3.11, as used by all the official Node docker images) and 1.2.x (as used by the toolchain) that we might yet run into. |
I just opened #90. Thanks for removing the |
first linuxmusl arm64 build