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

Updates to Fix Linux ARM32/ARM64 CI #18575

Merged
merged 9 commits into from
Nov 23, 2023
7 changes: 5 additions & 2 deletions .github/workflows/ci_linux_arm_mu4.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: CI_Linux_ARM MU4

on:
schedule:
- cron: '0 3 */1 */1 *' # At 03:00 on every day-of-month for master
# - cron: '0 3 */1 */1 *' # At 05:00 on every day-of-month for current release branch
workflow_dispatch:
inputs:
build_mode:
Expand Down Expand Up @@ -125,7 +128,7 @@ jobs:
run: |
YT_API_KEY=${{ secrets.YOUTUBE_API_KEY }}; if [ -z "$YT_API_KEY" ]; then YT_API_KEY="''"; fi
C_URL=${SENTRY_URL}; if [ -z "$C_URL" ]; then C_URL="''"; fi
sudo docker run -i -v "${PWD}:/MuseScore" "arm32v7/ubuntu:bionic" /bin/bash -c "cd /MuseScore && \
sudo docker run -i -v "${PWD}:/MuseScore" "arm32v7/ubuntu:focal" /bin/bash -c "cd /MuseScore && \
bash /MuseScore/build/ci/linux/setup-arm.sh --arch armv7l && \
bash /MuseScore/build/ci/linux/build.sh -n ${{ env.BUILD_NUMBER }} --youtube_api_key $YT_API_KEY --crash_log_url $C_URL --arch armv7l && \
bash ./build/ci/linux/dumpsyms.sh && \
Expand Down Expand Up @@ -244,7 +247,7 @@ jobs:
run: |
YT_API_KEY=${{ secrets.YOUTUBE_API_KEY }}; if [ -z "$YT_API_KEY" ]; then YT_API_KEY="''"; fi
C_URL=${SENTRY_URL}; if [ -z "$C_URL" ]; then C_URL="''"; fi
sudo docker run -i -v "${PWD}:/MuseScore" "arm64v8/ubuntu:bionic" /bin/bash -c "cd /MuseScore && \
sudo docker run -i -v "${PWD}:/MuseScore" "arm64v8/ubuntu:focal" /bin/bash -c "cd /MuseScore && \
bash /MuseScore/build/ci/linux/setup-arm.sh --arch aarch64 && \
bash /MuseScore/build/ci/linux/build.sh -n ${{ env.BUILD_NUMBER }} --youtube_api_key $YT_API_KEY --crash_log_url $C_URL --arch aarch64 && \
bash ./build/ci/linux/dumpsyms.sh && \
Expand Down
63 changes: 50 additions & 13 deletions build/ci/linux/setup-arm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,18 @@ apt_packages=(
libsndfile1-dev
zlib1g-dev
make
patch
coreutils
gawk
sed
desktop-file-utils # installs `desktop-file-validate` for appimagetool
zsync # installs `zsyncmake` for appimagetool
libglib2.0-dev
librsvg2-dev
argagg-dev
libgcrypt20-dev
libcurl4-openssl-dev
libgpg-error-dev
)

# MuseScore compiles without these but won't run without them
Expand Down Expand Up @@ -130,10 +135,10 @@ DEBIAN_FRONTEND="noninteractive" TZ="Europe/London" apt-get install -y --no-inst
"${apt_packages_runtime[@]}" \
"${apt_packages_ffmpeg[@]}"

# Add additional ppa (Qt 5.15.2 and CMake)
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ bionic main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null
add-apt-repository --yes ppa:theofficialgman/opt-qt-5.15.2-bionic-arm
# Add additional ppas (Qt 5.15.2 and Cmake)
# Poor naming of the cmake ppa, this ppa has bionic/focal/jammy dists
add-apt-repository --yes ppa:theofficialgman/cmake-bionic
add-apt-repository --yes ppa:theofficialgman/opt-qt-5.15.2-focal-arm
apt-get update

# add an exception for the "detected dubious ownership in repository" (only seen inside a Docker image)
Expand Down Expand Up @@ -219,6 +224,10 @@ git clone https://github.com/linuxdeploy/linuxdeploy
cd /linuxdeploy/
git checkout --recurse-submodules 49f4f237762395c6a37
git submodule update --init --recursive

# patch src/core/generate-excludelist.sh to use curl instead of wget which fails on armhf
sed -i 's/wget --quiet "$url" -O -/curl "$url"/g' src/core/generate-excludelist.sh

mkdir -p build
cd build
cmake -DBUILD_TESTING=OFF -DUSE_SYSTEM_BOOST=ON ..
Expand All @@ -236,6 +245,10 @@ git clone https://github.com/linuxdeploy/linuxdeploy-plugin-qt
cd /linuxdeploy-plugin-qt/
git checkout --recurse-submodules 59b6c1f90e21ba14
git submodule update --init --recursive

# patch src/core/generate-excludelist.sh to use curl instead of wget which fails on armhf
sed -i 's/wget --quiet "$url" -O -/curl "$url"/g' lib/linuxdeploy/src/core/generate-excludelist.sh

mkdir -p build
cd build
cmake -DBUILD_TESTING=OFF -DUSE_SYSTEM_BOOST=ON ..
Expand Down Expand Up @@ -287,23 +300,47 @@ git checkout --recurse-submodules 2.0.0-alpha-1-20220512
git submodule update --init --recursive
mkdir -p build
cd build
# switch to using pkgconf
# the following is a super ugly hack that exists upstream
apt-get install -y --no-install-recommends pkgconf

if [ "$PACKARCH" == "armv7l" ]; then
cp ../ci/libgcrypt.pc /usr/lib/arm-linux-gnueabihf/pkgconfig/libgcrypt.pc
sed -i 's|x86_64-linux-gnu|arm-linux-gnueabihf|g' /usr/lib/arm-linux-gnueabihf/pkgconfig/libgcrypt.pc
sed -i 's|x86_64-pc-linux-gnu|arm-pc-linux-gnueabihf|g' /usr/lib/arm-linux-gnueabihf/pkgconfig/libgcrypt.pc
echo 'prefix=/usr
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${prefix}/lib/arm-linux-gnueabihf
host=arm-unknown-linux-gnueabihf
mtcflags=
mtlibs=

Name: gpg-error
Description: GPG Runtime
Version: 1.27
Cflags:
Libs: -L${libdir} -lgpg-error
Libs.private:
URL: https://www.gnupg.org/software/libgpg-error/index.html' > /usr/lib/arm-linux-gnueabihf/pkgconfig/gpg-error.pc
else
cp ../ci/libgcrypt.pc /usr/lib/aarch64-linux-gnu/pkgconfig/libgcrypt.pc
sed -i 's|x86_64|aarch64|g' /usr/lib/aarch64-linux-gnu/pkgconfig/libgcrypt.pc
echo 'prefix=/usr
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${prefix}/lib/aarch64-linux-gnu
host=aarch64-unknown-linux-gnu
mtcflags=
mtlibs=

Name: gpg-error
Description: GPG Runtime
Version: 1.27
Cflags:
Libs: -L${libdir} -lgpg-error
Libs.private:
URL: https://www.gnupg.org/software/libgpg-error/index.html' > /usr/lib/aarch64-linux-gnu/pkgconfig/gpg-error.pc
fi

# the hack uses pkgconf to produce a partial makefile and then installs back pkg-config to finish producing the makefile
cmake -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo .. || true
apt-get install -y --no-install-recommends pkg-config
cmake -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
cmake -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_SYSTEM_NAME=Linux ..
make -j"$(nproc)"
# create the extracted appimage directory
mkdir -p $BUILD_TOOLS/appimageupdatetool
Expand All @@ -329,15 +366,15 @@ if [ "$PACKARCH" == "armv7l" ]; then
echo "Get Breakpad"
breakpad_dir=$BUILD_TOOLS/breakpad
if [[ ! -d "$breakpad_dir" ]]; then
wget -q --show-progress -O $BUILD_TOOLS/dump_syms.7z "https://s3.amazonaws.com/utils.musescore.org/breakpad/linux/armv7l/dump_syms.zip"
curl -o $BUILD_TOOLS/dump_syms.7z "https://s3.amazonaws.com/utils.musescore.org/breakpad/linux/armv7l/dump_syms.zip"
7z x -y $BUILD_TOOLS/dump_syms.7z -o"$breakpad_dir"
fi
echo export DUMPSYMS_BIN="$breakpad_dir/dump_syms" >> $ENV_FILE
else
echo "Get Breakpad"
breakpad_dir=$BUILD_TOOLS/breakpad
if [[ ! -d "$breakpad_dir" ]]; then
wget -q --show-progress -O $BUILD_TOOLS/dump_syms.7z "https://s3.amazonaws.com/utils.musescore.org/breakpad/linux/aarch64/dump_syms.zip"
curl -o $BUILD_TOOLS/dump_syms.7z "https://s3.amazonaws.com/utils.musescore.org/breakpad/linux/aarch64/dump_syms.zip"
7z x -y $BUILD_TOOLS/dump_syms.7z -o"$breakpad_dir"
fi
echo export DUMPSYMS_BIN="$breakpad_dir/dump_syms" >> $ENV_FILE
Expand Down
5 changes: 4 additions & 1 deletion src/framework/audio/internal/fx/reverb/simdtypes_neon.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,15 @@ struct float_x4
s.n128_f32[1] = v1;
s.n128_f32[2] = v2;
s.n128_f32[3] = v3;
#elif defined(__GNUC__) // gcc (12.2.0) doesn't seem to allow initializer list.
const float init[4] = { v0, v1, v2, v3 };
s = vld1q_f32(init);
#else
s = { v0, v1, v2, v3 };
#endif
}

#if __clang__
#if defined(__clang__) || defined(__GNUC__)
private:
// this helper class allows writing to the single registers for clang
// __mm128 is a built-in type -> we can't return a float& reference.
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/google_crashpad_client/compat/linux/sys/mman.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
extern "C" {
#endif

int memfd_create(const char* name, unsigned int flags);
int memfd_create(const char* name, unsigned int flags) __THROW;

#ifdef __cplusplus
} // extern "C"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

extern "C" {

int memfd_create(const char* name, unsigned int flags) {
int memfd_create(const char* name, unsigned int flags) __THROW {
static const crashpad::NoCfiIcall<decltype(memfd_create)*> next_memfd_create(
dlsym(RTLD_NEXT, "memfd_create"));
return next_memfd_create ? next_memfd_create(name, flags)
Expand Down