Skip to content
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

Alpine package for aarch64 #1903

Closed
wbadart opened this issue Aug 1, 2022 · 21 comments
Closed

Alpine package for aarch64 #1903

wbadart opened this issue Aug 1, 2022 · 21 comments
Labels
A-WISH Some kind of improvement request, hare-brained proposal, or plea. docs Documentation-related. packaging Dependencies, version constraints, packaging.. platform:linux platform:raspberrypi

Comments

@wbadart
Copy link

wbadart commented Aug 1, 2022

Hi Simon-

I'm trying to get hledger installed on a Raspberry Pi 4 running Alpine (3.16). I was excited to see packages in the Installation Guide for both Alpine (apk) and Raspberry Pi, but after enabling the apk testing repo and trying to install hledger, the package wasn't found.

I realized after a moment that the apk package is x86_64-only. Given what automation the project already has in place, how big a lift would it be to tack on aarch64 binaries for apk? Happy to help out where I can, though I've never been on the distributor end of an apk package, so I'd need some time to get spun up on that.

Thanks for your consideration!

@wbadart wbadart added the A-WISH Some kind of improvement request, hare-brained proposal, or plea. label Aug 1, 2022
@simonmichael
Copy link
Owner

Thanks @wbadart. (We should clarify that it's x64 on the install page.) I think the answer depends on whether Github offers aarch64 workers - I think not right now ?

@simonmichael
Copy link
Owner

Or, does alpine have such infrastructure ? How do they obtain aarch64 binaries for other packages ?

@simonmichael simonmichael added packaging Dependencies, version constraints, packaging.. platform:linux docs Documentation-related. platform:raspberrypi labels Aug 1, 2022
@simonmichael
Copy link
Owner

And does it need to be Alpine-specific, or would a generic static aarch64 binary that also worked for other Pi distros be possible ?

@wbadart
Copy link
Author

wbadart commented Aug 2, 2022

Good questions, not sure. I think the Alpine wiki page on creating packages may be outdated (e.g. it doesn't give aarch64 as an accepted value of the arch parameter of APKBUILD file that declares the package's metadata). I can experminent on that Pi of mine to see if I can put one of those 3rd party rpi hledger binaries in the apk package without it blowing up.

Could cross-compiling be a possible avenue for aarch64 CI builds until GitHub supports them natively?

@simonmichael
Copy link
Owner

I believe GHC doesn't really do cross-compiling, unless possibly via some Nix magic.

@nobodyinperson
Copy link
Contributor

@wbadart You should be able to just take an existing static aarch64 build from https://hledger.org and use that. Or follow my instructions here to build it youself e.g. In a aarch64 docker or chroot: #1268 (comment)

@simonmichael
Copy link
Owner

I didn't understand that, where is "an existing static aarch64 build from https://hledger.org/" ?

@nobodyinperson
Copy link
Contributor

On https://hledger.org/install.html there is a link unter Raspberry Pi to https://github.com/simonmichael/hledger/releases/tag/1.18.1 where my build of hledger for aarch64 is available: https://github.com/simonmichael/hledger/releases/download/1.18.1/hledger-aarch64-manjaro.gz

It's a little outdated though...

@simonmichael
Copy link
Owner

simonmichael commented Dec 6, 2022 via email

@wbadart
Copy link
Author

wbadart commented Dec 7, 2022

@nobodyinperson thanks for the tip! I'll see check and see if hledger-aarch64-manjaro.gz works on my Alpine Pi when I'm back home in a few weeks.

@nobodyinperson
Copy link
Contributor

I put the build instructions together into a Dockerfile so building hledger e.g. for aarch64 is simpler in the future: https://gitlab.com/nobodyinperson/hledger-build-docker

Here is hledger v 1.26.1 aarch64 built this way, @simonmichael feel free to add it to the GitHub Release page and https://hledger.org/install.html#raspberry-pi:

hledger-1.26.1-linux-aarch64.gz

Apparently, with cabal, hledger 1.26.1 is the latest buildable version. Later versions throw weird dependency errors. At least in that debian container. 🤷

@simonmichael
Copy link
Owner

simonmichael commented Dec 22, 2022 via email

@nobodyinperson
Copy link
Contributor

Meanwhile my Raspberry Pi built yet an older version of hledger:

hledger-1.26-linux-aarch64.gz

Error message for any version above 1.26.1 (tested with 1.27 and 1.28):

Sending build context to Docker daemon  211.2MB
Step 1/9 : FROM debian
 ---> 917ea2fdcbd6
Step 2/9 : MAINTAINER Yann Büchau <nobodyinperson@posteo.de>
 ---> Using cache
 ---> a1bc1777526f
Step 3/9 : ENV LC_ALL=C.UTF-8
 ---> Using cache
 ---> b6a4e72e5443
Step 4/9 : RUN apt-get update
 ---> Using cache
 ---> 31021e0f6b66
Step 5/9 : RUN apt-get install -y cabal-install
 ---> Using cache
 ---> 5d652f6765ac
Step 6/9 : RUN cabal update
 ---> Using cache
 ---> 512969eb431f
Step 7/9 : RUN cabal install alex happy
 ---> Using cache
 ---> 356c275388a5
Step 8/9 : RUN cabal install hledger-1.28
 ---> Running in 6d1780a6fcfb

Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: hledger-1.28 (user goal)
[__1] next goal: base (dependency of hledger)
[__1] rejecting: base-4.13.0.0/installed-4.1... (conflict: hledger =>
base>=4.14 && <4.18)
[__1] rejecting: base-4.17.0.0, base-4.16.4.0, base-4.16.3.0, base-4.16.2.0,
base-4.16.1.0, base-4.16.0.0, base-4.15.1.0, base-4.15.0.0, base-4.14.3.0,
base-4.14.2.0, base-4.14.1.0, base-4.14.0.0, base-4.13.0.0, base-4.12.0.0,
base-4.11.1.0, base-4.11.0.0, base-4.10.1.0, base-4.10.0.0, base-4.9.1.0,
base-4.9.0.0, base-4.8.2.0, base-4.8.1.0, base-4.8.0.0, base-4.7.0.2,
base-4.7.0.1, base-4.7.0.0, base-4.6.0.1, base-4.6.0.0, base-4.5.1.0,
base-4.5.0.0, base-4.4.1.0, base-4.4.0.0, base-4.3.1.0, base-4.3.0.0,
base-4.2.0.2, base-4.2.0.1, base-4.2.0.0, base-4.1.0.0, base-4.0.0.0,
base-3.0.3.2, base-3.0.3.1 (constraint from non-upgradeable package requires
installed instance)
[__1] fail (backjumping, conflict set: base, hledger)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: hledger, base

@simonmichael
Copy link
Owner

simonmichael commented Dec 22, 2022 via email

@nobodyinperson
Copy link
Contributor

❯ sudo docker run --rm -it debian sh -c 'apt update -q 2>/dev/null >/dev/null;apt show ghc 2>/dev/null | grep -i version'
Version: 8.8.4-2

Yep, debian again with its delightfully up-to-date software... 🙄

@nobodyinperson
Copy link
Contributor

nobodyinperson commented Dec 23, 2022

Finally got the build working with the fedora image with latest hledger:

hledger-1.28-linux-aarch64-fedora.gz

However as alpine uses musl-libc, these builds won't work under Alpine I'm afraid, maybe with this compatibility g-something. All other platforms should be able to run this binary as usual.

@cardoe
Copy link
Contributor

cardoe commented Feb 10, 2023

Would it help you out if there were more platforms supported in Docker images? I'm attempting to do that in #2002. Also thinking that potentially all the build steps in the Linux binary build could happen in the top level Dockerfile and the CI step for that could just consume that Dockerfile

@d5ng4i
Copy link

d5ng4i commented Sep 4, 2023

hledger, on aarch64, is available since alpine v3.17 from upstream community repository. The instructions to install hledger are updated to reflect this as well.

@d5ng4i
Copy link

d5ng4i commented Sep 10, 2024

@simonmichael This issue is fixed downstream.

I maintain hledger and related software in alpine. Sharing information about how we package software:

We build everything from source. We have automated builders for all distribution supported architectures that build, test and sign packages. We couldn't package hledger for aarch64 before because GHC wasn't ported to it then.

As of now, only x86_64 and aarch64 are supported. Once GHC is ported to other architectures, porting hledger should be as trivial as arch="aarch64 x86_64 <foo>".

@simonmichael
Copy link
Owner

Thanks @d5ng4i. After simonmichael/hledger_site#115, is this issue now resolved ? I've lost the context a bit.

@d5ng4i
Copy link

d5ng4i commented Sep 10, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-WISH Some kind of improvement request, hare-brained proposal, or plea. docs Documentation-related. packaging Dependencies, version constraints, packaging.. platform:linux platform:raspberrypi
Projects
None yet
Development

No branches or pull requests

5 participants