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

Provide Debian/Ubuntu ARM builds #1452

Closed
hoffie opened this issue Apr 5, 2021 · 10 comments · Fixed by #2526
Closed

Provide Debian/Ubuntu ARM builds #1452

hoffie opened this issue Apr 5, 2021 · 10 comments · Fixed by #2526
Labels
feature request Feature request
Milestone

Comments

@hoffie
Copy link
Member

hoffie commented Apr 5, 2021

Has this feature been discussed and generally agreed?

Multiple discussions, e.g.
#1446 (comment)
No explicit agreement, as far as I know.

Describe the solution you'd like

The autobuild process should build arm binaries for Debian/Ubuntu as well.

Describe alternatives that have been considered

Make arm users (e.g. Raspberry owners) build themselves.

Last I checked, Github's native runners were x86-only. We may either have to cross-compile (not sure if it is possible without obstacles or how simple this would be) or we would need a self-hosted runner.

Possible cross-compiling approach:
https://github.com/multiarch/crossbuild

@ann0see ann0see added the feature request Feature request label Apr 5, 2021
@dcorson-ticino-com
Copy link
Contributor

Do we know if the compiler can in any way optimize to any of the many ARM variants out there?
It looks to me like it must because all the 6 cores of my server on an Odroid-N2 are used and the Pi4 looks like it only has 4 cores.
So I am not sure if it would not be better to compile.
Or are such variants taken care of at runtime? I am not up-to-date on ARM tools.

@hoffie
Copy link
Member Author

hoffie commented Apr 6, 2021

I'm not too much into compilers or ARM specifically, but unless one uses explicit compile flags (-mtune=native), we will not end up with machine-specific (i.e. chip-specific) binaries, but with architecture-specific binaries. I don't think we (or our build system) uses such flags (or we might have problems on x86_64 as well when building from CI).

The number of cores to use should be runtime-specific.

@jujudusud
Copy link
Member

Hi here,
I think we have to provide autobuild binaries 64 bits for raspberry pi OS.

@ann0see
Copy link
Member

ann0see commented Aug 19, 2021

Jamulus is now in the Debian stable repository. So strictly speaking, there is an easy to install arm version out there.

@hoffie
Copy link
Member Author

hoffie commented Jan 30, 2022

The following works for cross-compiling Jamulus on Ubuntu 18.04 for armhf (32bit). The resulting binary works on my Raspberry Pi 3 Model B Plus Rev 1.3 (armv7l) running on Arch Linux ARM. It should work on Raspbian, too, as well es on older Raspberries.
Building on newer Ubuntu should work as well (newer GCC can be used though), but I've tried to stay close to the current build environment.
64bit should work in theory as well, but I haven't tried. Not sure what most of the people use and if it's worth it. As far as I understand it, newer Raspberries support 64bit, but userland is often 32bit.

I'll try to get this working via autobuild in the coming days.

dpkg --add-architecture armhf
sed -rne 's|^deb.*/ ([^ -]+(-updates)?) main.*|deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports \1 main universe multiverse restricted|p' /etc/apt/sources.list > /etc/apt/sources.list.d/armhf.list
sed -re 's/^deb /deb [arch=amd64,i386] /' -i /etc/apt/sources.list
apt-get update -qq
GCC_VER=8
apt install -y --no-install-recommends git dpkg-dev g++-$GCC_VER qt5-qmake qttools5-dev-tools libjack-jackd2-dev g++-$GCC_VER-arm-linux-gnueabihf qt5-qmake:armhf qtbase5-dev qtbase5-dev:armhf libjack-jackd2-0:armhf libjack-jackd2-dev:armhf
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 10
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 10
git clone --depth=1 https://github.com/jamulussoftware/jamulus/ # needs ca-certificates
/usr/lib/x86_64-linux-gnu/qt5/bin/qmake -qtconf /usr/lib/arm-linux-gnueabihf/qt5/qt.conf  QMAKE_CC=/usr/bin/arm-linux-gnueabihf-gcc-$GCC_VER QMAKE_CXX=/usr/bin/arm-linux-gnueabihf-g++-$GCC_VER QMAKE_LINK=/usr/bin/arm-linux-gnueabihf-gcc-$GCC_VER QMAKE_LINK_SHLIB=/usr/bin/arm-linux-gnueabihf-gcc-$GCC_VER LIBS+="-lstdc++ -lm"
make -j

@softins
Copy link
Member

softins commented Jan 30, 2022

64bit should work in theory as well, but I haven't tried. Not sure what most of the people use and if it's worth it. As far as I understand it, newer Raspberries support 64bit, but userland is often 32bit.

When Raspbian 11 came out, it was only/initially released as 32-bit. On my Pi4, I have run 32-bit on both Raspbian 10 and 11.

In fact https://www.raspberrypi.com/software/operating-systems/ only shows 32-bit downloads.

There are 64-bit versions available at https://downloads.raspberrypi.org/raspios_arm64/images/ but they are not compatible with Pi 1 and Pi 2, which seems to be why they are not promoted on the main page. Maybe they also haven't been tested as throughly?

So for now, we probably only need to look at releasing 32-bit packages for Jamulus.

@hoffie
Copy link
Member Author

hoffie commented Feb 2, 2022

Status update: Package builds work fine, but adding it to the existing build logic would have lead to bad code. Therefore, I've done some larger refactorings of the build logic and have added armhf autobuild support on top.

Tree: https://github.com/hoffie/jamulus/tree/autobuild-armhf
Packages: https://github.com/hoffie/jamulus/actions/runs/1771204110 (untested on Raspbian though)

So...:

  • Providing such builds should certainly be possible with plain Ubuntu build environments.
  • I will likely take some more time to finish the Autobuild refactorings (Android/Mac still missing, which is why the fail in my tree). I will then submit a PR for the refactorings and a PR for the armhf build.

I'm targeting this for 3.9.0 atm.

@hoffie hoffie added this to the Release 3.9.0 milestone Feb 2, 2022
@ann0see
Copy link
Member

ann0see commented Feb 2, 2022

Great. Maybe we could compile the arm files "by hand" and provide them as beta/experimental for the next release. I think quite some people would benefit from it already.

@hoffie
Copy link
Member Author

hoffie commented Feb 2, 2022

We could push the tree to a feature branch in jamulussoftware/jamulus and attach the resulting .debs to the release, yeah.

@pljones
Copy link
Collaborator

pljones commented Feb 2, 2022

They'd need to be clearly marked. So I'd say not link them directly on the "Official Release Note" posted here and Facebook, etc - just reference the Github release and make it clear they're experimental still.

We've still got IPv6 "experimental" and we're getting "unexpected" behaviour from it. So we need to take care letting anything too experimental in before it's ready.

hoffie added a commit to hoffie/jamulus that referenced this issue Mar 19, 2022
This uses the existing build logic, but makes it cross-compiler aware.

Fixes jamulussoftware#1452
hoffie added a commit to hoffie/jamulus that referenced this issue Mar 19, 2022
This uses the existing build logic, but makes it cross-compiler aware.

Fixes jamulussoftware#1452
hoffie added a commit to hoffie/jamulus that referenced this issue Mar 19, 2022
This uses the existing build logic, but makes it cross-compiler aware.

Fixes jamulussoftware#1452
hoffie added a commit to hoffie/jamulus that referenced this issue Mar 19, 2022
This uses the existing build logic, but makes it cross-compiler aware.

Fixes jamulussoftware#1452
hoffie added a commit to hoffie/jamulus that referenced this issue Mar 19, 2022
This uses the existing build logic, but makes it cross-compiler aware.

Fixes jamulussoftware#1452
hoffie added a commit to hoffie/jamulus that referenced this issue Mar 19, 2022
This uses the existing build logic, but makes it cross-compiler aware.

Fixes jamulussoftware#1452
hoffie added a commit to hoffie/jamulus that referenced this issue Mar 20, 2022
This uses the existing build logic, but makes it cross-compiler aware.

Fixes jamulussoftware#1452
hoffie added a commit to hoffie/jamulus that referenced this issue Mar 20, 2022
This uses the existing build logic, but makes it cross-compiler aware.

Fixes jamulussoftware#1452
ann0see pushed a commit to ann0see/jamulus that referenced this issue Mar 24, 2022
This uses the existing build logic, but makes it cross-compiler aware.

Fixes jamulussoftware#1452
pgScorpio pushed a commit to pgScorpio/jamulus that referenced this issue Mar 28, 2022
This uses the existing build logic, but makes it cross-compiler aware.

Fixes jamulussoftware#1452
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants