From 12e1f145c8045a2966b55699500583356cebc60a Mon Sep 17 00:00:00 2001 From: Philip Wiese Date: Sat, 14 Mar 2026 14:04:39 +0100 Subject: [PATCH 01/10] Fix CI --- pyproject.toml | 1 + scripts/gap9-build_sdk.sh | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3a924a22b9..607d825b21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,7 @@ readme = "README.md" requires-python = ">=3.10" dependencies = [ +'setuptools==81.0.0', 'protobuf==4.23.3', 'numpy<2.0.0', 'onnx', diff --git a/scripts/gap9-build_sdk.sh b/scripts/gap9-build_sdk.sh index 227169573a..f3b7a2c10d 100755 --- a/scripts/gap9-build_sdk.sh +++ b/scripts/gap9-build_sdk.sh @@ -23,8 +23,13 @@ if [ -d "${GAP9_SDK_INSTALL_DIR}/.git" ]; then cd "${GAP9_SDK_INSTALL_DIR}" || exit 1 git remote set-url origin "${GAP_SDK_URL}" || true else - echo "Cloning GAP9 SDK..." - GIT_LFS_SKIP_SMUDGE=1 git clone "${GAP_SDK_URL}" "${GAP9_SDK_INSTALL_DIR}" + echo "Directory exists but .git folder is missing. Reinitializing git repository..." + cd "${GAP9_SDK_INSTALL_DIR}" || exit 1 + git init + git remote add origin "${GAP_SDK_URL}" + git fetch --all --tags || true + git reset --soft "${GAP9_SDK_COMMIT_HASH}" + git add . fi cd "${GAP9_SDK_INSTALL_DIR}" || exit 1 @@ -33,6 +38,7 @@ git fetch --all --tags || true git stash || true GIT_LFS_SKIP_SMUDGE=1 git checkout "${GAP9_SDK_COMMIT_HASH}" git submodule update --init --recursive +git lfs pull --include="*.so" || true # Platform specific patch ARCH=$(dpkg --print-architecture 2>/dev/null || true) From 783328d33c39727fdb2debde5014136518188367 Mon Sep 17 00:00:00 2001 From: Philip Wiese Date: Sat, 14 Mar 2026 14:28:22 +0100 Subject: [PATCH 02/10] Use `devel` image by default --- .github/workflows/ci-platform-gap9-tiled.yml | 4 ++-- .github/workflows/ci-platform-gap9.yml | 4 ++-- .github/workflows/infra-generate-ccache-gap9.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-platform-gap9-tiled.yml b/.github/workflows/ci-platform-gap9-tiled.yml index 4a3afc717b..db48263a8d 100644 --- a/.github/workflows/ci-platform-gap9-tiled.yml +++ b/.github/workflows/ci-platform-gap9-tiled.yml @@ -17,7 +17,7 @@ name: CI • GAP9 (Tiled) docker_image_deeploy: description: "Deeploy Image to use" required: false - default: "ghcr.io/pulp-platform/deeploy-gap9:latest" + default: "ghcr.io/pulp-platform/deeploy-gap9:devel" concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -28,7 +28,7 @@ jobs: if: github.repository == 'pulp-platform/Deeploy' uses: ./.github/workflows/_select-env.yml with: - docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || github.repository == 'pulp-platform/Deeploy' && 'ghcr.io/pulp-platform/deeploy-gap9:latest'}} + docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || github.repository == 'pulp-platform/Deeploy' && 'ghcr.io/pulp-platform/deeploy-gap9:devel'}} gap9-kernels-tiled-singlebuffer-L2: needs: select-env diff --git a/.github/workflows/ci-platform-gap9.yml b/.github/workflows/ci-platform-gap9.yml index e9a59b4927..4249aa15a1 100644 --- a/.github/workflows/ci-platform-gap9.yml +++ b/.github/workflows/ci-platform-gap9.yml @@ -17,7 +17,7 @@ name: CI • GAP9 docker_image_deeploy: description: "Deeploy Image to use" required: false - default: "ghcr.io/pulp-platform/deeploy-gap9:latest" + default: "ghcr.io/pulp-platform/deeploy-gap9:devel" concurrency: @@ -29,7 +29,7 @@ jobs: if: github.repository == 'pulp-platform/Deeploy' uses: ./.github/workflows/_select-env.yml with: - docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || (github.repository == 'pulp-platform/Deeploy' && 'ghcr.io/pulp-platform/deeploy-gap9:latest') }} + docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || (github.repository == 'pulp-platform/Deeploy' && 'ghcr.io/pulp-platform/deeploy-gap9:devel') }} gap9-kernels: needs: select-env diff --git a/.github/workflows/infra-generate-ccache-gap9.yml b/.github/workflows/infra-generate-ccache-gap9.yml index 038789ce40..8946311334 100644 --- a/.github/workflows/infra-generate-ccache-gap9.yml +++ b/.github/workflows/infra-generate-ccache-gap9.yml @@ -11,7 +11,7 @@ name: Infrastructure • Generate CCache GAP9 docker_image_deeploy: description: "Deeploy GAP9 Image to use" required: false - default: "ghcr.io/pulp-platform/deeploy-gap9:latest" + default: "ghcr.io/pulp-platform/deeploy-gap9:devel" schedule: # Runs the workflow on the default branch every day at 2AM CET to keep the cache fresh - cron: "0 2 * * *" @@ -21,7 +21,7 @@ jobs: if: github.repository == 'pulp-platform/Deeploy' runs-on: ubuntu-latest container: - image: ${{ github.event.inputs.docker_image_deeploy || 'ghcr.io/pulp-platform/deeploy-gap9:latest' }} + image: ${{ github.event.inputs.docker_image_deeploy || 'ghcr.io/pulp-platform/deeploy-gap9:devel' }} steps: - name: Checkout Repo uses: actions/checkout@v4 From 6dfddff5309b4a09361e0139e067bbe8019ca0e1 Mon Sep 17 00:00:00 2001 From: Philip Wiese Date: Sat, 14 Mar 2026 14:39:20 +0100 Subject: [PATCH 03/10] Update README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 261d46bfec..d986f1426e 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,8 @@ Now you can open the generated code in `DeeployTest/TEST_SIRACUSA/Tests/testMatM | **Snitch Cluster** | [Snitch paper](https://arxiv.org/abs/2002.10143) | [GVSoC](https://github.com/gvsoc/gvsoc) | [![CI • Snitch](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-snitch.yml/badge.svg)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-snitch.yml) [![CI • Snitch (Tiled)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-snitch-tiled.yml/badge.svg)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-snitch-tiled.yml) | **SoftHier** | [Repo](https://github.com/gvsoc/gvsoc/tree/soft_hier_release) | [GVSoC](https://github.com/gvsoc/gvsoc/tree/soft_hier_release) | [![CI • SoftHier](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-softhier.yml/badge.svg)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-softhier.yml) | **Chimera** | [Repo](https://github.com/pulp-platform/chimera) | [GVSoC](https://github.com/gvsoc/gvsoc) | [![CI • Chimera](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-chimera.yml/badge.svg)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-chimera.yml) +| **GAP9** | [Repo](https://github.com/pulp-platform/gap-sdk) | [GVSoC](https://github.com/pulp-platform/gap-sdk) | [![CI • GAP9](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-gap9.yml/badge.svg)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-gap9.yml) [![CI • GAP9 (Tiled)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-gap9-tiled.yml/badge.svg)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-gap9-tiled.yml) + ## Publications From d7cb6858ff1ae38567d49ac46badca52e1218532 Mon Sep 17 00:00:00 2001 From: Philip Wiese Date: Sat, 14 Mar 2026 15:01:26 +0100 Subject: [PATCH 04/10] Fix GAP9 SDK Build --- scripts/gap9-build_sdk.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/scripts/gap9-build_sdk.sh b/scripts/gap9-build_sdk.sh index f3b7a2c10d..51bb97e69f 100755 --- a/scripts/gap9-build_sdk.sh +++ b/scripts/gap9-build_sdk.sh @@ -23,13 +23,19 @@ if [ -d "${GAP9_SDK_INSTALL_DIR}/.git" ]; then cd "${GAP9_SDK_INSTALL_DIR}" || exit 1 git remote set-url origin "${GAP_SDK_URL}" || true else - echo "Directory exists but .git folder is missing. Reinitializing git repository..." - cd "${GAP9_SDK_INSTALL_DIR}" || exit 1 - git init - git remote add origin "${GAP_SDK_URL}" - git fetch --all --tags || true - git reset --soft "${GAP9_SDK_COMMIT_HASH}" - git add . + if [ ! -d "${GAP9_SDK_INSTALL_DIR}" ]; then + echo "Directory ${GAP9_SDK_INSTALL_DIR} does not exist. Cloning fresh..." + git clone "${GAP_SDK_URL}" "${GAP9_SDK_INSTALL_DIR}" + cd "${GAP9_SDK_INSTALL_DIR}" || exit 1 + else + echo "Directory exists but .git folder is missing. Reinitializing git repository..." + cd "${GAP9_SDK_INSTALL_DIR}" || exit 1 + git init + git remote add origin "${GAP_SDK_URL}" + git fetch --all --tags || true + git reset --soft "${GAP9_SDK_COMMIT_HASH}" + git add . + fi fi cd "${GAP9_SDK_INSTALL_DIR}" || exit 1 From 96adefb70b0e55476ba23c3fe09160ae9bbb1de7 Mon Sep 17 00:00:00 2001 From: Philip Wiese Date: Sat, 14 Mar 2026 15:46:18 +0100 Subject: [PATCH 05/10] Temporarily switch GAP9 Docker image --- .github/workflows/ci-platform-gap9-tiled.yml | 5 ++--- .github/workflows/ci-platform-gap9.yml | 5 ++--- .github/workflows/infra-generate-ccache-gap9.yml | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-platform-gap9-tiled.yml b/.github/workflows/ci-platform-gap9-tiled.yml index db48263a8d..3819b30d24 100644 --- a/.github/workflows/ci-platform-gap9-tiled.yml +++ b/.github/workflows/ci-platform-gap9-tiled.yml @@ -17,7 +17,7 @@ name: CI • GAP9 (Tiled) docker_image_deeploy: description: "Deeploy Image to use" required: false - default: "ghcr.io/pulp-platform/deeploy-gap9:devel" + default: "ghcr.io/xeratec/deeploy-gap9:fix_ci" concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -25,10 +25,9 @@ concurrency: jobs: select-env: - if: github.repository == 'pulp-platform/Deeploy' uses: ./.github/workflows/_select-env.yml with: - docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || github.repository == 'pulp-platform/Deeploy' && 'ghcr.io/pulp-platform/deeploy-gap9:devel'}} + docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || github.repository == 'pulp-platform/Deeploy' && 'ghcr.io/xeratec/deeploy-gap9:fix_ci'}} gap9-kernels-tiled-singlebuffer-L2: needs: select-env diff --git a/.github/workflows/ci-platform-gap9.yml b/.github/workflows/ci-platform-gap9.yml index 4249aa15a1..7a452ddff0 100644 --- a/.github/workflows/ci-platform-gap9.yml +++ b/.github/workflows/ci-platform-gap9.yml @@ -17,7 +17,7 @@ name: CI • GAP9 docker_image_deeploy: description: "Deeploy Image to use" required: false - default: "ghcr.io/pulp-platform/deeploy-gap9:devel" + default: "ghcr.io/xeratec/deeploy-gap9:fix_ci" concurrency: @@ -26,10 +26,9 @@ concurrency: jobs: select-env: - if: github.repository == 'pulp-platform/Deeploy' uses: ./.github/workflows/_select-env.yml with: - docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || (github.repository == 'pulp-platform/Deeploy' && 'ghcr.io/pulp-platform/deeploy-gap9:devel') }} + docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || (github.repository == 'pulp-platform/Deeploy' && 'ghcr.io/xeratec/deeploy-gap9:fix_ci') }} gap9-kernels: needs: select-env diff --git a/.github/workflows/infra-generate-ccache-gap9.yml b/.github/workflows/infra-generate-ccache-gap9.yml index 8946311334..b3f1bbccd2 100644 --- a/.github/workflows/infra-generate-ccache-gap9.yml +++ b/.github/workflows/infra-generate-ccache-gap9.yml @@ -11,7 +11,7 @@ name: Infrastructure • Generate CCache GAP9 docker_image_deeploy: description: "Deeploy GAP9 Image to use" required: false - default: "ghcr.io/pulp-platform/deeploy-gap9:devel" + default: "ghcr.io/xeratec/deeploy-gap9:fix_ci" schedule: # Runs the workflow on the default branch every day at 2AM CET to keep the cache fresh - cron: "0 2 * * *" @@ -21,7 +21,7 @@ jobs: if: github.repository == 'pulp-platform/Deeploy' runs-on: ubuntu-latest container: - image: ${{ github.event.inputs.docker_image_deeploy || 'ghcr.io/pulp-platform/deeploy-gap9:devel' }} + image: ${{ github.event.inputs.docker_image_deeploy || 'ghcr.io/xeratec/deeploy-gap9:fix_ci' }} steps: - name: Checkout Repo uses: actions/checkout@v4 From 571f40bd42a9a773b9768caa5c4df2d873fb3564 Mon Sep 17 00:00:00 2001 From: Philip Wiese Date: Sat, 14 Mar 2026 15:33:37 +0100 Subject: [PATCH 06/10] Add Changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9b5fe888a..d0ba1ac79d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ This file contains the changelog for the Deeploy project. The changelog is divid ### List of Pull Requests +- Fix Broken CI [#175](https://github.com/pulp-platform/Deeploy/pull/175) - Improve Docstring and Debugging [#160](https://github.com/pulp-platform/Deeploy/pull/160) - Add GAP9 Container Support [#163](https://github.com/pulp-platform/Deeploy/pull/163) - Extend Codeowners [#164](https://github.com/pulp-platform/Deeploy/pull/164) @@ -23,6 +24,8 @@ This file contains the changelog for the Deeploy project. The changelog is divid - Added GAP9 Platform Support: Deployer, Bindings, Templates, Tiler, DMA (L3Dma/MchanDma), target library, CI workflows ### Changed +- Use by default `devel` container for GAP9 CI +- Extend Readme platforms with GAP9 shields - Move `MemoryAwareClosureGeneration` pass to `MemoryLevelExtension` - Move `MemoryAwarePrint*` passes to `MemoryLevelExtension` - Make `sizeInBytes` a class property instead of a function @@ -35,6 +38,8 @@ This file contains the changelog for the Deeploy project. The changelog is divid - Added @runwangdl as a code owner ### Fixed +- Fix Docker flow to fetch `*.so` git lfs files +- Downgrade `setuptools` to `81.0.0` - im2col buffer size in Conv1d template - Fix missing dependency in pre-commit-config - Fix test paths in Deeploy 101 tutorial From a3cacd539e206792fe5df1a8ac7968a604172088 Mon Sep 17 00:00:00 2001 From: Philip Wiese Date: Sat, 14 Mar 2026 15:52:39 +0100 Subject: [PATCH 07/10] Fix GAP9 Docker selection --- .github/workflows/ci-platform-gap9-tiled.yml | 2 +- .github/workflows/ci-platform-gap9.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-platform-gap9-tiled.yml b/.github/workflows/ci-platform-gap9-tiled.yml index 3819b30d24..55acfb34a8 100644 --- a/.github/workflows/ci-platform-gap9-tiled.yml +++ b/.github/workflows/ci-platform-gap9-tiled.yml @@ -27,7 +27,7 @@ jobs: select-env: uses: ./.github/workflows/_select-env.yml with: - docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || github.repository == 'pulp-platform/Deeploy' && 'ghcr.io/xeratec/deeploy-gap9:fix_ci'}} + docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || 'ghcr.io/xeratec/deeploy-gap9:fix_ci' }} gap9-kernels-tiled-singlebuffer-L2: needs: select-env diff --git a/.github/workflows/ci-platform-gap9.yml b/.github/workflows/ci-platform-gap9.yml index 7a452ddff0..60c8720654 100644 --- a/.github/workflows/ci-platform-gap9.yml +++ b/.github/workflows/ci-platform-gap9.yml @@ -28,7 +28,7 @@ jobs: select-env: uses: ./.github/workflows/_select-env.yml with: - docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || (github.repository == 'pulp-platform/Deeploy' && 'ghcr.io/xeratec/deeploy-gap9:fix_ci') }} + docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || 'ghcr.io/xeratec/deeploy-gap9:fix_ci' }} gap9-kernels: needs: select-env From 9dfc38a028bf6f095928331dd516133c4a2a9160 Mon Sep 17 00:00:00 2001 From: Philip Wiese Date: Mon, 16 Mar 2026 13:03:15 +0100 Subject: [PATCH 08/10] Revert custom Docker image --- .github/workflows/ci-platform-gap9-tiled.yml | 4 ++-- .github/workflows/ci-platform-gap9.yml | 4 ++-- .github/workflows/infra-generate-ccache-gap9.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-platform-gap9-tiled.yml b/.github/workflows/ci-platform-gap9-tiled.yml index 55acfb34a8..61cab4ea70 100644 --- a/.github/workflows/ci-platform-gap9-tiled.yml +++ b/.github/workflows/ci-platform-gap9-tiled.yml @@ -17,7 +17,7 @@ name: CI • GAP9 (Tiled) docker_image_deeploy: description: "Deeploy Image to use" required: false - default: "ghcr.io/xeratec/deeploy-gap9:fix_ci" + default: "ghcr.io/pulp-platform/deeploy-gap9:devel" concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -27,7 +27,7 @@ jobs: select-env: uses: ./.github/workflows/_select-env.yml with: - docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || 'ghcr.io/xeratec/deeploy-gap9:fix_ci' }} + docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || 'ghcr.io/pulp-platform/deeploy-gap9:devel' }} gap9-kernels-tiled-singlebuffer-L2: needs: select-env diff --git a/.github/workflows/ci-platform-gap9.yml b/.github/workflows/ci-platform-gap9.yml index 60c8720654..014828d6ce 100644 --- a/.github/workflows/ci-platform-gap9.yml +++ b/.github/workflows/ci-platform-gap9.yml @@ -17,7 +17,7 @@ name: CI • GAP9 docker_image_deeploy: description: "Deeploy Image to use" required: false - default: "ghcr.io/xeratec/deeploy-gap9:fix_ci" + default: "ghcr.io/pulp-platform/deeploy-gap9:devel" concurrency: @@ -28,7 +28,7 @@ jobs: select-env: uses: ./.github/workflows/_select-env.yml with: - docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || 'ghcr.io/xeratec/deeploy-gap9:fix_ci' }} + docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || 'ghcr.io/pulp-platform/deeploy-gap9:devel' }} gap9-kernels: needs: select-env diff --git a/.github/workflows/infra-generate-ccache-gap9.yml b/.github/workflows/infra-generate-ccache-gap9.yml index b3f1bbccd2..8946311334 100644 --- a/.github/workflows/infra-generate-ccache-gap9.yml +++ b/.github/workflows/infra-generate-ccache-gap9.yml @@ -11,7 +11,7 @@ name: Infrastructure • Generate CCache GAP9 docker_image_deeploy: description: "Deeploy GAP9 Image to use" required: false - default: "ghcr.io/xeratec/deeploy-gap9:fix_ci" + default: "ghcr.io/pulp-platform/deeploy-gap9:devel" schedule: # Runs the workflow on the default branch every day at 2AM CET to keep the cache fresh - cron: "0 2 * * *" @@ -21,7 +21,7 @@ jobs: if: github.repository == 'pulp-platform/Deeploy' runs-on: ubuntu-latest container: - image: ${{ github.event.inputs.docker_image_deeploy || 'ghcr.io/xeratec/deeploy-gap9:fix_ci' }} + image: ${{ github.event.inputs.docker_image_deeploy || 'ghcr.io/pulp-platform/deeploy-gap9:devel' }} steps: - name: Checkout Repo uses: actions/checkout@v4 From fbfa91e761b30fc515c977a7c968b3acd2832e04 Mon Sep 17 00:00:00 2001 From: Philip Wiese Date: Mon, 16 Mar 2026 13:03:26 +0100 Subject: [PATCH 09/10] Implement PR feedback --- scripts/gap9-build_sdk.sh | 82 +++++++++++++++++++++------------------ 1 file changed, 45 insertions(+), 37 deletions(-) diff --git a/scripts/gap9-build_sdk.sh b/scripts/gap9-build_sdk.sh index 51bb97e69f..8f1662cdcc 100755 --- a/scripts/gap9-build_sdk.sh +++ b/scripts/gap9-build_sdk.sh @@ -5,48 +5,48 @@ # SPDX-License-Identifier: Apache-2.0 # gap9-build_sdk.sh -# Helper script to clone, patch and build the GAP9 SDK. Intended to be -# invoked from the Makefile with environment variables set: -# GAP9_SDK_INSTALL_DIR (required) -# GAP9_SDK_COMMIT_HASH (optional, fallback provided) -# ROOT_DIR (optional, defaults to script dir) +# +# Clone, prepare, patch, and build a GAP9 SDK checkout in place. +# This script is intended to be called from the project Makefile. +# +# Environment variables: +# GAP9_SDK_INSTALL_DIR Required. Target directory for the SDK checkout/build. +# GAP9_SDK_COMMIT_HASH Required. Commit to checkout. +# GAP_SDK_URL Required. Git remote used for fetching the SDK. +# ROOT_DIR Optional. Base directory for patch lookup. +# Default: directory of this script. ROOT_DIR="${ROOT_DIR:-$(cd "$(dirname "$0")" && pwd)}" GAP9_SDK_INSTALL_DIR="${GAP9_SDK_INSTALL_DIR:?GAP9_SDK_INSTALL_DIR must be set}" -GAP9_SDK_COMMIT_HASH="${GAP9_SDK_COMMIT_HASH:-897955d7ab326bd31684429eb16a2e485ab89afb}" -GAP_SDK_URL="${GAP_SDK_URL:-git@iis-git.ee.ethz.ch:wiesep/gap9_sdk.git}" +GAP9_SDK_COMMIT_HASH="${GAP9_SDK_COMMIT_HASH:?GAP9_SDK_COMMIT_HASH must be set}" +GAP_SDK_URL="${GAP_SDK_URL:?GAP_SDK_URL must be set}" echo "Preparing GAP9 SDK in: ${GAP9_SDK_INSTALL_DIR}" +mkdir -p "${GAP9_SDK_INSTALL_DIR}" +cd "${GAP9_SDK_INSTALL_DIR}" -if [ -d "${GAP9_SDK_INSTALL_DIR}/.git" ]; then - echo "Directory ${GAP9_SDK_INSTALL_DIR} already exists and looks like a git repo. Updating remote URL and fetching latest changes..." - cd "${GAP9_SDK_INSTALL_DIR}" || exit 1 - git remote set-url origin "${GAP_SDK_URL}" || true +if [ ! -d ".git" ]; then + # Support reusing a pre-created directory that is not yet a git repo. + echo "Directory exists but .git folder is missing. Reinitializing git repository..." + git init + git remote add origin "${GAP_SDK_URL}" + git fetch --depth=1 origin ${GAP9_SDK_COMMIT_HASH} + GIT_LFS_SKIP_SMUDGE=1 git reset --hard "${GAP9_SDK_COMMIT_HASH}" else - if [ ! -d "${GAP9_SDK_INSTALL_DIR}" ]; then - echo "Directory ${GAP9_SDK_INSTALL_DIR} does not exist. Cloning fresh..." - git clone "${GAP_SDK_URL}" "${GAP9_SDK_INSTALL_DIR}" - cd "${GAP9_SDK_INSTALL_DIR}" || exit 1 - else - echo "Directory exists but .git folder is missing. Reinitializing git repository..." - cd "${GAP9_SDK_INSTALL_DIR}" || exit 1 - git init - git remote add origin "${GAP_SDK_URL}" - git fetch --all --tags || true - git reset --soft "${GAP9_SDK_COMMIT_HASH}" - git add . - fi + # Keep local uncommitted changes out of the way before checkout. + echo "Setting remote URL and fetching latest changes..." + git remote set-url origin "${GAP_SDK_URL}" + git fetch --depth=1 origin ${GAP9_SDK_COMMIT_HASH} + git add . + git stash fi -cd "${GAP9_SDK_INSTALL_DIR}" || exit 1 echo "Checking out commit ${GAP9_SDK_COMMIT_HASH} (stash and fetch if necessary)" -git fetch --all --tags || true -git stash || true GIT_LFS_SKIP_SMUDGE=1 git checkout "${GAP9_SDK_COMMIT_HASH}" git submodule update --init --recursive -git lfs pull --include="*.so" || true +git lfs pull --include="*.so" -# Platform specific patch +# Select platform patch by Debian arch first, then uname fallback. ARCH=$(dpkg --print-architecture 2>/dev/null || true) if [ -z "$ARCH" ]; then ARCH=$(uname -m) @@ -57,14 +57,22 @@ arm64 | aarch64) PATCH=gap9-arm64.patch ;; *) PATCH= ;; esac -set -e # Enable strict error handling for the build process -if [ -n "$PATCH" ] && [ -f "${ROOT_DIR}/${PATCH}" ]; then - echo "Applying platform patch: $PATCH" - git apply "${ROOT_DIR}/${PATCH}" +set -e # Fail fast for patch/build operations. +if [ -n "$PATCH" ]; then + if [ -f "${ROOT_DIR}/${PATCH}" ]; then + echo "Applying platform patch from ${ROOT_DIR}: $PATCH" + git apply "${ROOT_DIR}/${PATCH}" + elif [ -f "${ROOT_DIR}/Container/${PATCH}" ]; then + echo "Applying platform patch from ${ROOT_DIR}/Container: $PATCH" + git apply "${ROOT_DIR}/Container/${PATCH}" + else + echo "No platform-specific patch to apply for architecture '$ARCH' (looked for ${ROOT_DIR}/${PATCH} and ${ROOT_DIR}/Container/${PATCH})" + fi else - echo "No platform-specific patch to apply for architecture '$ARCH' (looked for ${ROOT_DIR}/${PATCH})" + echo "No platform-specific patch to apply for architecture '$ARCH'" fi -set +e # Disable strict error handling to allow deactivation even if build fails + +set +e # Relax mode so cleanup/deactivate still runs on non-critical failures. echo "Setting up Python virtual environment and installing dependencies" python -m venv .gap9-venv @@ -74,9 +82,9 @@ echo "Sourcing GAP9 SDK environment" . configs/gap9_evk_audio.sh || true echo "Invoking make install_dependency cmake_sdk.build" -set -e # Enable strict error handling for the build process +set -e # Build must stop immediately on errors. make install_dependency cmake_sdk.build openocd.all autotiler.all -set +e # Disable strict error handling to allow deactivation even if build fails +set +e # Allow deactivation even if previous step failed. deactivate From 1f7db8151f879863248e983344e5914b432e2116 Mon Sep 17 00:00:00 2001 From: Philip Wiese Date: Mon, 16 Mar 2026 14:49:54 +0100 Subject: [PATCH 10/10] Implement AI feedback --- scripts/gap9-build_sdk.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/gap9-build_sdk.sh b/scripts/gap9-build_sdk.sh index 8f1662cdcc..8fc88dadb5 100755 --- a/scripts/gap9-build_sdk.sh +++ b/scripts/gap9-build_sdk.sh @@ -23,7 +23,8 @@ GAP_SDK_URL="${GAP_SDK_URL:?GAP_SDK_URL must be set}" echo "Preparing GAP9 SDK in: ${GAP9_SDK_INSTALL_DIR}" mkdir -p "${GAP9_SDK_INSTALL_DIR}" -cd "${GAP9_SDK_INSTALL_DIR}" +# Fail if CD fails, e.g. due to missing permissions or if the path is a file. +cd "${GAP9_SDK_INSTALL_DIR}" || exit 1 if [ ! -d ".git" ]; then # Support reusing a pre-created directory that is not yet a git repo. @@ -38,7 +39,7 @@ else git remote set-url origin "${GAP_SDK_URL}" git fetch --depth=1 origin ${GAP9_SDK_COMMIT_HASH} git add . - git stash + git stash || true # Stash may fail if there are no changes, ignore that. fi echo "Checking out commit ${GAP9_SDK_COMMIT_HASH} (stash and fetch if necessary)"