Skip to content

build more architectures - #189

Closed
sithlord48 wants to merge 1 commit into
linuxdeploy:masterfrom
sithlord48:buildotherarches
Closed

sithlord48 wants to merge 1 commit into
linuxdeploy:masterfrom
sithlord48:buildotherarches

Conversation

@sithlord48

@sithlord48 sithlord48 commented Jan 12, 2022 •

Copy link
Copy Markdown

Try to build more architectures

  • aarch64
  • armv7

Build Status Can be seen here

Todo:
Use Docker in place of the container build step.
most rectent failure seams due to empty REPO_ROOT being set in build script.

@sithlord48
sithlord48 force-pushed the buildotherarches branch 3 times, most recently from 5dbe187 to c5d0496 Compare January 12, 2022 15:11
Comment thread .github/workflows/main.yml Resolved
@TheAssassin

Copy link
Copy Markdown
Member

I'm not sure whether all these architectures should be added. I've told the last person to send such a PR to create an issue first. Please wait for me to have a look before spending more time on this.

@sithlord48
sithlord48 force-pushed the buildotherarches branch 5 times, most recently from 52e3446 to 8493239 Compare January 12, 2022 17:19
@sithlord48

Copy link
Copy Markdown
Author

I'm not sure whether all these architectures should be added. I've told the last person to send such a PR to create an issue first. Please wait for me to have a look before spending more time on this.

I have an issue where i want to ship appimages but if i have arm builds i have to build the tooling . why do that in my own repo when we can just do it here

@sithlord48
sithlord48 force-pushed the buildotherarches branch 4 times, most recently from 31f568b to 2cec094 Compare January 12, 2022 20:08
@sithlord48

Copy link
Copy Markdown
Author

I have a slight issue in the build, I will wait to hear back from @TheAssassin before i update this further.

@TheAssassin TheAssassin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using emulation instead of cross compilation to create binaries for foreign architectures imposes performance issues in the CI. I guess this tool is small enough, but it is not ideal. I see that there is no realistic alternative.

As mentioned in the comments, I am not a fan of this third party actions Docker-based stuff. Building binaries for ARM etc. should be done using only infrastructure provided in this repository, as well as vanilla GitHub actions.

- uses: actions/[email protected]
with:
submodules: recursive
- uses: uraimo/[email protected]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As explained on IRC, third party actions are a no-go in the supply chain. Have had very bad experiences with this kind of stuff. It limits the portability of the build scripts (i.e., I can't move to another CI service by just writing a YAML file), and it doesn't allow for testing the CI toolchain locally (unlike a script with a Dockerfile next to it).

Comment thread .github/workflows/main.yml Resolved
export CFLAGS="-m32"
export CXXFLAGS="-m32"
;;
*)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check should not be removed. If anything, it should be extended.

Cross-compilation must not be removed.

Comment thread ci/build.sh Resolved
Comment thread ci/build.sh Resolved
Comment thread ci/test-coverage.sh Resolved
@TheAssassin TheAssassin mentioned this pull request Jan 24, 2022
@TheAssassin

Copy link
Copy Markdown
Member

Note that linuxdeploy-plugin-appimage is embedded in the linuxdeploy AppImages. You will likely have to have it built for the foreign architectures as well.

matrix:
BUILD_TYPE: [appimage, coverage]
distro:
- bullseye

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to do the build on Ubuntu bionic. It would run on more distros that way, if I'm not mistaken.

@TheAssassin

Copy link
Copy Markdown
Member

This is outdated, and most of the criticism was never picked up. I plan to add more architectures myself.

@neildavis

Copy link
Copy Markdown

@TheAssassin Not sure how advanced you are with this, but I may perhaps be able to help with armhf & aarch64? I've just started to look at AppImage for a (unfortunately private) project that I contribute to where we create cross compiled binaries for Raspberry Pi on GHA ubuntu runners (no Docker, third party plugins etc, just GHA yaml scripts)

The 'nuclear option' approach I took (after many failures) was to create cross toolchains using crosstool-ng with glibc & gcc targeted for compatibility with the Debian 11 'bullseye' system libs, and generate sysroots directly from the Raspbian/Debian mirrors using mk-sbuild The sysroots and toolchains are then cached using GHA.

I could possibly extract some of that stuff into here, although I've not even built linuxdeploy yet. A sticky point might be that I was using an older GCC (10.4.0) and glibc (2.31) for 'out-of-the-box' compatibility with the older bullseye libstdc++ system lib which places limits on newer C++ standards use. That's probably easily fixed by building with newer versions and bundling libstdc++ though.

Is there a minimum version of GCC required to build linuxdeploy?

Not sure what approach you intended to take, but let me know if you think any of this would be useful to you?

@TheAssassin

Copy link
Copy Markdown
Member

The plan is to do what I've done for other repositories, which means long build times but runs with little to no maintenance: use QEMU to run ARM Docker containers as a build environment. This approach works fine both locally and on GitHub actions, and should be rather straightforward to implement (famous last words). Cross compiling is a lot more effort. This tool is not complex enough to justify that effort.

I can't tell you the definite minimum GCC version, but the tool requires C++17 as a minimum. GCC 7 should suffice. I'd just try.

I just build on relatively recent distros and provide static binaries for linuxdeploy itself nowadays, as it was too much effort to support platforms like CentOS 7 (which, unfortunately, continues to be supported until next year, at least on paper). I'm not a fan of static binaries in general, but for such small utilities which are used on such a variety of platforms, it's totally justified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants