freeciv21 icon indicating copy to clipboard operation
freeciv21 copied to clipboard

.deb package based on ARM silicon

Open jwrober opened this issue 1 year ago • 17 comments

Is your feature request related to a problem? Please describe. We have some folks using ARM based Chromebooks, so we should support them with a native binary.

Describe the solution you'd like Create another .deb package, but using a ARM based VM on the CI.

Describe alternatives you've considered None

Additional context Came up on Discord -- https://discord.com/channels/378908274113904641/402213035865014272/1115468803632025683

jwrober avatar Jun 06 '23 22:06 jwrober

Cross-compiling on Debian in a nutshell: first get the dependencies:

sudo dpkg --add-architecture arm64
sudo apt-get update
sudo apt-get install build-essential crossbuild-essential-arm64
sudo apt-get install dep1:arm64 dep2:arm64 ...

Then pass the x86_64-to-arm64 gcc and g++ to CMake and hope that it detects the rest automatically. (If it doesn't, you'll need to pass the paths explicitly.)

Better don't run this in your main environment in case an important binary gets replaced with the arm version (use Docker or a VM).

lmoureaux avatar Jun 07 '23 08:06 lmoureaux

A native binary would be extra nice for ARM silicon, as it would negate having to compile a newer version of cmake. Every arm device I've touched so far would require a newer cmake when using their default image, including the current android dev environment image..

Also, something I found interesting. Once the linux dev container is activated on a chromebook, .deb packages can be installed just by clicking on them.

3dsf avatar Jun 16 '23 05:06 3dsf

I think I managed to make one. @3dsf, could you check if the package from this workflow works? (Scroll down to the bottom, download the Ubuntu package (arm64) artifact, then unzip it and install the .deb inside.)

lmoureaux avatar Jul 02 '23 12:07 lmoureaux

Thanks for working on this.

I downloaded the arm64 artifact and it unzips to a amd64 .deb file.

sudo apt-get install ./freeciv21_3.1-alpha.2_amd64.deb

Reading package lists... Done Building dependency tree... Done Reading state information... Done Note, selecting 'freeciv21:amd64' instead of './freeciv21_3.1-alpha.2_amd64.deb' Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: freeciv21:amd64 : Depends: libc6:amd64 (>= 2.34) but it is not installable Depends: libgcc-s1:amd64 (>= 3.0) but it is not installable Depends: libkf5archive5:amd64 (>= 5.50.0) but it is not installable Depends: liblua5.3-0:amd64 but it is not installable Depends: libqt5core5a:amd64 (>= 5.15.1) but it is not installable Depends: libqt5gui5:amd64 (>= 5.14.1) but it is not installable or libqt5gui5-gles:amd64 (>= 5.14.1) but it is not installable Depends: libqt5network5:amd64 (>= 5.15.1) but it is not installable Depends: libqt5svg5:amd64 (>= 5.6.0~beta) but it is not installable Depends: libqt5widgets5:amd64 (>= 5.15.1) but it is not installable Depends: libreadline8:amd64 (>= 6.0) but it is not installable Depends: libsdl2-2.0-0:amd64 (>= 2.0.12) but it is not installable Depends: libsdl2-mixer-2.0-0:amd64 (>= 2.0.2) but it is not installable Depends: libsqlite3-0:amd64 (>= 3.7.15) but it is not installable Depends: libstdc++6:amd64 (>= 11) but it is not installable Depends: zlib1g:amd64 (>= 1:1.1.4) but it is not installable E: Unable to correct problems, you have held broken packages.

Beyond that, I ran through the list and I think there will be 2 issues when amd64 versions are not specified

sudo apt install libc6

Reading package lists... Done Building dependency tree... Done Reading state information... Done libc6 is already the newest version (2.31-13+deb11u6). 0 upgraded, 0 newly installed, 0 to remove and 29 not upgraded.

sudo apt install libstdc++6

Reading package lists... Done Building dependency tree... Done Reading state information... Done libstdc++6 is already the newest version (10.2.1-6). 0 upgraded, 0 newly installed, 0 to remove and 29 not upgraded.

3dsf avatar Jul 02 '23 13:07 3dsf

Thanks for checking it out! I'll fix this and come back with a new version

lmoureaux avatar Jul 02 '23 13:07 lmoureaux

Hi @3dsf, I'm coming back to this issue after a long time... If you're still interested in helping us, I think I fixed the arm64 package! You'll find an ARM Debian package here (you need to be logged in). Could you give it a try? I checked best I could but I didn't manage to create an ARM virtual machine...

lmoureaux avatar Jan 04 '24 03:01 lmoureaux

Hey @lmoureaux, Thanks for your continued efforts

Below are the results from running in a clean environment

sudo apt install ./freeciv21_3.1-alpha.4_aarch64.deb

Reading package lists... Done Building dependency tree... Done Reading state information... Done Note, selecting 'freeciv21:aarch64' instead of './freeciv21_3.1-alpha.4_aarch64.deb' Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: freeciv21:aarch64 : Depends: libc6:aarch64 (>= 2.34) but it is not installable Depends: libgcc-s1:aarch64 (>= 3.0) but it is not installable Depends: libkf5archive5:aarch64 (>= 5.50.0) but it is not installable Depends: liblua5.3-0:aarch64 but it is not installable Depends: libqt5core5a:aarch64 (>= 5.15.1) but it is not installable Depends: libqt5gui5:aarch64 (>= 5.14.1) but it is not installable or libqt5gui5-gles:aarch64 (>= 5.14.1) but it is not installable Depends: libqt5network5:aarch64 (>= 5.15.1) but it is not installable Depends: libqt5svg5:aarch64 (>= 5.6.0~beta) but it is not installable Depends: libqt5widgets5:aarch64 (>= 5.15.1) but it is not installable Depends: libreadline8:aarch64 (>= 6.0) but it is not installable Depends: libsdl2-2.0-0:aarch64 (>= 2.0.12) but it is not installable Depends: libsdl2-mixer-2.0-0:aarch64 (>= 2.0.2) but it is not installable Depends: libsqlite3-0:aarch64 (>= 3.7.15) but it is not installable Depends: libstdc++6:aarch64 (>= 11) but it is not installable Depends: zlib1g:aarch64 (>= 1:1.1.4) but it is not installable E: Unable to correct problems, you have held broken packages.

3dsf avatar Jan 04 '24 06:01 3dsf

Thanks! Looks like I used the wrong architecture... Can you send the output of dpkg --print-architecture?

lmoureaux avatar Jan 04 '24 06:01 lmoureaux

Sure, here you go

dpkg --print-architecture

arm64

3dsf avatar Jan 04 '24 06:01 3dsf

Thanks! Here's a build with the right architecture in the metadata (the package name still says aarch64, I'll fix that): https://github.com/lmoureaux/freeciv21/actions/runs/7413349818/artifacts/1148408717

lmoureaux avatar Jan 04 '24 20:01 lmoureaux

Hey @lmoureaux, I just ran it, please see the results below

sudo apt-get install ./freeciv21_3.1-alpha.4_arm64.deb

Reading package lists... Done Building dependency tree... Done Reading state information... Done Note, selecting 'freeciv21' instead of './freeciv21_3.1-alpha.4_arm64.deb' Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: freeciv21 : Depends: libc6 (>= 2.34) but 2.31-13+deb11u6 is to be installed Depends: libstdc++6 (>= 11) but 10.2.1-6 is to be installed E: Unable to correct problems, you have held broken packages.

3dsf avatar Jan 04 '24 21:01 3dsf

Making progress! This is because we're building on Ubuntu 22.04 and your system appears to have older versions of basic libraries (libc, libstdc++). So we should build against an older glibc... I'll have to research how to do that. Possibly in a Debian image with backports enabled...

lmoureaux avatar Jan 04 '24 21:01 lmoureaux

Hehe, it's always fun chasing dependencies and this time it's with extra steps : )

uname -r

6.1.55-06877-gc83437f2949f

To me it looks like the ChromeOS dev environment is based on the newest Debian LTS kernel.
Hope that helps : )

3dsf avatar Jan 04 '24 21:01 3dsf

From your libc version it's somewhere between bullseye and bullseye-update. So oldstable...

lmoureaux avatar Jan 04 '24 21:01 lmoureaux

Trying a completely different approach, here are Debian packages built on the OpenSUSE build service: https://download.opensuse.org/repositories/home:/louis94_m:/freeciv21/Debian_11/arm64/ Hopefully it works this time? :sweat_smile:

lmoureaux avatar Jan 15 '24 18:01 lmoureaux

It works : ) freeciv21_3.0.2-1_arm64.deb installs by clicking on it when a dev environment has been initialized!

Thanks for making it happen : )

The dbgsym .deb did not install by clicking; what is it? Do you want me to install it from the cmdline and see what comes back?

3dsf avatar Jan 16 '24 20:01 3dsf

:tada: :tada: !

The dbgsym .deb did not install by clicking; what is it? Do you want me to install it from the cmdline and see what comes back?

This is a package with debugging information if you wanted to debug a crash. You can ignore it :)

I'll keep this issue open until we have a reliable workflow to keep the packages updated.

lmoureaux avatar Jan 16 '24 21:01 lmoureaux