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

Draft: Issue #469 ARM workflows #582

Closed
wants to merge 4 commits into from

Conversation

ajmas
Copy link

@ajmas ajmas commented Mar 17, 2023

README

Before contributing, please read the contributing document, and the coding style and conventions guide.
Search the pull request list for similar pulls before opening a new one.
Check your code doesn't throw any warning or error message while compiling, and doesn't give any warning in Clang static analyzer. Make sure your code is GCC, Clang, MinGW and MSVC compliant (use AppVeyor and Github Actions for that).
Check your code using GDB, Valgrind and similar tools to remove all possible memory leaks and segfaults.

Pull request

Type of change

Is your pull request a bug fix, new feature, code refactor, breaking change, etc.?
If your change is too big consider discussing it before pulling.

Summary

Updating workflow for ARM machines. Mac & Raspberry Pi.

Just a draft for now and will likely split into two separate PRs.

Related Issue

Issue #469

More info

Provide screenshots, logs, etc. if required.

Added dependencies

Does your pull request add more dependencies to the project? This may require some discussion. Minimal dependencies is a requirement.

Target Environment

Is this pull request specific to a target operating system?

  • Operating System information: (name) (numeric version and codename if applied) (architecture)

@ajmas ajmas changed the title Draft: added raspabian build Draft: Issue #469 ARM workflows Mar 17, 2023
include:
- dockerimg: ubuntu:focal
compiler: gcc
upload: 1
Copy link
Member

Choose a reason for hiding this comment

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

upload: 1 should be upload: 0 for now, so it does not collide with x86 desktop builds.

Copy link
Author

@ajmas ajmas Mar 19, 2023

Choose a reason for hiding this comment

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

I had debated on making a mac_arm.yml action. Do you think this would be better?

oops. Wrong file. I’ll look when I get home.

Copy link
Member

Choose a reason for hiding this comment

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

For me, differencing raspbian from other distros is ok, but for Mac is the same OS but with different architectures, IMO is ok to be in the same file, as for example in the case of the MSYS build.

echo Install dependencies
echo
chmod +x ports/ci/linux-ubuntu/install_deps.sh
./ports/ci/linux-ubuntu/install_deps.sh
Copy link
Member

Choose a reason for hiding this comment

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

You must create a new ./ports/ci/linux-raspbian directory with the scripts there.

Copy link
Author

Choose a reason for hiding this comment

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

Done

@hipersayanX
Copy link
Member

First make those changes, maybe other changes will be needed later.

@hipersayanX
Copy link
Member

Also, the DeployTools will need some adjustments to properly detect arm64 architecture instead of x86_64.

Python version: 3.11.2
Config files: ['/Users/runner/work/webcamoid/webcamoid/build/package_info.conf']
Sources directory: /Users/runner/work/webcamoid/webcamoid
Data directory: /Users/runner/work/webcamoid/webcamoid/webcamoid-data
Output directory: /Users/runner/work/webcamoid/webcamoid/webcamoid-packages/mac
Host platform: mac
Target platform: mac
Target architecture: x86_64
Number of threads: 4
Program version: daily-merge-1

But in general, nice work 👍

@ajmas
Copy link
Author

ajmas commented Mar 20, 2023

I noticed some warnings during the process, suggesting some of the actions need updating to more recent versions. Probably best deal with this in a separate issue?

- uses: pguyot/arm-runner-action@v2
id: build_image
with:
base_image: raspios_lite:2022-04-04
Copy link
Member

Choose a reason for hiding this comment

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

I was thinking, instead of using this image, I'm more in the side of using one of the official images, and Ubuntu already provide images for ARM and ARM64, and in the same was as the official Webcamoid releases are built using an Ubuntu image, and it works in Arch, Fedora, Debian, etc., if we build the binaries in Ubuntu ARM it should be able to work in Raspbian, Arch Linux ARM, or any other ARM based distro.
So the code above is not really necessary but instead you must configure docker to point to the ARM and ARM64 images, look at here for example (at What's in this image?), apparently images are indicated as ARCHITECTURE/ubuntu:latest.

apt-get -y install software-properties-common
add-apt-repository "ppa:beineri/opt-qt-${QTVER}-focal"
add-apt-repository "ppa:pipewire-debian/pipewire-upstream"
fi
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure and did not checked but pretty sure Beineri repositories does not have support for ARM, so instead of using Ubuntu Focal, upgrade it to the latest Ubuntu LTS version containing Qt 5.15, and you can remove this code.

cp -rvf ~/QtIFW/* .
cd ..
fi

Copy link
Member

Choose a reason for hiding this comment

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

QtIFW does not have ARM images so this code can be removed for now.


# Install AppImageTool

appimage=appimagetool-x86_64.AppImage
Copy link
Member

Choose a reason for hiding this comment

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

AppImage has ARM images so use armhf or aarch64 depending on the case.

"qt${PPAQTVER}declarative" \
"qt${PPAQTVER}svg" \
"qt${PPAQTVER}quickcontrols2" \
"qt${PPAQTVER}wayland"
Copy link
Member

Choose a reason for hiding this comment

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

This part can be removed because we won't use Beineri repositories here.

if [ "${DOCKERIMG}" = ubuntu:focal ]; then
cat << EOF > package_info_libdir.conf
[System]
libDir = /opt/qt${PPAQTVER}/lib
Copy link
Member

Choose a reason for hiding this comment

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

This can be removed too.

fi

if [ "${DOCKERIMG}" = ubuntu:focal ]; then
source "/opt/qt${PPAQTVER}/bin/qt${PPAQTVER}-env.sh"
Copy link
Member

Choose a reason for hiding this comment

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

This also can be removed.

-DCMAKE_C_COMPILER="${COMPILER_C}" \
-DCMAKE_CXX_COMPILER="${COMPILER_CXX}" \
${EXTRA_PARAMS} \
-DGST_PLUGINS_SCANNER_PATH=/usr/lib/x86_64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner \
Copy link
Member

Choose a reason for hiding this comment

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

This obviously won't work in ARM so the path must be changed.

@hipersayanX
Copy link
Member

hipersayanX commented Mar 22, 2023

Ok think those are the changes to be made for now.

I noticed some warnings during the process, suggesting some of the actions need updating to more recent versions. Probably best deal with this in a separate issue?

Because of this?

12 workflows awaiting approval

I need to approve them before run, any I will update the workflows later before release, just focus on the workflows you are working now.

@hipersayanX
Copy link
Member

Packages for ARM are now available.

Packages for GNU/Linux arm32v7 and arm64v8

webcamoid-portable-linux-daily-master-arm32.AppImage
webcamoid-portable-linux-daily-master-arm32.tar.xz
webcamoid-portable-linux-daily-master-arm64.AppImage
webcamoid-portable-linux-daily-master-arm64.tar.xz

Packages for MacOs M1

webcamoid-installer-mac-daily-master-arm64.pkg
webcamoid-portable-mac-daily-master-arm64.dmg

I couldn't create the Flatpak packages because flatpak-builder can't run in unprivileged containers, and installers are not available because QtIFW is only available for x86_64, but AppImage and tar.xz formats are more than enough.
Also, Github only provide x86_64 containers, ARM packages must be build in Cirrus CI.

@hipersayanX hipersayanX closed this May 4, 2023
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.

None yet

2 participants