From 222db76200e254c971426a781591003ee78146cf Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Sun, 1 Feb 2026 13:52:55 -0300 Subject: [PATCH 01/28] refactor this test testing woo waa waewewe waowowoewewahaaswadisadasud Updated comments and modified build steps in the GitHub Actions workflow. --- .github/workflows/build.yml | 109 ++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..090f233d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,109 @@ +name: Build Horizon OC Zeus + +on: + push: + branches: [ develop, main, master ] + pull_request: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + # Minimal devkitA64 container, apparently dkp-toolchain isn't needed? + container: + image: devkitpro/devkita64:latest + + steps: + - name: Checkout repository and submodules # why are we doing this? I don't think we use submodules but memory doesn't serve so let's keep it + uses: actions/checkout@v4 + with: + submodules: recursive + + # ------------------------------------------------- + # Fix PATH for devkitA64 and devkitARM + # ------------------------------------------------- + - name: Set devkitPro PATH + run: | + export DEVKITPRO=/opt/devkitpro + export DEVKITA64=$DEVKITPRO/devkitA64 + export DEVKITARM=$DEVKITPRO/devkitARM + export PATH=$DEVKITA64/bin:$DEVKITARM/bin:$PATH + aarch64-none-elf-gcc --version + arm-none-eabi-gcc --version + shell: bash + + - name: + run: apt install ccache -y + shell: bash + + # ------------------------------------------------- + # Get short commit SHA + # ------------------------------------------------- + - name: Set commit SHA + id: vars + run: echo "SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV + + # ------------------------------------------------- + # Clone Atmosphère + # ------------------------------------------------- + - name: Clone Atmosphere + run: git clone https://github.com/Atmosphere-NX/Atmosphere.git atmosphere + + # ------------------------------------------------- + # Clone Horizon OC (develop branch) kinda suspicious for now, shouldn't it just already be cloned on the actions runner? + # ------------------------------------------------- + #- name: Clone Horizon OC + # run: git clone -b develop --single-branch https://github.com/Horizon-OC/Horizon-OC.git horizon-oc + + # ------------------------------------------------- + # Prepare build folder + # ------------------------------------------------- + - name: Prepare build folder + run: | + mkdir -p build + cp -r atmosphere/ build/ + + # ------------------------------------------------- + # Override loader source + # ------------------------------------------------- + - name: Override ldr_process_creation.cpp + run: | + cp -f Source/Atmosphere/stratosphere/loader/source/ldr_process_creation.cpp \ + build/stratosphere/loader/source/ldr_process_creation.cpp + + # ------------------------------------------------- + # Build Horizon OC Zeus (trying ccache, directly invoking make instead, hacky) + # ------------------------------------------------- + #- name: Build Horizon OC Zeus + # working-directory: horizon-oc + # run: | + # chmod +x build.sh + # ./build.sh + - name: Build (try) + working-directory: build/stratosphere/loader + run: | # I forgot what dkp uses + make -n | grep -E "gcc|g\+\+|clang" + ccache make -j$(($(nproc) * 2)) + hactool -t kip1 out/nintendo_nx_arm64_armv8a/release/loader.kip --uncompress=hoc.kip + cp build/stratosphere/loader/hoc.kip dist/atmosphere/kips/hoc.kip + + + # ------------------------------------------------- + # Package dist folder as ZIP with commit SHA + # ------------------------------------------------- + - name: Package dist + # working-directory: horizon-oc + run: | + ZIP_NAME="horizon-oc-zeus-dist-${SHORT_SHA}.zip" + zip -r "$ZIP_NAME" dist + echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_ENV + + # ------------------------------------------------- + # Upload ZIP artifact + # ------------------------------------------------- + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: horizon-oc-zeus-dist + path: horizon-oc/${{ env.ZIP_NAME }} From ae0f4c796362714b976ccf1b9f28713547c1f301 Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Sun, 1 Feb 2026 13:54:21 -0300 Subject: [PATCH 02/28] Delete .github/workflows/build.yml --- .github/workflows/build.yml | 109 ------------------------------------ 1 file changed, 109 deletions(-) delete mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 090f233d..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,109 +0,0 @@ -name: Build Horizon OC Zeus - -on: - push: - branches: [ develop, main, master ] - pull_request: - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - - # Minimal devkitA64 container, apparently dkp-toolchain isn't needed? - container: - image: devkitpro/devkita64:latest - - steps: - - name: Checkout repository and submodules # why are we doing this? I don't think we use submodules but memory doesn't serve so let's keep it - uses: actions/checkout@v4 - with: - submodules: recursive - - # ------------------------------------------------- - # Fix PATH for devkitA64 and devkitARM - # ------------------------------------------------- - - name: Set devkitPro PATH - run: | - export DEVKITPRO=/opt/devkitpro - export DEVKITA64=$DEVKITPRO/devkitA64 - export DEVKITARM=$DEVKITPRO/devkitARM - export PATH=$DEVKITA64/bin:$DEVKITARM/bin:$PATH - aarch64-none-elf-gcc --version - arm-none-eabi-gcc --version - shell: bash - - - name: - run: apt install ccache -y - shell: bash - - # ------------------------------------------------- - # Get short commit SHA - # ------------------------------------------------- - - name: Set commit SHA - id: vars - run: echo "SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV - - # ------------------------------------------------- - # Clone Atmosphère - # ------------------------------------------------- - - name: Clone Atmosphere - run: git clone https://github.com/Atmosphere-NX/Atmosphere.git atmosphere - - # ------------------------------------------------- - # Clone Horizon OC (develop branch) kinda suspicious for now, shouldn't it just already be cloned on the actions runner? - # ------------------------------------------------- - #- name: Clone Horizon OC - # run: git clone -b develop --single-branch https://github.com/Horizon-OC/Horizon-OC.git horizon-oc - - # ------------------------------------------------- - # Prepare build folder - # ------------------------------------------------- - - name: Prepare build folder - run: | - mkdir -p build - cp -r atmosphere/ build/ - - # ------------------------------------------------- - # Override loader source - # ------------------------------------------------- - - name: Override ldr_process_creation.cpp - run: | - cp -f Source/Atmosphere/stratosphere/loader/source/ldr_process_creation.cpp \ - build/stratosphere/loader/source/ldr_process_creation.cpp - - # ------------------------------------------------- - # Build Horizon OC Zeus (trying ccache, directly invoking make instead, hacky) - # ------------------------------------------------- - #- name: Build Horizon OC Zeus - # working-directory: horizon-oc - # run: | - # chmod +x build.sh - # ./build.sh - - name: Build (try) - working-directory: build/stratosphere/loader - run: | # I forgot what dkp uses - make -n | grep -E "gcc|g\+\+|clang" - ccache make -j$(($(nproc) * 2)) - hactool -t kip1 out/nintendo_nx_arm64_armv8a/release/loader.kip --uncompress=hoc.kip - cp build/stratosphere/loader/hoc.kip dist/atmosphere/kips/hoc.kip - - - # ------------------------------------------------- - # Package dist folder as ZIP with commit SHA - # ------------------------------------------------- - - name: Package dist - # working-directory: horizon-oc - run: | - ZIP_NAME="horizon-oc-zeus-dist-${SHORT_SHA}.zip" - zip -r "$ZIP_NAME" dist - echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_ENV - - # ------------------------------------------------- - # Upload ZIP artifact - # ------------------------------------------------- - - name: Upload build artifact - uses: actions/upload-artifact@v4 - with: - name: horizon-oc-zeus-dist - path: horizon-oc/${{ env.ZIP_NAME }} From 8dcfb55646240a424f7ce5f8a451962cd83d481e Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:15:59 -0300 Subject: [PATCH 03/28] retry cache and actions cache --- .github/workflows/build.yml | 130 ++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..5b9f6fd5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,130 @@ +name: Build Horizon OC Zeus + +on: + push: + branches: [ develop, main, master ] + pull_request: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + # Minimal devkitA64 container, apparently dkp-toolchain isn't needed? + container: + image: devkitpro/devkita64:latest + + steps: + - name: Checkout repository and submodules # why are we doing this? I don't think we use submodules but memory doesn't serve so let's keep it + uses: actions/checkout@v4 + with: + submodules: recursive + + + # ------------------------------------------------- + # Fix PATH for devkitA64 and devkitARM + # ------------------------------------------------- + - name: Set devkitPro PATH + run: | + export DEVKITPRO=/opt/devkitpro + export DEVKITA64=$DEVKITPRO/devkitA64 + export DEVKITARM=$DEVKITPRO/devkitARM + export PATH=$DEVKITA64/bin:$DEVKITARM/bin:$PATH + aarch64-none-elf-gcc --version + arm-none-eabi-gcc --version + shell: bash + + - name: + run: apt install ccache -y + shell: bash + + # ------------------------------------------------- + # Get short commit SHA + # ------------------------------------------------- + - name: Set commit SHA + id: vars + run: echo "SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV + + # ------------------------------------------------- + # Clone Atmosphère + # ------------------------------------------------- + - name: Clone Atmosphere + run: git clone https://github.com/Atmosphere-NX/Atmosphere.git atmosphere + + # ------------------------------------------------- + # Clone Horizon OC (develop branch) kinda suspicious for now, shouldn't it just already be cloned on the actions runner? + # ------------------------------------------------- + #- name: Clone Horizon OC + # run: git clone -b develop --single-branch https://github.com/Horizon-OC/Horizon-OC.git horizon-oc + + # ------------------------------------------------- + # Prepare build folder + # ------------------------------------------------- + - name: Prepare build folder + run: | + mkdir -p build + cp -r atmosphere/ build/ + + # ------------------------------------------------- + # Override loader source + # ------------------------------------------------- + - name: Override ldr_process_creation.cpp + run: | + cp -f Source/Atmosphere/stratosphere/loader/source/ldr_process_creation.cpp \ + build/stratosphere/loader/source/ldr_process_creation.cpp + + # ------------------------------------------------- + # Build Horizon OC Zeus (trying ccache, directly invoking make instead, hacky) + # ------------------------------------------------- + #- name: Build Horizon OC Zeus + # working-directory: horizon-oc + # run: | + # chmod +x build.sh + # ./build.sh + - name: Cache ccache + uses: actions/cache@v4 + with: + path: /root/.cache/ccache + key: ccache-${{ runner.os }}-devkitpro-${{ hashFiles('**/Makefile', '**/*.mk') }} + restore-keys: | + ccache-${{ runner.os }}-devkitpro- + + - name: Configure ccache + run: | + export CCACHE_DIR=/root/.cache/ccache + echo "CCACHE_DIR=/root/.cache/ccache" >> $GITHUB_ENV + ccache --set-config=max_size=10G + ccache --set-config=compiler_check=content + ccache --zero-stats + + - name: Build (try) + working-directory: build/stratosphere/loader + run: | # I forgot what dkp uses + export CC="ccache aarch64-none-elf-gcc" + export CXX="ccache aarch64-none-elf-g++" + ccache make -j$(($(nproc) * 2)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc + hactool -t kip1 out/nintendo_nx_arm64_armv8a/release/loader.kip --uncompress=hoc.kip + cp build/stratosphere/loader/hoc.kip dist/atmosphere/kips/hoc.kip + + - name: ccache stats + run: ccache --show-stats + + + # ------------------------------------------------- + # Package dist folder as ZIP with commit SHA + # ------------------------------------------------- + - name: Package dist + # working-directory: horizon-oc + run: | + ZIP_NAME="horizon-oc-zeus-dist-${SHORT_SHA}.zip" + zip -r "$ZIP_NAME" dist + echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_ENV + + # ------------------------------------------------- + # Upload ZIP artifact + # ------------------------------------------------- + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: horizon-oc-zeus-dist + path: horizon-oc/${{ env.ZIP_NAME }} From bbd3b1a0fc4656bfdc9ae6782c29429885ac9d28 Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:22:31 -0300 Subject: [PATCH 04/28] Refactor build.yml for environment setup and ccache Updated the build workflow to set environment variables using GitHub Actions environment files and improved the ccache installation step. --- .github/workflows/build.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5b9f6fd5..206e0000 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,16 +26,18 @@ jobs: # ------------------------------------------------- - name: Set devkitPro PATH run: | - export DEVKITPRO=/opt/devkitpro - export DEVKITA64=$DEVKITPRO/devkitA64 - export DEVKITARM=$DEVKITPRO/devkitARM - export PATH=$DEVKITA64/bin:$DEVKITARM/bin:$PATH + echo "DEVKITPRO=/opt/devkitpro" >> $GITHUB_ENV + echo "DEVKITA64=/opt/devkitpro/devkitA64" >> $GITHUB_ENV + echo "DEVKITARM=/opt/devkitpro/devkitARM" >> $GITHUB_ENV + echo "PATH=/opt/devkitpro/devkitA64/bin:/opt/devkitpro/devkitARM/bin:$PATH" >> $GITHUB_ENV aarch64-none-elf-gcc --version arm-none-eabi-gcc --version shell: bash - - name: - run: apt install ccache -y + - name: Install ccache + run: | + apt-get update + apt-get install -y ccache shell: bash # ------------------------------------------------- @@ -63,7 +65,7 @@ jobs: - name: Prepare build folder run: | mkdir -p build - cp -r atmosphere/ build/ + cp -r atmosphere/* build/ # ------------------------------------------------- # Override loader source @@ -102,7 +104,7 @@ jobs: run: | # I forgot what dkp uses export CC="ccache aarch64-none-elf-gcc" export CXX="ccache aarch64-none-elf-g++" - ccache make -j$(($(nproc) * 2)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc + make -j$(($(nproc) * 2)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc hactool -t kip1 out/nintendo_nx_arm64_armv8a/release/loader.kip --uncompress=hoc.kip cp build/stratosphere/loader/hoc.kip dist/atmosphere/kips/hoc.kip From e2ef52e0951a161377e349bac62990490022fe32 Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:25:15 -0300 Subject: [PATCH 05/28] Update build.yml --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 206e0000..8caf1834 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,9 +30,13 @@ jobs: echo "DEVKITA64=/opt/devkitpro/devkitA64" >> $GITHUB_ENV echo "DEVKITARM=/opt/devkitpro/devkitARM" >> $GITHUB_ENV echo "PATH=/opt/devkitpro/devkitA64/bin:/opt/devkitpro/devkitARM/bin:$PATH" >> $GITHUB_ENV + shell: bash + + - name: I do not know why this doesn't work on the previous part + run: | aarch64-none-elf-gcc --version arm-none-eabi-gcc --version - shell: bash + shell: bash # is this even needed? but for consistency let's keep using it - name: Install ccache run: | From 13a4ea4ca00f02fff0b7e4eeb8b4de2a184cfaf7 Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:27:02 -0300 Subject: [PATCH 06/28] create ams_ver.txt Should be self-explanatory, we use this for the actions build system --- ams_ver.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 ams_ver.txt diff --git a/ams_ver.txt b/ams_ver.txt new file mode 100644 index 00000000..5ad2491c --- /dev/null +++ b/ams_ver.txt @@ -0,0 +1 @@ +1.10.2 From 05cf2ab4dddf4528239da5ba13c728e62fbf8ce8 Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:28:37 -0300 Subject: [PATCH 07/28] Clone Atmosphere with specific branch from file --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8caf1834..e1c929dd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,7 +55,7 @@ jobs: # Clone Atmosphère # ------------------------------------------------- - name: Clone Atmosphere - run: git clone https://github.com/Atmosphere-NX/Atmosphere.git atmosphere + run: git clone https://github.com/Atmosphere-NX/Atmosphere.git atmosphere -b $(cat ams_ver.txt) # ------------------------------------------------- # Clone Horizon OC (develop branch) kinda suspicious for now, shouldn't it just already be cloned on the actions runner? @@ -108,7 +108,7 @@ jobs: run: | # I forgot what dkp uses export CC="ccache aarch64-none-elf-gcc" export CXX="ccache aarch64-none-elf-g++" - make -j$(($(nproc) * 2)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc + make -j$(($(nproc) * 2)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" hactool -t kip1 out/nintendo_nx_arm64_armv8a/release/loader.kip --uncompress=hoc.kip cp build/stratosphere/loader/hoc.kip dist/atmosphere/kips/hoc.kip From 32f19c4f0edd3a510ffc0a82a83559062e0bcbf0 Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Sun, 1 Feb 2026 15:48:47 -0300 Subject: [PATCH 08/28] Update build.yml --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1c929dd..96cc48ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -76,8 +76,7 @@ jobs: # ------------------------------------------------- - name: Override ldr_process_creation.cpp run: | - cp -f Source/Atmosphere/stratosphere/loader/source/ldr_process_creation.cpp \ - build/stratosphere/loader/source/ldr_process_creation.cpp + cp -rf Source/Atmosphere/stratosphere/loader/source/* build/stratosphere/loader/source/ # ------------------------------------------------- # Build Horizon OC Zeus (trying ccache, directly invoking make instead, hacky) From 6ae084433f835d68b5836b51e9dcd4cc0f5c32ad Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Sun, 1 Feb 2026 15:58:29 -0300 Subject: [PATCH 09/28] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 96cc48ce..c00f8bea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -90,7 +90,7 @@ jobs: uses: actions/cache@v4 with: path: /root/.cache/ccache - key: ccache-${{ runner.os }}-devkitpro-${{ hashFiles('**/Makefile', '**/*.mk') }} + key: ccache-${{ runner.os }}-devkitpro-ams-${{ hashFiles('ams_ver.txt') }} # last key was utter garbage, stick to ams versions, restore-keys: | ccache-${{ runner.os }}-devkitpro- From dbb4d698a025af8f83a648e5b2ebbb322183a872 Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Sun, 1 Feb 2026 16:12:26 -0300 Subject: [PATCH 10/28] Increase make parallel jobs and update file paths --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c00f8bea..abd9664d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -107,9 +107,9 @@ jobs: run: | # I forgot what dkp uses export CC="ccache aarch64-none-elf-gcc" export CXX="ccache aarch64-none-elf-g++" - make -j$(($(nproc) * 2)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" + make -j$(($(nproc) * 4)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" hactool -t kip1 out/nintendo_nx_arm64_armv8a/release/loader.kip --uncompress=hoc.kip - cp build/stratosphere/loader/hoc.kip dist/atmosphere/kips/hoc.kip + cp hoc.kip ../../../dist/atmosphere/kips/hoc.kip - name: ccache stats run: ccache --show-stats From 770c25dbcbf321d4110f483373dd7ffe6c08f358 Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Sun, 1 Feb 2026 17:44:20 -0300 Subject: [PATCH 11/28] build hoc-clk and shallow clone ams Updated the build process to use shallow clones and added a new build step for the hoc-clk sysmodule and overlay. --- .github/workflows/build.yml | 66 ++++++++++++++++++++++++++++++++++--- 1 file changed, 62 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index abd9664d..f2378c83 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,7 +55,7 @@ jobs: # Clone Atmosphère # ------------------------------------------------- - name: Clone Atmosphere - run: git clone https://github.com/Atmosphere-NX/Atmosphere.git atmosphere -b $(cat ams_ver.txt) + run: git clone --depth=1 --single-branch https://github.com/Atmosphere-NX/Atmosphere.git atmosphere -b $(cat ams_ver.txt) # ------------------------------------------------- # Clone Horizon OC (develop branch) kinda suspicious for now, shouldn't it just already be cloned on the actions runner? @@ -101,16 +101,74 @@ jobs: ccache --set-config=max_size=10G ccache --set-config=compiler_check=content ccache --zero-stats + + - name: Build hoc-clk sysmodule and overlay + shell: bash + run: | + export CC="ccache aarch64-none-elf-gcc" + export CXX="ccache aarch64-none-elf-g++" - - name: Build (try) + ROOT_DIR="$GITHUB_WORKSPACE" + DIST_DIR="$ROOT_DIR/dist" + + mkdir -p "$DIST_DIR" + + echo "*** sysmodule ***" + + TITLE_ID="$(grep -oP '"title_id":\s*"0x\K(\w+)' \ + "$ROOT_DIR/sysmodule/perms.json")" + + echo "TITLE_ID: $TITLE_ID" + + pushd "$ROOT_DIR/sysmodule" + make -j$(($(nproc) * 2)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" + popd + + mkdir -p "$DIST_DIR/atmosphere/contents/$TITLE_ID/flags" + + cp -vf \ + "$ROOT_DIR/sysmodule/out/horizon-oc.nsp" \ + "$DIST_DIR/atmosphere/contents/$TITLE_ID/exefs.nsp" + + : >"$DIST_DIR/atmosphere/contents/$TITLE_ID/flags/boot2.flag" + + cp -vf \ + "$ROOT_DIR/sysmodule/toolbox.json" \ + "$DIST_DIR/atmosphere/contents/$TITLE_ID/toolbox.json" + + echo "*** overlay ***" + + pushd "$ROOT_DIR/overlay" + make -j$(($(nproc) * 2)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" + popd + + mkdir -p "$DIST_DIR/switch/.overlays" + + cp -vf \ + "$ROOT_DIR/overlay/out/horizon-oc-overlay.ovl" \ + "$DIST_DIR/switch/.overlays/horizon-oc-overlay.ovl" + + echo "*** assets ***" + + mkdir -p "$DIST_DIR/config/horizon-oc" + + cp -vf \ + "$ROOT_DIR/config.ini.template" \ + "$DIST_DIR/config/horizon-oc/config.ini.template" + + cp -vf \ + "$ROOT_DIR/README.md" \ + "$DIST_DIR/README.md" + + - name: Build kip working-directory: build/stratosphere/loader - run: | # I forgot what dkp uses + run: | export CC="ccache aarch64-none-elf-gcc" export CXX="ccache aarch64-none-elf-g++" make -j$(($(nproc) * 4)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" hactool -t kip1 out/nintendo_nx_arm64_armv8a/release/loader.kip --uncompress=hoc.kip cp hoc.kip ../../../dist/atmosphere/kips/hoc.kip - + - name: ccache stats run: ccache --show-stats From aaf77997e1155ef111bd2e8f27825383628704b0 Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Sun, 1 Feb 2026 17:52:44 -0300 Subject: [PATCH 12/28] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f2378c83..d60388ae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -108,7 +108,7 @@ jobs: export CC="ccache aarch64-none-elf-gcc" export CXX="ccache aarch64-none-elf-g++" - ROOT_DIR="$GITHUB_WORKSPACE" + ROOT_DIR="$GITHUB_WORKSPACE/Source/sys-clk" DIST_DIR="$ROOT_DIR/dist" mkdir -p "$DIST_DIR" From 6c94f5754c440f5d832bd8fd1fd24131067fa342 Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Sun, 1 Feb 2026 17:58:52 -0300 Subject: [PATCH 13/28] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d60388ae..8449e6e2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -190,4 +190,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: horizon-oc-zeus-dist - path: horizon-oc/${{ env.ZIP_NAME }} + path: ${{ env.ZIP_NAME }} From e2533e2bb02e0a154535a76068955037be918b06 Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Sun, 1 Feb 2026 18:19:23 -0300 Subject: [PATCH 14/28] Patch exosphere and build, fix comment and zip making redundancy --- .github/workflows/build.yml | 72 +++++++++++++------------------------ 1 file changed, 25 insertions(+), 47 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8449e6e2..0fc22d57 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,10 +20,6 @@ jobs: with: submodules: recursive - - # ------------------------------------------------- - # Fix PATH for devkitA64 and devkitARM - # ------------------------------------------------- - name: Set devkitPro PATH run: | echo "DEVKITPRO=/opt/devkitpro" >> $GITHUB_ENV @@ -32,10 +28,10 @@ jobs: echo "PATH=/opt/devkitpro/devkitA64/bin:/opt/devkitpro/devkitARM/bin:$PATH" >> $GITHUB_ENV shell: bash - - name: I do not know why this doesn't work on the previous part + - name: Check devkitPro gcc and g++ versions run: | aarch64-none-elf-gcc --version - arm-none-eabi-gcc --version + aarch64-none-elf-g++ --version shell: bash # is this even needed? but for consistency let's keep using it - name: Install ccache @@ -44,28 +40,13 @@ jobs: apt-get install -y ccache shell: bash - # ------------------------------------------------- - # Get short commit SHA - # ------------------------------------------------- - name: Set commit SHA id: vars run: echo "SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV - # ------------------------------------------------- - # Clone Atmosphère - # ------------------------------------------------- - name: Clone Atmosphere run: git clone --depth=1 --single-branch https://github.com/Atmosphere-NX/Atmosphere.git atmosphere -b $(cat ams_ver.txt) - - # ------------------------------------------------- - # Clone Horizon OC (develop branch) kinda suspicious for now, shouldn't it just already be cloned on the actions runner? - # ------------------------------------------------- - #- name: Clone Horizon OC - # run: git clone -b develop --single-branch https://github.com/Horizon-OC/Horizon-OC.git horizon-oc - - # ------------------------------------------------- - # Prepare build folder - # ------------------------------------------------- + - name: Prepare build folder run: | mkdir -p build @@ -78,19 +59,11 @@ jobs: run: | cp -rf Source/Atmosphere/stratosphere/loader/source/* build/stratosphere/loader/source/ - # ------------------------------------------------- - # Build Horizon OC Zeus (trying ccache, directly invoking make instead, hacky) - # ------------------------------------------------- - #- name: Build Horizon OC Zeus - # working-directory: horizon-oc - # run: | - # chmod +x build.sh - # ./build.sh - name: Cache ccache uses: actions/cache@v4 with: path: /root/.cache/ccache - key: ccache-${{ runner.os }}-devkitpro-ams-${{ hashFiles('ams_ver.txt') }} # last key was utter garbage, stick to ams versions, + key: ccache-${{ runner.os }}-devkitpro-ams-${{ hashFiles('ams_ver.txt') }} # last key was utter garbage, stick to ams versions restore-keys: | ccache-${{ runner.os }}-devkitpro- @@ -121,7 +94,7 @@ jobs: echo "TITLE_ID: $TITLE_ID" pushd "$ROOT_DIR/sysmodule" - make -j$(($(nproc) * 2)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" + make -j$(($(nproc) * 4)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" popd mkdir -p "$DIST_DIR/atmosphere/contents/$TITLE_ID/flags" @@ -139,7 +112,7 @@ jobs: echo "*** overlay ***" pushd "$ROOT_DIR/overlay" - make -j$(($(nproc) * 2)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" + make -j$(($(nproc) * 4)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" popd mkdir -p "$DIST_DIR/switch/.overlays" @@ -165,10 +138,24 @@ jobs: run: | export CC="ccache aarch64-none-elf-gcc" export CXX="ccache aarch64-none-elf-g++" - make -j$(($(nproc) * 4)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" + make -j$(($(nproc) * 8)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" hactool -t kip1 out/nintendo_nx_arm64_armv8a/release/loader.kip --uncompress=hoc.kip cp hoc.kip ../../../dist/atmosphere/kips/hoc.kip + - name: Build exosphere + working-directory: build/stratosphere/loader + run: | + export PATCHES="Source/Atmosphere-Patches" + export ROOT=build + cp "$PATCHES/secmon_memory_layout.hpp" "$ROOT/libraries/libexosphere/include/exosphere/secmon/" + cp "$PATCHES/secmon_emc_access_table_data.inc" "$ROOT/exosphere/program/source/smc/" + cp "$PATCHES/secmon_define_emc_access_table.inc" "$ROOT/exosphere/program/source/smc/" + cp "$PATCHES/secmon_smc_register_access.cpp" "$ROOT/exosphere/program/source/smc/" + + cd build/exosphere + make -j$(($(nproc) * 8)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" + cp "build/exosphere/out/nintendo_nx_arm64_armv8a/release/exosphere.bin" dist/ + - name: ccache stats run: ccache --show-stats @@ -176,18 +163,9 @@ jobs: # ------------------------------------------------- # Package dist folder as ZIP with commit SHA # ------------------------------------------------- - - name: Package dist - # working-directory: horizon-oc - run: | - ZIP_NAME="horizon-oc-zeus-dist-${SHORT_SHA}.zip" - zip -r "$ZIP_NAME" dist - echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_ENV - - # ------------------------------------------------- - # Upload ZIP artifact - # ------------------------------------------------- - name: Upload build artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: - name: horizon-oc-zeus-dist - path: ${{ env.ZIP_NAME }} + name: horizon-oc-zeus-dist-${{ env.SHORT_SHA }} + path: dist/ + compression-level: 3 From 65e7d839723dc93b5cc2108778f46b6cce4d8678 Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Sun, 1 Feb 2026 18:26:30 -0300 Subject: [PATCH 15/28] Update build.yml --- .github/workflows/build.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0fc22d57..2add151f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -138,23 +138,22 @@ jobs: run: | export CC="ccache aarch64-none-elf-gcc" export CXX="ccache aarch64-none-elf-g++" - make -j$(($(nproc) * 8)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" + make -j$(($(nproc) * 4)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" hactool -t kip1 out/nintendo_nx_arm64_armv8a/release/loader.kip --uncompress=hoc.kip cp hoc.kip ../../../dist/atmosphere/kips/hoc.kip - name: Build exosphere - working-directory: build/stratosphere/loader + working-directory: build/exosphere run: | - export PATCHES="Source/Atmosphere-Patches" - export ROOT=build + export PATCHES="../../Source/Atmosphere-Patches" + export ROOT=../build cp "$PATCHES/secmon_memory_layout.hpp" "$ROOT/libraries/libexosphere/include/exosphere/secmon/" cp "$PATCHES/secmon_emc_access_table_data.inc" "$ROOT/exosphere/program/source/smc/" cp "$PATCHES/secmon_define_emc_access_table.inc" "$ROOT/exosphere/program/source/smc/" cp "$PATCHES/secmon_smc_register_access.cpp" "$ROOT/exosphere/program/source/smc/" - cd build/exosphere - make -j$(($(nproc) * 8)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" - cp "build/exosphere/out/nintendo_nx_arm64_armv8a/release/exosphere.bin" dist/ + make -j$(($(nproc) * 4)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" + cp ./out/nintendo_nx_arm64_armv8a/release/exosphere.bin ../../dist/ - name: ccache stats run: ccache --show-stats From cff4267a685ce05f89786acb74afd6db9d90beb3 Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Sun, 1 Feb 2026 18:32:01 -0300 Subject: [PATCH 16/28] Fix ROOT variable assignment in build workflow --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2add151f..113728d2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -146,7 +146,7 @@ jobs: working-directory: build/exosphere run: | export PATCHES="../../Source/Atmosphere-Patches" - export ROOT=../build + export ROOT=".." cp "$PATCHES/secmon_memory_layout.hpp" "$ROOT/libraries/libexosphere/include/exosphere/secmon/" cp "$PATCHES/secmon_emc_access_table_data.inc" "$ROOT/exosphere/program/source/smc/" cp "$PATCHES/secmon_define_emc_access_table.inc" "$ROOT/exosphere/program/source/smc/" From f36383d0e7f17ec87db13b66c931d8325e100d7e Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Sun, 1 Feb 2026 18:58:52 -0300 Subject: [PATCH 17/28] Update build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 113728d2..ea15eb8a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,7 @@ jobs: run: | aarch64-none-elf-gcc --version aarch64-none-elf-g++ --version + /usr/lib/ccache/arm-none-eabi-gcc -v shell: bash # is this even needed? but for consistency let's keep using it - name: Install ccache From 61fd9d74d37ea6ffca0b0a4baa7e06f09195863d Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Sun, 1 Feb 2026 19:14:00 -0300 Subject: [PATCH 18/28] Update build.yml --- .github/workflows/build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ea15eb8a..2ff341a6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,6 @@ jobs: run: | aarch64-none-elf-gcc --version aarch64-none-elf-g++ --version - /usr/lib/ccache/arm-none-eabi-gcc -v shell: bash # is this even needed? but for consistency let's keep using it - name: Install ccache @@ -152,8 +151,8 @@ jobs: cp "$PATCHES/secmon_emc_access_table_data.inc" "$ROOT/exosphere/program/source/smc/" cp "$PATCHES/secmon_define_emc_access_table.inc" "$ROOT/exosphere/program/source/smc/" cp "$PATCHES/secmon_smc_register_access.cpp" "$ROOT/exosphere/program/source/smc/" - - make -j$(($(nproc) * 4)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" + # build without ams for now + make -j$(($(nproc) * 4)) cp ./out/nintendo_nx_arm64_armv8a/release/exosphere.bin ../../dist/ - name: ccache stats From 20389043ac7153009c10bf2beb0cae9f494af463 Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Mon, 2 Feb 2026 20:37:56 -0300 Subject: [PATCH 19/28] Enhance build.yml with ccache shims for compilers very hacky I know but we also fix exosphere hopefully with this --- .github/workflows/build.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2ff341a6..ca08638c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -141,16 +141,46 @@ jobs: make -j$(($(nproc) * 4)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" hactool -t kip1 out/nintendo_nx_arm64_armv8a/release/loader.kip --uncompress=hoc.kip cp hoc.kip ../../../dist/atmosphere/kips/hoc.kip + + - name: Make ccache shims + run: | # yes it's as bad as it sounds and it doesn't make sense but exosphere uses both aarch64 and arm32 gcc and g++ + cat > .dkp-wrappers/aarch64-none-elf-gcc <<'EOF' + #!/bin/sh + exec ccache /opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc "$@" + EOF + chmod +x .dkp-wrappers/aarch64-none-elf-gcc + + cat > .dkp-wrappers/aarch64-none-elf-g++ <<'EOF' + + #!/bin/sh + exec ccache /opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++ "$@" + EOF + chmod +x .dkp-wrappers/aarch64-none-elf-g++ + + cat > .dkp-wrappers/arm-none-eabi-gcc <<'EOF' + #!/bin/sh + exec ccache /opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc "$@" + EOF + chmod +x .dkp-wrappers/arm-none-eabi-gcc + + cat > .dkp-wrappers/arm-none-eabi-g++ <<'EOF' + #!/bin/sh + exec ccache /opt/devkitpro/devkitARM/bin/arm-none-eabi-g++ "$@" + EOF + chmod +x .dkp-wrappers/arm-none-eabi-g++ - name: Build exosphere working-directory: build/exosphere run: | + export PATH="$PWD/.dkp-wrappers:$PATH" export PATCHES="../../Source/Atmosphere-Patches" export ROOT=".." cp "$PATCHES/secmon_memory_layout.hpp" "$ROOT/libraries/libexosphere/include/exosphere/secmon/" cp "$PATCHES/secmon_emc_access_table_data.inc" "$ROOT/exosphere/program/source/smc/" cp "$PATCHES/secmon_define_emc_access_table.inc" "$ROOT/exosphere/program/source/smc/" cp "$PATCHES/secmon_smc_register_access.cpp" "$ROOT/exosphere/program/source/smc/" + cp "$PATCHES/secmon_define_soctherm_access_table.inc" "$ROOT/exosphere/program/source/smc/" + # build without ams for now make -j$(($(nproc) * 4)) cp ./out/nintendo_nx_arm64_armv8a/release/exosphere.bin ../../dist/ From f786d97de1231e010bf0436cad688313b3c9b160 Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Mon, 2 Feb 2026 20:44:06 -0300 Subject: [PATCH 20/28] Update build.yml --- .github/workflows/build.yml | 67 +++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ca08638c..d24cf77c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout repository and submodules # why are we doing this? I don't think we use submodules but memory doesn't serve so let's keep it - uses: actions/checkout@v4 + uses: actions/checkout@v6.0.2 with: submodules: recursive @@ -40,6 +40,33 @@ jobs: apt-get install -y ccache shell: bash + - name: Make ccache shims + run: | # yes it's as bad as it sounds and it doesn't make sense but exosphere uses both aarch64 and arm32 gcc and g++ + cat > .dkp-wrappers/aarch64-none-elf-gcc <<'EOF' + #!/bin/sh + exec ccache /opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc "$@" + EOF + chmod +x .dkp-wrappers/aarch64-none-elf-gcc + + cat > .dkp-wrappers/aarch64-none-elf-g++ <<'EOF' + + #!/bin/sh + exec ccache /opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++ "$@" + EOF + chmod +x .dkp-wrappers/aarch64-none-elf-g++ + + cat > .dkp-wrappers/arm-none-eabi-gcc <<'EOF' + #!/bin/sh + exec ccache /opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc "$@" + EOF + chmod +x .dkp-wrappers/arm-none-eabi-gcc + + cat > .dkp-wrappers/arm-none-eabi-g++ <<'EOF' + #!/bin/sh + exec ccache /opt/devkitpro/devkitARM/bin/arm-none-eabi-g++ "$@" + EOF + chmod +x .dkp-wrappers/arm-none-eabi-g++ + - name: Set commit SHA id: vars run: echo "SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV @@ -78,9 +105,6 @@ jobs: - name: Build hoc-clk sysmodule and overlay shell: bash run: | - export CC="ccache aarch64-none-elf-gcc" - export CXX="ccache aarch64-none-elf-g++" - ROOT_DIR="$GITHUB_WORKSPACE/Source/sys-clk" DIST_DIR="$ROOT_DIR/dist" @@ -94,7 +118,7 @@ jobs: echo "TITLE_ID: $TITLE_ID" pushd "$ROOT_DIR/sysmodule" - make -j$(($(nproc) * 4)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" + make -j$(($(nproc) * 4)) popd mkdir -p "$DIST_DIR/atmosphere/contents/$TITLE_ID/flags" @@ -112,7 +136,7 @@ jobs: echo "*** overlay ***" pushd "$ROOT_DIR/overlay" - make -j$(($(nproc) * 4)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" + make -j$(($(nproc) * 4)) popd mkdir -p "$DIST_DIR/switch/.overlays" @@ -136,38 +160,9 @@ jobs: - name: Build kip working-directory: build/stratosphere/loader run: | - export CC="ccache aarch64-none-elf-gcc" - export CXX="ccache aarch64-none-elf-g++" - make -j$(($(nproc) * 4)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" + make -j$(($(nproc) * 4)) hactool -t kip1 out/nintendo_nx_arm64_armv8a/release/loader.kip --uncompress=hoc.kip cp hoc.kip ../../../dist/atmosphere/kips/hoc.kip - - - name: Make ccache shims - run: | # yes it's as bad as it sounds and it doesn't make sense but exosphere uses both aarch64 and arm32 gcc and g++ - cat > .dkp-wrappers/aarch64-none-elf-gcc <<'EOF' - #!/bin/sh - exec ccache /opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc "$@" - EOF - chmod +x .dkp-wrappers/aarch64-none-elf-gcc - - cat > .dkp-wrappers/aarch64-none-elf-g++ <<'EOF' - - #!/bin/sh - exec ccache /opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++ "$@" - EOF - chmod +x .dkp-wrappers/aarch64-none-elf-g++ - - cat > .dkp-wrappers/arm-none-eabi-gcc <<'EOF' - #!/bin/sh - exec ccache /opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc "$@" - EOF - chmod +x .dkp-wrappers/arm-none-eabi-gcc - - cat > .dkp-wrappers/arm-none-eabi-g++ <<'EOF' - #!/bin/sh - exec ccache /opt/devkitpro/devkitARM/bin/arm-none-eabi-g++ "$@" - EOF - chmod +x .dkp-wrappers/arm-none-eabi-g++ - name: Build exosphere working-directory: build/exosphere From 72961aa2f12f7fbcd23701361e3be8203faf1a51 Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Mon, 2 Feb 2026 20:46:58 -0300 Subject: [PATCH 21/28] Update build.yml --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d24cf77c..ab68fc94 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,6 +42,7 @@ jobs: - name: Make ccache shims run: | # yes it's as bad as it sounds and it doesn't make sense but exosphere uses both aarch64 and arm32 gcc and g++ + mkdir -p .dkp-wrappers cat > .dkp-wrappers/aarch64-none-elf-gcc <<'EOF' #!/bin/sh exec ccache /opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc "$@" @@ -67,6 +68,8 @@ jobs: EOF chmod +x .dkp-wrappers/arm-none-eabi-g++ + echo "PATH="$PWD/.dkp-wrappers:$PATH" >> $GITHUB_ENV + - name: Set commit SHA id: vars run: echo "SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV @@ -167,7 +170,6 @@ jobs: - name: Build exosphere working-directory: build/exosphere run: | - export PATH="$PWD/.dkp-wrappers:$PATH" export PATCHES="../../Source/Atmosphere-Patches" export ROOT=".." cp "$PATCHES/secmon_memory_layout.hpp" "$ROOT/libraries/libexosphere/include/exosphere/secmon/" From c6275eb97784e65c9b09c41a681f19ae54f16334 Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Mon, 2 Feb 2026 20:51:49 -0300 Subject: [PATCH 22/28] Update build.yml --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab68fc94..cf34383f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,7 +50,6 @@ jobs: chmod +x .dkp-wrappers/aarch64-none-elf-gcc cat > .dkp-wrappers/aarch64-none-elf-g++ <<'EOF' - #!/bin/sh exec ccache /opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++ "$@" EOF @@ -68,7 +67,7 @@ jobs: EOF chmod +x .dkp-wrappers/arm-none-eabi-g++ - echo "PATH="$PWD/.dkp-wrappers:$PATH" >> $GITHUB_ENV + echo "PATH=$PWD/.dkp-wrappers:$PATH" >> $GITHUB_ENV - name: Set commit SHA id: vars From b0237a2042e102df7abb174b841a56ffef5809bf Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Mon, 2 Feb 2026 21:07:54 -0300 Subject: [PATCH 23/28] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cf34383f..3eaa9aff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: # Minimal devkitA64 container, apparently dkp-toolchain isn't needed? container: - image: devkitpro/devkita64:latest + image: devkitpro/devkita64:20251231 # latest breaks ams building for some reason steps: - name: Checkout repository and submodules # why are we doing this? I don't think we use submodules but memory doesn't serve so let's keep it From 4f6756c609e5fd03468d6771c0594f6c919e3988 Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Mon, 2 Feb 2026 21:29:05 -0300 Subject: [PATCH 24/28] Update build.yml --- .github/workflows/build.yml | 45 ++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3eaa9aff..87a522c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,34 +40,43 @@ jobs: apt-get install -y ccache shell: bash - - name: Make ccache shims - run: | # yes it's as bad as it sounds and it doesn't make sense but exosphere uses both aarch64 and arm32 gcc and g++ - mkdir -p .dkp-wrappers - cat > .dkp-wrappers/aarch64-none-elf-gcc <<'EOF' - #!/bin/sh - exec ccache /opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc "$@" - EOF - chmod +x .dkp-wrappers/aarch64-none-elf-gcc + - name: Create compiler shims + run: | #I deeply hate this from my heart + set -eux - cat > .dkp-wrappers/aarch64-none-elf-g++ <<'EOF' + # aarch64 gcc + mv /opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc /opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc.real + cat > /opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc <<'EOF' #!/bin/sh - exec ccache /opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++ "$@" + exec ccache /opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc.real "$@" EOF - chmod +x .dkp-wrappers/aarch64-none-elf-g++ + chmod +x /opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc - cat > .dkp-wrappers/arm-none-eabi-gcc <<'EOF' + # aarch64 g++ + mv /opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++ /opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++.real + cat > /opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++ <<'EOF' #!/bin/sh - exec ccache /opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc "$@" + exec ccache /opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++.real "$@" EOF - chmod +x .dkp-wrappers/arm-none-eabi-gcc + chmod +x /opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++ - cat > .dkp-wrappers/arm-none-eabi-g++ <<'EOF' + # arm gcc + mv /opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc /opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc.real + cat > /opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc <<'EOF' #!/bin/sh - exec ccache /opt/devkitpro/devkitARM/bin/arm-none-eabi-g++ "$@" + exec ccache /opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc.real "$@" EOF - chmod +x .dkp-wrappers/arm-none-eabi-g++ + chmod +x /opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc + # arm g++ + mv /opt/devkitpro/devkitARM/bin/arm-none-eabi-g++ /opt/devkitpro/devkitARM/bin/arm-none-eabi-g++.real + cat > /opt/devkitpro/devkitARM/bin/arm-none-eabi-g++ <<'EOF' + #!/bin/sh + exec ccache /opt/devkitpro/devkitARM/bin/arm-none-eabi-g++.real "$@" + EOF + chmod +x /opt/devkitpro/devkitARM/bin/arm-none-eabi-g++ echo "PATH=$PWD/.dkp-wrappers:$PATH" >> $GITHUB_ENV + shell: bash - name: Set commit SHA id: vars @@ -89,7 +98,7 @@ jobs: cp -rf Source/Atmosphere/stratosphere/loader/source/* build/stratosphere/loader/source/ - name: Cache ccache - uses: actions/cache@v4 + uses: actions/cache@v5.0.3 with: path: /root/.cache/ccache key: ccache-${{ runner.os }}-devkitpro-ams-${{ hashFiles('ams_ver.txt') }} # last key was utter garbage, stick to ams versions From 83287b1f5c8c8b3eb7fd71ae23452d21f706db9f Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Mon, 2 Feb 2026 21:53:24 -0300 Subject: [PATCH 25/28] Update build.yml --- .github/workflows/build.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 87a522c6..55cb1f43 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: image: devkitpro/devkita64:20251231 # latest breaks ams building for some reason steps: - - name: Checkout repository and submodules # why are we doing this? I don't think we use submodules but memory doesn't serve so let's keep it + - name: Checkout repository and submodules # needed for hoc-clk uses: actions/checkout@v6.0.2 with: submodules: recursive @@ -42,8 +42,6 @@ jobs: - name: Create compiler shims run: | #I deeply hate this from my heart - set -eux - # aarch64 gcc mv /opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc /opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc.real cat > /opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc <<'EOF' @@ -75,7 +73,8 @@ jobs: exec ccache /opt/devkitpro/devkitARM/bin/arm-none-eabi-g++.real "$@" EOF chmod +x /opt/devkitpro/devkitARM/bin/arm-none-eabi-g++ - echo "PATH=$PWD/.dkp-wrappers:$PATH" >> $GITHUB_ENV + + cat $(which arm-none-eabi-g++) shell: bash - name: Set commit SHA @@ -104,6 +103,7 @@ jobs: key: ccache-${{ runner.os }}-devkitpro-ams-${{ hashFiles('ams_ver.txt') }} # last key was utter garbage, stick to ams versions restore-keys: | ccache-${{ runner.os }}-devkitpro- + save-always: true - name: Configure ccache run: | @@ -185,6 +185,7 @@ jobs: cp "$PATCHES/secmon_define_emc_access_table.inc" "$ROOT/exosphere/program/source/smc/" cp "$PATCHES/secmon_smc_register_access.cpp" "$ROOT/exosphere/program/source/smc/" cp "$PATCHES/secmon_define_soctherm_access_table.inc" "$ROOT/exosphere/program/source/smc/" + cp "$PATCHES/secmon_soctherm_access_table_data.inc" "$ROOT/exosphere/program/source/smc/" # build without ams for now make -j$(($(nproc) * 4)) From 54554bacea257afd83f929bf41ddc27d858213c5 Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Tue, 3 Feb 2026 16:28:09 -0300 Subject: [PATCH 26/28] Change Docker image and install switch-dev Updated the Docker image for the build container and added a step to install switch-dev. --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 55cb1f43..33b3b461 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: # Minimal devkitA64 container, apparently dkp-toolchain isn't needed? container: - image: devkitpro/devkita64:20251231 # latest breaks ams building for some reason + image: devkitpro/toolchain-base:20250727 steps: - name: Checkout repository and submodules # needed for hoc-clk @@ -20,6 +20,10 @@ jobs: with: submodules: recursive + + - name: install switch-dev + run: dkp-pacman -Syu switch-dev --noconfirm + - name: Set devkitPro PATH run: | echo "DEVKITPRO=/opt/devkitpro" >> $GITHUB_ENV From a8ee3896814398b936fac99d4b7d3ee9d6175293 Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Tue, 3 Feb 2026 16:40:38 -0300 Subject: [PATCH 27/28] Revert to last working Updated the Docker image for the build container and removed unnecessary steps for creating compiler shims. Added packaging of the dist folder as a ZIP file with the commit SHA. --- .github/workflows/build.yml | 93 +++++++++++-------------------------- 1 file changed, 27 insertions(+), 66 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 33b3b461..1604cac5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: # Minimal devkitA64 container, apparently dkp-toolchain isn't needed? container: - image: devkitpro/toolchain-base:20250727 + image: devkitpro/devkita64:20251231 steps: - name: Checkout repository and submodules # needed for hoc-clk @@ -21,9 +21,9 @@ jobs: submodules: recursive - - name: install switch-dev - run: dkp-pacman -Syu switch-dev --noconfirm - + # ------------------------------------------------- + # Fix PATH for devkitA64 and devkitARM + # ------------------------------------------------- - name: Set devkitPro PATH run: | echo "DEVKITPRO=/opt/devkitpro" >> $GITHUB_ENV @@ -44,58 +44,21 @@ jobs: apt-get install -y ccache shell: bash - - name: Create compiler shims - run: | #I deeply hate this from my heart - # aarch64 gcc - mv /opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc /opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc.real - cat > /opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc <<'EOF' - #!/bin/sh - exec ccache /opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc.real "$@" - EOF - chmod +x /opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc - - # aarch64 g++ - mv /opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++ /opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++.real - cat > /opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++ <<'EOF' - #!/bin/sh - exec ccache /opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++.real "$@" - EOF - chmod +x /opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++ - - # arm gcc - mv /opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc /opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc.real - cat > /opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc <<'EOF' - #!/bin/sh - exec ccache /opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc.real "$@" - EOF - chmod +x /opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc - - # arm g++ - mv /opt/devkitpro/devkitARM/bin/arm-none-eabi-g++ /opt/devkitpro/devkitARM/bin/arm-none-eabi-g++.real - cat > /opt/devkitpro/devkitARM/bin/arm-none-eabi-g++ <<'EOF' - #!/bin/sh - exec ccache /opt/devkitpro/devkitARM/bin/arm-none-eabi-g++.real "$@" - EOF - chmod +x /opt/devkitpro/devkitARM/bin/arm-none-eabi-g++ - - cat $(which arm-none-eabi-g++) - shell: bash - + # ------------------------------------------------- + # Get short commit SHA + # ------------------------------------------------- - name: Set commit SHA id: vars run: echo "SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV - name: Clone Atmosphere run: git clone --depth=1 --single-branch https://github.com/Atmosphere-NX/Atmosphere.git atmosphere -b $(cat ams_ver.txt) - + - name: Prepare build folder run: | mkdir -p build cp -r atmosphere/* build/ - # ------------------------------------------------- - # Override loader source - # ------------------------------------------------- - name: Override ldr_process_creation.cpp run: | cp -rf Source/Atmosphere/stratosphere/loader/source/* build/stratosphere/loader/source/ @@ -104,10 +67,9 @@ jobs: uses: actions/cache@v5.0.3 with: path: /root/.cache/ccache - key: ccache-${{ runner.os }}-devkitpro-ams-${{ hashFiles('ams_ver.txt') }} # last key was utter garbage, stick to ams versions + key: ccache-${{ runner.os }}-devkitpro-ams-${{ hashFiles('ams_ver.txt') }} # last key was utter garbage, stick to ams versions, restore-keys: | ccache-${{ runner.os }}-devkitpro- - save-always: true - name: Configure ccache run: | @@ -120,6 +82,9 @@ jobs: - name: Build hoc-clk sysmodule and overlay shell: bash run: | + export CC="ccache aarch64-none-elf-gcc" + export CXX="ccache aarch64-none-elf-g++" + ROOT_DIR="$GITHUB_WORKSPACE/Source/sys-clk" DIST_DIR="$ROOT_DIR/dist" @@ -133,7 +98,7 @@ jobs: echo "TITLE_ID: $TITLE_ID" pushd "$ROOT_DIR/sysmodule" - make -j$(($(nproc) * 4)) + make -j$(($(nproc) * 2)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" popd mkdir -p "$DIST_DIR/atmosphere/contents/$TITLE_ID/flags" @@ -151,7 +116,7 @@ jobs: echo "*** overlay ***" pushd "$ROOT_DIR/overlay" - make -j$(($(nproc) * 4)) + make -j$(($(nproc) * 2)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" popd mkdir -p "$DIST_DIR/switch/.overlays" @@ -175,26 +140,12 @@ jobs: - name: Build kip working-directory: build/stratosphere/loader run: | - make -j$(($(nproc) * 4)) + export CC="ccache aarch64-none-elf-gcc" + export CXX="ccache aarch64-none-elf-g++" + make -j$(($(nproc) * 4)) CXX="ccache aarch64-none-elf-g++" CC="ccache aarch64-none-elf-gcc" hactool -t kip1 out/nintendo_nx_arm64_armv8a/release/loader.kip --uncompress=hoc.kip cp hoc.kip ../../../dist/atmosphere/kips/hoc.kip - - name: Build exosphere - working-directory: build/exosphere - run: | - export PATCHES="../../Source/Atmosphere-Patches" - export ROOT=".." - cp "$PATCHES/secmon_memory_layout.hpp" "$ROOT/libraries/libexosphere/include/exosphere/secmon/" - cp "$PATCHES/secmon_emc_access_table_data.inc" "$ROOT/exosphere/program/source/smc/" - cp "$PATCHES/secmon_define_emc_access_table.inc" "$ROOT/exosphere/program/source/smc/" - cp "$PATCHES/secmon_smc_register_access.cpp" "$ROOT/exosphere/program/source/smc/" - cp "$PATCHES/secmon_define_soctherm_access_table.inc" "$ROOT/exosphere/program/source/smc/" - cp "$PATCHES/secmon_soctherm_access_table_data.inc" "$ROOT/exosphere/program/source/smc/" - - # build without ams for now - make -j$(($(nproc) * 4)) - cp ./out/nintendo_nx_arm64_armv8a/release/exosphere.bin ../../dist/ - - name: ccache stats run: ccache --show-stats @@ -202,6 +153,16 @@ jobs: # ------------------------------------------------- # Package dist folder as ZIP with commit SHA # ------------------------------------------------- + - name: Package dist + # working-directory: horizon-oc + run: | + ZIP_NAME="horizon-oc-zeus-dist-${SHORT_SHA}.zip" + zip -r "$ZIP_NAME" dist + echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_ENV + + # ------------------------------------------------- + # Upload ZIP artifact + # ------------------------------------------------- - name: Upload build artifact uses: actions/upload-artifact@v6 with: From a5efa7ae72bf0f48ce31bcd5dde1549f840d071d Mon Sep 17 00:00:00 2001 From: 2fort sink <87287937+OEMunlag@users.noreply.github.com> Date: Tue, 3 Feb 2026 16:55:48 -0300 Subject: [PATCH 28/28] Add files via upload