Skip to content

Commit

Permalink
Automation test fix
Browse files Browse the repository at this point in the history
Workflow and Script Modifications

Workflows:
  Added --privileged option to the container.
  Set QEMU_LD_PREFIX and LD_LIBRARY_PATH for aarch64.
  Manually configured QEMU binfmt for aarch64 as systemd is not running.
  Commented out bazel clean --expunge due to timeout issues.

update_mozc_deps:
  Modified the part that calls the run_bazel function for arm64
  Slightly modified the pkill command in cleanup to prevent workflow stoppage.
  • Loading branch information
phoepsilonix committed Oct 5, 2024
1 parent c5bdcb2 commit 9c94f4b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/moze-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ jobs:
update:
name: Build and test
runs-on: ubuntu-latest
container: archlinux:latest
container:
image: archlinux:latest
options: --privileged
strategy:
fail-fast: false
steps:
Expand All @@ -23,9 +25,21 @@ jobs:
useradd -m builduser
- name: Install dependencies
run: |
pacman -Syu --noconfirm base-devel clang cmake ninja extra-cmake-modules fmt libuv boost git qt6-base qt6-wayland libxkbcommon qt6-webengine flatpak procps-ng python3 yq wget git qemu-user-static-binfmt
/usr/lib/systemd/systemd-binfmt
pacman -Syu --needed --noconfirm base-devel clang cmake ninja extra-cmake-modules fmt libuv boost git qt6-base qt6-wayland libxkbcommon qt6-webengine flatpak procps-ng python3 yq wget git qemu-user-static-binfmt #aarch64-linux-gnu-glibc
flatpak install -y --system org.freedesktop.Sdk/aarch64/23.08
- name: Qemu and binfmt
run: |
if [ ! -d /proc/sys/fs/binfmt_misc ]; then
if ! /sbin/modprobe binfmt_misc ; then
exit 1
fi
fi
if [ ! -f /proc/sys/fs/binfmt_misc/register ]; then
if ! mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc ; then
exit 1
fi
fi
[ -w "/proc/sys/fs/binfmt_misc/register" ] && cat /usr/lib/binfmt.d/qemu-aarch64-static.conf|sudo tee /proc/sys/fs/binfmt_misc/register||true
- uses: actions/checkout@v4
with:
repository: fcitx/fcitx5
Expand All @@ -51,6 +65,11 @@ jobs:
run: |
cd flatpak-fcitx5
chown -R builduser:builduser .
sudo -u builduser ./update_mozc_deps
git diff
sudo -u builduser \
LD_LIBRARY_PATH=/usr/aarch64-linux-gnu/lib64:/usr/aarch64-linux-gnu/lib:$LD_LIBRARY_PATH \
QEMU_LD_PREFIX=/usr/aarch64-linux-gnu \
TMPDIR=$PWD/tmp \
./update_mozc_deps
sudo -u builduser ./update_mozc_zip_code_patch
chown -R root:root .
git diff || true
11 changes: 7 additions & 4 deletions update_mozc_deps
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

cleanup() {
pkill -P $$
pkill -P $$ || true
}

check_bazel_binary() {
Expand All @@ -28,8 +28,8 @@ check_and_download_bazel() {
}

run_bazel() {
echo $1 clean --expunge
# $1 clean --expunge
#echo $1 clean --expunge
#$1 clean --expunge
echo $1 build --nobuild --experimental_downloader_config="$SCRIPT_DIRECTORY/downloader.cfg" --registry=file://$BASE/bcr --repository_cache="$_MOZC_BAZEL_CACHE" --config oss_linux --config release_build $2
$1 build --nobuild --experimental_downloader_config="$SCRIPT_DIRECTORY/downloader.cfg" --registry=file://$BASE/bcr --repository_cache="$_MOZC_BAZEL_CACHE" --config oss_linux --config release_build $2
}
Expand Down Expand Up @@ -90,7 +90,10 @@ BUILD_TARGET="unix/fcitx5:fcitx5-mozc.so ${BUILD_TARGET_SERVER} gui/tool:mozc_to
run_bazel "$BASE/bazel-x86_64" $BUILD_TARGET
# Only run aarch64 against server target, as with flatpak we have no external dependencies
# TODO: apply only tag for deps
run_bazel "flatpak run --filesystem=$PWD --filesystem=home --share=network --command=$BASE/bazel-arm64 org.freedesktop.Sdk/aarch64/23.08" $BUILD_TARGET_SERVER
run_bazel "flatpak run --arch=aarch64
--filesystem=$SCRIPT_DIRECTORY --filesystem=home --share=network --filesystem=xdg-cache
--command=$BASE/bazel-arm64
org.freedesktop.Sdk/aarch64/23.08" $BUILD_TARGET_SERVER

kill $PROXY_PID

Expand Down

0 comments on commit 9c94f4b

Please sign in to comment.