diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f8eb575..0498d173 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: with: build-arch: "cross-android" upload-arch: "android" - cache-paths: /usr/local/aarch64-linux-android:/usr/local/armv7a-linux-androideabi:/usr/local/x86_64-linux-gnu + cache-paths: /usr/local/x86_64-linux-android:/usr/local/aarch64-linux-android:/usr/local/armv7a-linux-androideabi:/usr/local/x86_64-linux-gnu dist-files: build/x86_64/src/executionmanagement/libaws-iot-fleetwise-edge.so:x86_64 build/armeabi-v7a/src/executionmanagement/libaws-iot-fleetwise-edge.so:armeabi-v7a diff --git a/tools/install-deps-cross-android.sh b/tools/install-deps-cross-android.sh index 4a3be38a..1cc14384 100755 --- a/tools/install-deps-cross-android.sh +++ b/tools/install-deps-cross-android.sh @@ -90,8 +90,8 @@ install_deps() { --layout=system \ --arch=${TARGET_ARCH} \ --target-version=${VERSION_ANDROID_API} > /dev/null - mv build/out/${TARGET_ARCH}/lib ${INSTALL_PREFIX} - mv build/out/${TARGET_ARCH}/include ${INSTALL_PREFIX} + cp -r build/out/${TARGET_ARCH}/lib ${INSTALL_PREFIX} + cp -r build/out/${TARGET_ARCH}/include ${INSTALL_PREFIX} cd .. # Snappy @@ -235,6 +235,7 @@ ARCH_NOT_INSTALLED="false" for ARCH in ${ARCHS}; do HOST_PLATFORM=`echo $ARCH | cut -d ':' -f2` if [ ! -d /usr/local/${HOST_PLATFORM} ]; then + echo "/usr/local/${HOST_PLATFORM} does not exist, re-building" ARCH_NOT_INSTALLED="true" break fi diff --git a/tools/install-deps-cross-arm64.sh b/tools/install-deps-cross-arm64.sh index 24e58f71..406c1ee9 100755 --- a/tools/install-deps-cross-arm64.sh +++ b/tools/install-deps-cross-arm64.sh @@ -40,10 +40,29 @@ if [ "${ARCH}" == "arm64" ]; then exit -1 fi -sed -i "s/deb http/deb [arch=${ARCH}] http/g" /etc/apt/sources.list +print_file() { + echo ">>> $1: $2" + cat $2 + echo ">>>" +} + +print_file "Before patching" /etc/apt/sources.list +sed -i -E "s/deb (http|mirror\+file)/deb [arch=${ARCH}] \1/g" /etc/apt/sources.list cp /etc/apt/sources.list /etc/apt/sources.list.d/arm64.list -sed -i "s/deb \[arch=${ARCH}\] http/deb [arch=arm64] http/g" /etc/apt/sources.list.d/arm64.list -sed -i -E "s#(archive|security).ubuntu.com/ubuntu#ports.ubuntu.com/ubuntu-ports#g" /etc/apt/sources.list.d/arm64.list +sed -i -E "s/deb \[arch=${ARCH}\] (http|mirror\+file)/deb [arch=arm64] \1/g" /etc/apt/sources.list.d/arm64.list +# GitHub uses a separate mirrors file +if [ -f /etc/apt/apt-mirrors.txt ]; then + print_file "Before patching" /etc/apt/apt-mirrors.txt + cp /etc/apt/apt-mirrors.txt /etc/apt/apt-mirrors-arm64.txt + sed -i "s#/etc/apt/apt-mirrors.txt#/etc/apt/apt-mirrors-arm64.txt#g" /etc/apt/sources.list.d/arm64.list + PATCH_FILE="/etc/apt/apt-mirrors-arm64.txt" + print_file "After patching" /etc/apt/apt-mirrors-arm64.txt +else + PATCH_FILE="/etc/apt/sources.list.d/arm64.list" +fi +sed -i -E "s#(archive|security).ubuntu.com/ubuntu#ports.ubuntu.com/ubuntu-ports#g" ${PATCH_FILE} +print_file "After patching" /etc/apt/sources.list.d/arm64.list + dpkg --add-architecture arm64 apt update apt install -y \ diff --git a/tools/install-deps-cross-armhf.sh b/tools/install-deps-cross-armhf.sh index af07b531..6b4052d4 100755 --- a/tools/install-deps-cross-armhf.sh +++ b/tools/install-deps-cross-armhf.sh @@ -40,10 +40,29 @@ if [ "${ARCH}" == "armhf" ]; then exit -1 fi -sed -i "s/deb http/deb [arch=${ARCH}] http/g" /etc/apt/sources.list +print_file() { + echo ">>> $1: $2" + cat $2 + echo ">>>" +} + +print_file "Before patching" /etc/apt/sources.list +sed -i -E "s/deb (http|mirror\+file)/deb [arch=${ARCH}] \1/g" /etc/apt/sources.list cp /etc/apt/sources.list /etc/apt/sources.list.d/armhf.list -sed -i "s/deb \[arch=${ARCH}\] http/deb [arch=armhf] http/g" /etc/apt/sources.list.d/armhf.list -sed -i -E "s#(archive|security).ubuntu.com/ubuntu#ports.ubuntu.com/ubuntu-ports#g" /etc/apt/sources.list.d/armhf.list +sed -i -E "s/deb \[arch=${ARCH}\] (http|mirror\+file)/deb [arch=armhf] \1/g" /etc/apt/sources.list.d/armhf.list +# GitHub uses a separate mirrors file +if [ -f /etc/apt/apt-mirrors.txt ]; then + print_file "Before patching" /etc/apt/apt-mirrors.txt + cp /etc/apt/apt-mirrors.txt /etc/apt/apt-mirrors-armhf.txt + sed -i "s#/etc/apt/apt-mirrors.txt#/etc/apt/apt-mirrors-armhf.txt#g" /etc/apt/sources.list.d/armhf.list + PATCH_FILE="/etc/apt/apt-mirrors-armhf.txt" + print_file "After patching" /etc/apt/apt-mirrors-armhf.txt +else + PATCH_FILE="/etc/apt/sources.list.d/armhf.list" +fi +sed -i -E "s#(archive|security).ubuntu.com/ubuntu#ports.ubuntu.com/ubuntu-ports#g" ${PATCH_FILE} +print_file "After patching" /etc/apt/sources.list.d/armhf.list + dpkg --add-architecture armhf apt update apt install -y \