summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCzarek Nakamoto <cyjan@mrcyjanek.net>2025-02-17 11:23:33 +0100
committerCzarek Nakamoto <cyjan@mrcyjanek.net>2025-02-17 11:23:33 +0100
commite64ac9c4f14f9c0e45606fe67aeeeb3a5f9af777 (patch)
tree6ada5abb929ebb331b007ca5719c589fac40eef1
parent9d9b1f2f2373fc9a99c6556a93eea63fe343cf58 (diff)
Add mirror fot git repo
Improve apply_patches.sh Improve build_single.sh Create tools to mirror all repositories in git bundles
-rw-r--r--.github/workflows/full_check.yaml487
-rw-r--r--.github/workflows/submodule-check.yml35
-rw-r--r--.gitignore1
-rw-r--r--README.md4
-rwxr-xr-xapply_patches.sh335
-rwxr-xr-xbuild_single.sh34
-rw-r--r--patches/monero/0008-polyseed.patch2
-rw-r--r--patches/wownero/0002-fix-missing-___clear_cache-when-targetting-iOS.patch19
-rw-r--r--patches/wownero/0007-UR-functions.patch2
-rw-r--r--patches/wownero/0009-polyseed.patch2
-rw-r--r--tests/.DS_Storebin6148 -> 0 bytes
-rw-r--r--tools/mirror/.gitignore3
-rw-r--r--tools/mirror/mirror.sh62
-rw-r--r--tools/mirror/pack_mirror.sh50
-rw-r--r--tools/mirror/submodule-list.txt59
-rw-r--r--tools/mirror/submodule-scanner.sh101
16 files changed, 779 insertions, 417 deletions
diff --git a/.github/workflows/full_check.yaml b/.github/workflows/full_check.yaml
index 0e64964..e94e881 100644
--- a/.github/workflows/full_check.yaml
+++ b/.github/workflows/full_check.yaml
@@ -3,74 +3,41 @@ on: [push]
permissions:
issues: write
pull-requests: write
+
jobs:
- lib_mingw:
+ build_deps:
strategy:
fail-fast: false
matrix:
- coin: [monero, wownero]
- runs-on: ubuntu-latest
- container:
- image: ubuntu:24.04
- steps:
- - name: Install dependencies
- run: |
- apt update
- apt install -y pigz build-essential pkg-config autoconf libtool ccache make cmake gcc g++ git curl lbzip2 gperf gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 gcc-mingw-w64-i686 g++-mingw-w64-i686
- - uses: actions/checkout@v4
- with:
- fetch-depth: 0
- submodules: recursive
- - name: Patch sources
- run: |
- git config --global --add safe.directory '*'
- git config --global user.email "ci@mrcyjanek.net"
- git config --global user.name "CI mrcyjanek.net"
- ./apply_patches.sh ${{ matrix.coin }}
- - name: ccache
- uses: hendrikmuhs/ccache-action@v1.2
- with:
- key: ${{ github.job }}-${{ matrix.coin }}
- - name: Cache built
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
- uses: actions/cache@v4
- with:
- path: |
- contrib/depends/built/*
- key: depends-${{ github.job }}-${{ hashFiles('contrib/depends/packages/*.mk') }}
- - name: ${{ matrix.coin }}/x86_64-w64-mingw32
- run: ./build_single.sh ${{ matrix.coin }} x86_64-w64-mingw32 -j$(nproc)
- - name: ${{ matrix.coin }}/i686-w64-mingw32
- run: ./build_single.sh ${{ matrix.coin }} i686-w64-mingw32 -j$(nproc)
- - name: rename artifacts
- run: |
- mkdir release/gh/
- for i in release/${{ matrix.coin }}/*
- do
- cp "$i" "release/gh/${{ matrix.coin }}_$(basename $i)"
- done
- - name: Release
- uses: softprops/action-gh-release@v2
- if: startsWith(github.ref, 'refs/tags/')
- with:
- files: release/gh/*
- token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
- - name: Upload lib
- uses: actions/upload-artifact@v4
- with:
- name: mingw ${{ matrix.coin }}
- path: release/${{ matrix.coin }}
- lib_android:
- strategy:
- fail-fast: false
- matrix:
- coin: [monero, wownero, zano]
- runs-on: ubuntu-22.04
- # container:
- # image: debian:bookworm
+ include:
+ - os: ubuntu-latest
+ container: ubuntu:24.04
+ target: mingw
+ host_abi: [x86_64-w64-mingw32, i686-w64-mingw32]
+ packages: pigz build-essential pkg-config autoconf libtool ccache make cmake gcc g++ git curl lbzip2 gperf gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 gcc-mingw-w64-i686 g++-mingw-w64-i686
+ - os: ubuntu-22.04
+ target: android
+ host_abi: [x86_64-linux-android, aarch64-linux-android, armv7a-linux-androideabi]
+ packages: llvm pigz build-essential pkg-config autoconf libtool ccache make cmake gcc g++ git curl lbzip2 libtinfo6 gperf unzip python-is-python3
+ - os: ubuntu-latest
+ container: debian:bullseye
+ target: linux
+ host_abi: [x86_64-linux-gnu, aarch64-linux-gnu, i686-linux-gnu]
+ packages: pigz build-essential pkg-config autoconf libtool ccache make cmake gcc g++ git curl lbzip2 libtinfo5 gperf gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-i686-linux-gnu g++-i686-linux-gnu
+ - os: macos-15
+ target: macos
+ host_abi: [aarch64-apple-darwin, x86_64-apple-darwin]
+ packages: ccache binutils pigz autoconf automake libtool pkg-config
+ - os: macos-15
+ target: ios
+ host_abi: [aarch64-apple-ios, aarch64-apple-iossimulator]
+ packages: ccache cmake autoconf automake libtool
+
+ runs-on: ${{ matrix.os }}
+ container: ${{ matrix.container }}
steps:
- - name: Free Disk Space
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
+ - name: Free Disk Space (Ubuntu)
+ if: ${{ matrix.target == 'android' }}
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
@@ -80,160 +47,152 @@ jobs:
large-packages: true
docker-images: true
swap-storage: true
+
- name: Install dependencies
run: |
- sudo apt update
- sudo apt install -y llvm pigz build-essential pkg-config autoconf libtool ccache make cmake gcc g++ git curl lbzip2 libtinfo6 gperf unzip python-is-python3
+ if [ "${{ matrix.container }}" != "" ]; then
+ apt update
+ apt install -y ${{ matrix.packages }}
+ else
+ brew install ${{ matrix.packages }}
+ fi
+
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- - name: Patch sources
- run: |
- git config --global --add safe.directory '*'
- git config --global user.email "ci@mrcyjanek.net"
- git config --global user.name "CI mrcyjanek.net"
- ./apply_patches.sh ${{ matrix.coin }}
+
+ - uses: maxim-lobanov/setup-xcode@v1
+ if: ${{ matrix.target == 'macos' || matrix.target == 'ios' }}
+ with:
+ xcode-version: '16.1'
+
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
- key: ${{ github.job }}-${{ matrix.coin }}
- - name: Cache built
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
- uses: actions/cache@v4
- with:
- path: |
- contrib/depends/built/*
- key: depends-${{ github.job }}-${{ hashFiles('contrib/depends/packages/*.mk') }}
- - name: ${{ matrix.coin }}/x86_64-linux-android
- run: ./build_single.sh ${{ matrix.coin }} x86_64-linux-android -j$(nproc)
- - name: ${{ matrix.coin }}/aarch64-linux-android
- run: ./build_single.sh ${{ matrix.coin }} aarch64-linux-android -j$(nproc)
- - name: ${{ matrix.coin }}/armv7a-linux-androideabi
- run: ./build_single.sh ${{ matrix.coin }} armv7a-linux-androideabi -j$(nproc)
- - name: rename artifacts
+ key: deps-${{ matrix.target }}
+
+ - name: Build dependencies
run: |
- mkdir release/gh/
- for i in release/${{ matrix.coin }}/*
- do
- cp "$i" "release/gh/${{ matrix.coin }}_$(basename $i)"
+ for host in ${{ join(matrix.host_abi, ' ') }}; do
+ pushd contrib/depends
+ env -i PATH="$PATH" CC=gcc CXX=g++ make -j$(nproc || sysctl -n hw.logicalcpu) HOST="$host"
+ popd
done
- - name: Release
- uses: softprops/action-gh-release@v2
- if: startsWith(github.ref, 'refs/tags/')
- with:
- files: release/gh/*
- token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
- - name: Upload lib
- uses: actions/upload-artifact@v4
+
+ - name: Cache dependencies
+ uses: actions/cache@v4
with:
- name: android ${{ matrix.coin }}
- path: release/${{ matrix.coin }}
- - name: remove android_ndk
- run: |
- rm -rf contrib/depends/built/*/android_ndk
- rm -rf contrib/depends/sources/android-ndk-r26d-linux.zip
- lib_linux:
+ path: contrib/depends/built
+ key: deps-${{ matrix.target }}-${{ hashFiles('contrib/depends/packages/*.mk') }}
+
+ build_coins:
+ needs: build_deps
strategy:
fail-fast: false
matrix:
+ include:
+ - target: mingw
+ os: ubuntu-latest
+ container: ubuntu:24.04
+ packages: pigz build-essential pkg-config autoconf libtool ccache make cmake gcc g++ git curl lbzip2 gperf gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 gcc-mingw-w64-i686 g++-mingw-w64-i686
+ - target: android
+ os: ubuntu-22.04
+ packages: llvm pigz build-essential pkg-config autoconf libtool ccache make cmake gcc g++ git curl lbzip2 libtinfo6 gperf unzip python-is-python3
+ - target: linux
+ os: ubuntu-latest
+ container: debian:bullseye
+ packages: pigz build-essential pkg-config autoconf libtool ccache make cmake gcc g++ git curl lbzip2 libtinfo5 gperf gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-i686-linux-gnu g++-i686-linux-gnu
+ - target: macos
+ os: macos-15
+ packages: ccache binutils pigz autoconf automake libtool pkg-config
+ - target: ios
+ os: macos-15
+ packages: ccache cmake autoconf automake libtool
coin: [monero, wownero, zano]
- runs-on: ubuntu-latest
- container:
- image: debian:bullseye
+ exclude:
+ - target: mingw
+ coin: zano
+ runs-on: ${{ matrix.os }}
+ container: ${{ matrix.container }}
+
steps:
+ - name: Free Disk Space (Ubuntu)
+ if: ${{ matrix.target == 'android' }}
+ uses: jlumbroso/free-disk-space@main
+ with:
+ tool-cache: false
+ android: true
+ dotnet: true
+ haskell: true
+ large-packages: true
+ docker-images: true
+ swap-storage: true
+
- name: Install dependencies
run: |
- apt update
- apt install -y pigz build-essential pkg-config autoconf libtool ccache make cmake gcc g++ git curl lbzip2 libtinfo5 gperf gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-i686-linux-gnu g++-i686-linux-gnu
+ if [ "$(uname)" = "Linux" ]; then
+ apt update
+ apt install -y ${{ matrix.packages }}
+ else
+ brew install ${{ matrix.packages }}
+ fi
+
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- - name: Patch sources
- run: |
- git config --global --add safe.directory '*'
- git config --global user.email "ci@mrcyjanek.net"
- git config --global user.name "CI mrcyjanek.net"
- ./apply_patches.sh ${{ matrix.coin }}
- - name: ccache
- uses: hendrikmuhs/ccache-action@v1.2
- with:
- key: ${{ github.job }}-${{ matrix.coin }}
- - name: Cache built
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
- uses: actions/cache@v4
- with:
- path: |
- contrib/depends/built/*
- key: depends-${{ github.job }}-${{ hashFiles('contrib/depends/packages/*.mk') }}
- - name: ${{ matrix.coin }}/x86_64-linux-gnu
- run: ./build_single.sh ${{ matrix.coin }} x86_64-linux-gnu -j$(nproc)
- - name: ${{ matrix.coin }}/aarch64-linux-gnu
- run: ./build_single.sh ${{ matrix.coin }} aarch64-linux-gnu -j$(nproc)
- - name: ${{ matrix.coin }}/i686-linux-gnu
- run: ./build_single.sh ${{ matrix.coin }} i686-linux-gnu -j$(nproc)
- - name: rename artifacts
- run: |
- mkdir release/gh/
- for i in release/${{ matrix.coin }}/*
- do
- cp "$i" "release/gh/${{ matrix.coin }}_$(basename $i)"
- done
- - name: Release
- uses: softprops/action-gh-release@v2
- if: startsWith(github.ref, 'refs/tags/')
- with:
- files: release/gh/*
- token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
- - name: Upload lib
- uses: actions/upload-artifact@v4
- with:
- name: linux ${{ matrix.coin }}
- path: release/${{ matrix.coin }}
- lib_macos:
- strategy:
- fail-fast: false
- matrix:
- coin: [monero, wownero, zano]
- name: macos build
- runs-on: macos-14
- steps:
- - name: Checkout monero_c repo
- uses: actions/checkout@v4
- with:
- repository: MrCyjaneK/monero_c
- fetch-depth: 0
- submodules: recursive
+
- uses: maxim-lobanov/setup-xcode@v1
+ if: ${{ matrix.target == 'macos' || matrix.target == 'ios' }}
with:
- xcode-version: '15.4'
- - name: install dependencies
- run: |
- brew install ccache binutils pigz autoconf automake libtool pkg-config
+ xcode-version: ${{ matrix.target == 'macos' && '15.4' || '16.1' }}
+
- name: Patch sources
run: |
git config --global --add safe.directory '*'
git config --global user.email "ci@mrcyjanek.net"
git config --global user.name "CI mrcyjanek.net"
./apply_patches.sh ${{ matrix.coin }}
+
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
- key: ${{ github.job }}-${{ matrix.coin }}
- - name: Cache built
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
+ key: ${{ matrix.target }}-${{ matrix.coin }}
+
+ - name: Restore dependencies
uses: actions/cache@v4
with:
- path: |
- contrib/depends/built/*
- key: depends-${{ github.job }}-${{ hashFiles('contrib/depends/packages/*.mk') }}
- - name: build (aarch64-apple-darwin)
- run: |
- ./build_single.sh ${{ matrix.coin }} aarch64-apple-darwin -j$(sysctl -n hw.logicalcpu)
- - name: build (x86_64-apple-darwin)
+ path: contrib/depends/built
+ key: deps-${{ matrix.target }}-${{ hashFiles('contrib/depends/packages/*.mk') }}
+
+ - name: Build ${{ matrix.coin }}
run: |
- ./build_single.sh ${{ matrix.coin }} x86_64-apple-darwin -j$(sysctl -n hw.logicalcpu)
+ case ${{ matrix.target }} in
+ mingw)
+ ./build_single.sh ${{ matrix.coin }} x86_64-w64-mingw32 -j$(nproc)
+ ./build_single.sh ${{ matrix.coin }} i686-w64-mingw32 -j$(nproc)
+ ;;
+ android)
+ ./build_single.sh ${{ matrix.coin }} x86_64-linux-android -j$(nproc)
+ ./build_single.sh ${{ matrix.coin }} aarch64-linux-android -j$(nproc)
+ ./build_single.sh ${{ matrix.coin }} armv7a-linux-androideabi -j$(nproc)
+ ;;
+ linux)
+ ./build_single.sh ${{ matrix.coin }} x86_64-linux-gnu -j$(nproc)
+ ./build_single.sh ${{ matrix.coin }} aarch64-linux-gnu -j$(nproc)
+ ./build_single.sh ${{ matrix.coin }} i686-linux-gnu -j$(nproc)
+ ;;
+ macos)
+ ./build_single.sh ${{ matrix.coin }} aarch64-apple-darwin -j$(sysctl -n hw.logicalcpu)
+ ./build_single.sh ${{ matrix.coin }} x86_64-apple-darwin -j$(sysctl -n hw.logicalcpu)
+ ;;
+ ios)
+ ./build_single.sh ${{ matrix.coin }} aarch64-apple-ios -j$(sysctl -n hw.logicalcpu)
+ ./build_single.sh ${{ matrix.coin }} aarch64-apple-iossimulator -j$(sysctl -n hw.logicalcpu)
+ ;;
+ esac
+
- name: rename artifacts
run: |
mkdir release/gh/
@@ -241,162 +200,58 @@ jobs:
do
cp "$i" "release/gh/${{ matrix.coin }}_$(basename $i)"
done
+
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: release/gh/*
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
+
- name: Upload lib
uses: actions/upload-artifact@v4
with:
- name: macos ${{ matrix.coin }}
+ name: ${{ matrix.target }} ${{ matrix.coin }}
path: release/${{ matrix.coin }}
- lib_ios:
- strategy:
- fail-fast: false
- matrix:
- coin: [monero, wownero, zano]
- name: ios build
- runs-on: macos-15
- steps:
- - name: Checkout monero_c repo
- uses: actions/checkout@v4
- with:
- repository: MrCyjaneK/monero_c
- fetch-depth: 0
- submodules: recursive
- - uses: maxim-lobanov/setup-xcode@v1
- with:
- xcode-version: '16.1'
- - name: install dependencies
- run: |
- brew install ccache cmake autoconf automake libtool
- - name: Patch sources
- run: |
- git config --global --add safe.directory '*'
- git config --global user.email "ci@mrcyjanek.net"
- git config --global user.name "CI mrcyjanek.net"
- ./apply_patches.sh ${{ matrix.coin }}
- - name: ccache
- uses: hendrikmuhs/ccache-action@v1.2
- with:
- key: ${{ github.job }}-${{ matrix.coin }}
- - name: Cache built
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
- uses: actions/cache@v4
- with:
- path: |
- contrib/depends/built/*
- key: depends-${{ github.job }}-${{ hashFiles('contrib/depends/packages/*.mk') }}
- - name: build (aarch64-apple-ios)
- run: |
- ./build_single.sh ${{ matrix.coin }} aarch64-apple-ios -j$(sysctl -n hw.logicalcpu)
- - name: build (aarch64-apple-iossimulator)
+ - name: remove android_ndk
+ if: ${{ matrix.target == 'android' }}
run: |
- ./build_single.sh ${{ matrix.coin }} aarch64-apple-iossimulator -j$(sysctl -n hw.logicalcpu)
+ rm -rf contrib/depends/built/*/android_ndk
+ rm -rf contrib/depends/sources/android-ndk-r26d-linux.zip
- - name: rename artifacts
- run: |
- mkdir release/gh/
- for i in release/${{ matrix.coin }}/*
- do
- cp "$i" "release/gh/${{ matrix.coin }}_$(basename $i)"
- done
- - name: Release
- uses: softprops/action-gh-release@v2
- if: startsWith(github.ref, 'refs/tags/')
- with:
- files: release/gh/*
- token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
- - name: Upload lib
- uses: actions/upload-artifact@v4
- with:
- name: ios ${{ matrix.coin }}
- path: release/${{ matrix.coin }}
bulk_lib_release:
name: create single release file
runs-on: ubuntu-latest
- needs: [
- lib_mingw, lib_android, lib_linux, lib_macos, lib_ios
- ]
+ needs: [build_coins]
steps:
- uses: actions/download-artifact@v4
with:
- name: android monero
- path: release/monero
- - uses: actions/download-artifact@v4
- with:
- name: android wownero
- path: release/wownero
- - uses: actions/download-artifact@v4
- with:
- name: android zano
- path: release/zano
- - uses: actions/download-artifact@v4
- with:
- name: ios monero
- path: release/monero
- - uses: actions/download-artifact@v4
- with:
- name: ios wownero
- path: release/wownero
- - uses: actions/download-artifact@v4
- with:
- name: ios zano
- path: release/zano
- - uses: actions/download-artifact@v4
- with:
- name: linux monero
- path: release/monero
- - uses: actions/download-artifact@v4
- with:
- name: linux wownero
- path: release/wownero
- - uses: actions/download-artifact@v4
- with:
- name: linux zano
- path: release/zano
- - uses: actions/download-artifact@v4
- with:
- name: macos monero
- path: release/monero
- - uses: actions/download-artifact@v4
- with:
- name: macos wownero
- path: release/wownero
- - uses: actions/download-artifact@v4
- with:
- name: macos zano
- path: release/zano
- - uses: actions/download-artifact@v4
- with:
- name: mingw monero
- path: release/monero
- - uses: actions/download-artifact@v4
- with:
- name: mingw wownero
- path: release/wownero
+ pattern: "* *"
+ path: release
+ merge-multiple: true
+
- name: zip release dir
run: zip -r release-bundle.zip release
+
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: release-bundle.zip
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
+
- name: Upload lib
uses: actions/upload-artifact@v4
with:
name: release-bulk
path: release
+
+ # Test jobs remain the same
deno_monerots_test_linux:
name: test ts library
runs-on: ubuntu-24.04
- needs: [
- lib_linux
- ]
+ needs: [build_coins]
steps:
- uses: actions/checkout@v4
with:
@@ -431,9 +286,7 @@ jobs:
fail-fast: false
matrix:
coin: [monero, wownero]
- needs: [
- lib_linux
- ]
+ needs: [build_coins]
runs-on: ubuntu-24.04
steps:
- uses: denoland/setup-deno@v2
@@ -458,10 +311,8 @@ jobs:
strategy:
matrix:
coin: [monero, wownero]
- needs: [
- lib_macos
- ]
- runs-on: macos-14
+ needs: [build_coins]
+ runs-on: macos-15
steps:
- uses: denoland/setup-deno@v2
with:
@@ -485,9 +336,7 @@ jobs:
strategy:
matrix:
coin: [monero, wownero]
- needs: [
- lib_linux
- ]
+ needs: [build_coins]
runs-on: ubuntu-24.04
steps:
- uses: denoland/setup-deno@v2
@@ -511,16 +360,13 @@ jobs:
SECRET_WALLET_MNEMONIC: ${{ secrets.SECRET_WALLET_MNEMONIC }}
SECRET_WALLET_RESTORE_HEIGHT: ${{ secrets.SECRET_WALLET_RESTORE_HEIGHT }}
-
integration_tests_macos:
name: macos integration tests
strategy:
matrix:
coin: [monero, wownero]
- needs: [
- lib_macos
- ]
- runs-on: macos-14
+ needs: [build_coins]
+ runs-on: macos-15
steps:
- uses: denoland/setup-deno@v2
with:
@@ -543,13 +389,10 @@ jobs:
SECRET_WALLET_MNEMONIC: ${{ secrets.SECRET_WALLET_MNEMONIC }}
SECRET_WALLET_RESTORE_HEIGHT: ${{ secrets.SECRET_WALLET_RESTORE_HEIGHT }}
-
comment_pr:
name: comment on pr
runs-on: ubuntu-latest
- needs: [
- lib_mingw, lib_android, lib_linux, lib_macos, lib_ios,
- ]
+ needs: [build_coins]
steps:
- uses: actions/github-script@v7
continue-on-error: true
@@ -557,10 +400,8 @@ jobs:
with:
script: |
if (context.issue.number) {
- // Return issue number if present
return context.issue.number;
} else {
- // Otherwise return issue number from commit
return (
await github.rest.repos.listPullRequestsAssociatedWithCommit({
commit_sha: context.sha,
@@ -595,4 +436,4 @@ jobs:
with:
issue-number: ${{steps.get_issue_number.outputs.result}}
body: |
- [download artifacts #${{github.run_id}}](https://nightly.link/MrCyjaneK/monero_c/actions/runs/${{github.run_id}}) (this comment will update whenever you push)
+ [download artifacts #${{github.run_id}}](https://nightly.link/MrCyjaneK/monero_c/actions/runs/${{github.run_id}}) (this comment will update whenever you push) \ No newline at end of file
diff --git a/.github/workflows/submodule-check.yml b/.github/workflows/submodule-check.yml
new file mode 100644
index 0000000..ca588e9
--- /dev/null
+++ b/.github/workflows/submodule-check.yml
@@ -0,0 +1,35 @@
+name: Submodule Check
+
+on: [ push ]
+
+jobs:
+ check-submodules:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Run submodule scanner
+ run: |
+ # Create baseline scan if it doesn't exist
+ if [ ! -f tools/mirror/submodule-list.txt ]; then
+ mkdir -p tools/mirror
+ touch tools/mirror/submodule-list.txt
+ fi
+
+ # Save current list
+ cp tools/mirror/submodule-list.txt /tmp/original-submodules.txt
+
+ # Run scanner
+ bash tools/mirror/submodule-scanner.sh
+
+ # Compare files
+ if ! cmp -s /tmp/original-submodules.txt tools/mirror/submodule-list.txt; then
+ echo "Error: New submodules detected!"
+ echo "Diff between original and new submodules:"
+ diff /tmp/original-submodules.txt tools/mirror/submodule-list.txt || true
+ exit 1
+ fi
+
+ echo "No new submodules detected." \ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 7dc5983..385f6ae 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@ release/
build/
tests/dependencies
tests/wallets
+full-run \ No newline at end of file
diff --git a/README.md b/README.md
index 5ed7564..8034c71 100644
--- a/README.md
+++ b/README.md
@@ -7,9 +7,7 @@
TL;DR:
```bash
-$ rm -rf monero wownero release
-$ git submodule update --init --recursive --force
-$ for coin in monero wownero zano; do ./apply_patches.sh $coin; done
+$ ./build_single.sh monero $(gcc -dumpmachine) -j$(nproc)
```
Broken? Not working? Need help? https://moneroc.mrcyjanek.net/
diff --git a/apply_patches.sh b/apply_patches.sh
index 8013c9d..81ef25c 100755
--- a/apply_patches.sh
+++ b/apply_patches.sh
@@ -1,67 +1,290 @@
#!/bin/bash
+set -euo pipefail
cd "$(realpath $(dirname $0))"
-repo="$1"
+WORKDIR="$PWD"
-if [[ "x$repo" == "x" ]];
-then
- echo "Usage: $0 monero/wownero"
- exit 1
-fi
+MIRROR_URL="https://static.mrcyjanek.net/download_mirror/git/mirror.git"
+SUPPORTED_REPOS=("monero" "wownero" "zano")
+ROOT_COMMIT=$(git rev-parse HEAD)
-if [[ "x$repo" != "xwownero" && "x$repo" != "xmonero" ]];
-then
- echo "Usage: $0 monero/wownero"
- echo "Invalid target given, only monero and wownero are supported targets"
-fi
+# Function to try getting repo from bundle
+try_bundle() {
+ local repo="$1"
+ local target_commit="$2"
+ local original_url=$(git config -f .gitmodules submodule.$repo.url)
+
+ # Convert URL to bundle name using same logic as mirror.sh
+ local bundle_name=$(echo -n -e "$original_url" | sed 's|https://||' | sed 's|\.git$||' | tr '/' '-' | tr '.' '-' | tr '[:upper:]' '[:lower:]')-${target_commit:0:8}.bundle
+
+ echo "Attempting to clone from bundle: $bundle_name"
+ mkdir -p $WORKDIR/tools/mirror/mirrors/bundles
+ if [ -f "$WORKDIR/tools/mirror/mirrors/bundles/$bundle_name" ]; then
+ echo "Bundle already exists, using cached version"
+ if git clone "$WORKDIR/tools/mirror/mirrors/bundles/$bundle_name" "$repo"; then
+ return 0
+ fi
+ else
+ if curl -f -s -o "$WORKDIR/tools/mirror/mirrors/bundles/$bundle_name" "https://static.mrcyjanek.net/download_mirror/git/$bundle_name"; then
+ if git clone "$WORKDIR/tools/mirror/mirrors/bundles/$bundle_name" "$repo"; then
+ return 0
+ fi
+ fi
+ fi
+ return 1
+}
-if [[ ! -d "$repo" ]]
-then
- echo "no '$repo' directory found. clone with --recursive or run:"
- echo "$ git submodule init && git submodule update --force";
- exit 1
-fi
+# Function to update a single submodule
+update_submodule() {
+ local path="$1"
+ local parent_path="$2"
+ local full_path="${parent_path:+$parent_path/}$path"
+
+ echo "Updating submodule: $full_path"
+
+ # Get original URL from .gitmodules
+ original_url=$(git config -f .gitmodules submodule.$path.url)
+
+ # Get target commit - first try from the index (after patches), then fallback to config
+ target_commit=$(git ls-tree HEAD "$path" | awk '{print $3}' || \
+ git config -f .git/modules/$full_path/config core.commitish 2>/dev/null || \
+ git submodule status "$path" | awk '{print $1}' | sed 's/^[+-]//')
+
+ if [[ -z "$original_url" ]]; then
+ echo "Warning: No URL found for submodule $path in .gitmodules, skipping"
+ return 0
+ fi
+
+ echo "Original URL: $original_url"
+ echo "Target commit: $target_commit"
+
+ # Store the original directory
+ local original_dir="$PWD"
+
+ # Try original URL first
+ if ! git submodule update --init --force "$path"; then
+ echo "Failed with original URL, trying bundle for $path..."
+ rm -rf "$path"
+ # Try bundle
+ if ! try_bundle "$path" "$target_commit"; then
+ echo "Bundle attempt failed for $path"
+ # Try original URL one last time
+ if ! git clone "$original_url" "$path"; then
+ echo "Both bundle and original source failed for $path"
+ return 1
+ fi
+ fi
+
+ # Checkout the correct commit
+ cd "$path"
+ if ! git checkout "$target_commit"; then
+ echo "Failed to checkout target commit $target_commit"
+ cd "$original_dir"
+ return 1
+ fi
+
+ # Update any nested submodules
+ if [[ -f ".gitmodules" ]]; then
+ echo "Updating nested submodules in $full_path"
+ while IFS= read -r submodule; do
+ local subpath
+ subpath=$(echo "$submodule" | awk '{print $2}')
+ update_submodule "$subpath" "$full_path"
+ done < <(git config -f .gitmodules --get-regexp '^submodule\..*\.path$')
+ fi
+ cd "$original_dir"
+ fi
+}
-if [[ -f "$repo/.patch-applied" ]];
-then
- echo "$repo/.patch-applied file exist. manual investigation recommended."
- exit 0
-fi
+# Function to check if repatching is needed
+needs_repatching() {
+ local repo="$1"
+ local current_root_commit="$2"
+
+ if [[ ! -f "$repo/.patch-applied" ]]; then
+ return 0 # True, needs patching
+ fi
+
+ # Get stored commit hash from .patch-applied
+ local stored_commit
+ stored_commit=$(cat "$repo/.patch-applied")
+
+ if [[ "$stored_commit" != "$current_root_commit" ]]; then
+ echo "Root repository changed ($stored_commit -> $current_root_commit)"
+ echo "Removing releases/$repo directory..."
+ rm -rf "releases/$repo"
+ return 0 # True, needs patching
+ fi
+
+ return 1 # False, no need to patch
+}
+
+# Function to process a single repository
+process_repo() {
+ local repo="$1"
+ echo "Processing $repo..."
+
+ # Get target commit before attempting any clones
+ local target_commit
+ target_commit=$(git config -f .git/modules/$repo/config core.commitish || git submodule status "$repo" | awk '{print $1}' | sed 's/^[+-]//')
+
+ # Check if repatching is needed
+ if ! needs_repatching "$repo" "$ROOT_COMMIT"; then
+ echo "No repatching needed for $repo (already at current root commit)"
+ return 0
+ fi
+ BASE_PATH="$PWD"
+ # If directory doesn't exist or needs update, try cloning
+ if [[ ! -d "$repo" ]]; then
+ echo "Fetching $repo..."
+ # Try original URL first
+ if ! git submodule update --init --recursive --force "$repo"; then
+ echo "Failed with original URL, trying bundle..."
+ rm -rf "$repo"
+ # Try bundle
+ if ! try_bundle "$repo" "$target_commit"; then
+ echo "Bundle attempt failed for $repo"
+ # Try original URL one last time with direct clone
+ original_url=$(git config -f .gitmodules submodule.$repo.url)
+ if ! git clone --recursive "$original_url" "$repo"; then
+ echo "Both bundle and original source failed for $repo"
+ return 1
+ fi
+ fi
+
+ # Checkout the correct commit
+ cd "$repo"
+ if ! git checkout "$target_commit"; then
+ echo "Failed to checkout target commit $target_commit"
+ cd - >/dev/null
+ return 1
+ fi
+
+ # Update any nested submodules
+ if [[ -f ".gitmodules" ]]; then
+ echo "Updating nested submodules in $repo"
+ while IFS= read -r submodule; do
+ local subpath
+ subpath=$(echo "$submodule" | awk '{print $2}')
+ update_submodule "$subpath" "" # Pass empty string as initial parent path
+ done < <(git config -f .gitmodules --get-regexp '^submodule\..*\.path$')
+ fi
+ cd - >/dev/null
+ fi
+ fi
+ cd "$BASE_PATH"
+ if [[ ! -d "$repo" ]]; then
+ echo "Failed to fetch $repo"
+ return 1
+ fi
+
+ # Verify repository is properly initialized
+ pushd "$repo"
+ if ! git rev-parse --git-dir > /dev/null 2>&1; then
+ echo "Error: $repo is not a valid git repository"
+ popd
+ return 1
+ fi
+
+ # Verify we have a clean working directory
+ if ! git diff --quiet HEAD; then
+ echo "Error: $repo has uncommitted changes"
+ popd
+ return 1
+ fi
+
+ # Apply patches
+ echo "Applying patches..."
+ if ! git am -3 --whitespace=fix --reject ../patches/$repo/*.patch; then
+ echo "Error: Failed to apply patches to $repo"
+ git am --abort
+ popd
+ return 1
+ fi
+
+ # Create .patch-applied marker with root commit hash
+ echo "$ROOT_COMMIT" > .patch-applied
+ git add .patch-applied
+ git commit -m "add .patch-applied with root commit: ${ROOT_COMMIT}"
+
+ # Check if submodules changed after patching
+ if [[ -f ".gitmodules" ]]; then
+ echo "Checking for submodule changes after patching..."
+ while IFS= read -r submodule; do
+ local subpath
+ subpath=$(echo "$submodule" | awk '{print $2}')
+ update_submodule "$subpath" ""
+ done < <(git config -f .gitmodules --get-regexp '^submodule\..*\.path$')
+ fi
-set -e
-cd $repo
-git am -3 --whitespace=fix --reject ../patches/$repo/*.patch
-if [[ "$repo" == "wownero" ]];
-then
- pushd external/randomwow
- git remote set-url origin https://github.com/mrcyjanek/randomwow.git
- popd
-fi
-if [[ "$repo" == "zano" ]];
-then
- pushd contrib/tor-connect
- git remote set-url origin https://github.com/mrcyjanek/tor-connect.git
popd
+ echo "Finished processing $repo"
+}
+
+# Function to fetch wownero-seed submodule
+fetch_wownero_seed() {
+ local repo="wownero_libwallet2_api_c/wownero-seed"
+ echo "Fetching $repo..."
+
+ # Create directory structure
+ mkdir -p "$(dirname "$repo")"
+
+ # Skip if already exists
+ if [[ -d "$repo" ]]; then
+ echo "$repo already exists, skipping"
+ return 0
+ fi
+
+ # Get target commit
+ local target_commit
+ target_commit=$(git config -f .git/modules/$repo/config core.commitish || git submodule status "$repo" | awk '{print $1}' | sed 's/^[+-]//')
+
+ # Try original URL first
+ if ! git submodule update --init --force "$repo"; then
+ echo "Failed with original URL, trying bundle..."
+ rm -rf "$repo"
+ # Try bundle
+ if ! try_bundle "$repo" "$target_commit"; then
+ echo "Bundle attempt failed for $repo"
+ # Try original URL one last time with direct clone
+ original_url=$(git config -f .gitmodules submodule.$repo.url)
+ if ! git clone --recursive "$original_url" "$repo"; then
+ echo "Both bundle and original source failed for $repo"
+ return 1
+ fi
+ fi
+
+ # Checkout the correct commit
+ cd "$repo"
+ git checkout "$target_commit"
+ cd - >/dev/null
+ fi
+}
+
+# Main script
+fetch_wownero_seed # Add this line before the main repository processing
+
+if [[ $# -eq 0 ]]; then
+ # No arguments, process all repositories
+ echo "No repository specified, processing all repositories..."
+ for repo in "${SUPPORTED_REPOS[@]}"; do
+ echo "=== Processing $repo ==="
+ if ! process_repo "$repo"; then
+ echo "Warning: Failed to process $repo"
+ fi
+ echo "=== Finished $repo ==="
+ echo
+ done
+else
+ # Process specific repository
+ repo="$1"
+ if [[ ! " ${SUPPORTED_REPOS[@]} " =~ " ${repo} " ]]; then
+ echo "Usage: $0 [monero/wownero/zano]"
+ echo "Invalid target given, only monero, wownero and zano are supported targets"
+ exit 1
+ fi
+ process_repo "$repo"
fi
-git submodule init
-git submodule update --init --recursive --force
-git am -3 <<EOF
-From e56dd6cd0fb1a5e55d3cb08691edf24b26d65299 Mon Sep 17 00:00:00 2001
-From: Czarek Nakamoto <cyjan@mrcyjanek.net>
-Date: Fri, 20 Dec 2024 09:18:08 +0100
-Subject: [PATCH] add .patch-applied
-
----
- .patch-applied | 0
- 1 file changed, 0 insertions(+), 0 deletions(-)
- create mode 100644 .patch-applied
-
-diff --git a/.patch-applied b/.patch-applied
-new file mode 100644
-index 000000000..e69de29bb
---
-2.39.5 (Apple Git-154)
-EOF
-
-echo "you are good to go!"
+
+echo "All done!"
diff --git a/build_single.sh b/build_single.sh
index c0ace0d..7809666 100755
--- a/build_single.sh
+++ b/build_single.sh
@@ -18,11 +18,6 @@ function verbose_copy() {
set -e
repo=$1
-if [[ "x$repo" == "x" ]];
-then
- echo "Usage: $0 monero/wownero/zano $(gcc -dumpmachine) -j$proccount"
- exit 1
-fi
if [[ "x$repo" != "xwownero" && "x$repo" != "xmonero" && "x$repo" != "xzano" ]];
then
@@ -31,13 +26,6 @@ then
exit 1
fi
-if [[ ! -d "$repo" ]]
-then
- echo "no '$repo' directory found. clone with --recursive or run:"
- echo "$ git submodule init && git submodule update --force";
- exit 1
-fi
-
HOST_ABI="$2"
if [[ "x$HOST_ABI" == "x" ]];
then
@@ -54,13 +42,11 @@ then
fi
cd $(dirname $0)
WDIR=$PWD
+
+./apply_patches.sh $repo
+
pushd contrib/depends
- if [[ -d $HOST_ABI ]];
- then
- echo "Not building depends, directory exists"
- else
- env -i PATH="$PATH" CC=gcc CXX=g++ make "$NPROC" HOST="$HOST_ABI"
- fi
+ env -i PATH="$PATH" CC=gcc CXX=g++ make "$NPROC" HOST="$HOST_ABI"
popd
buildType=Debug
@@ -83,28 +69,18 @@ pushd release/$repo
APPENDIX=""
if [[ "${HOST_ABI}" == "x86_64-w64-mingw32" || "${HOST_ABI}" == "i686-w64-mingw32" ]];
then
- echo "TODO: check if it's still needed"
APPENDIX="${APPENDIX}dll"
- # cp ../../$repo/build/${HOST_ABI}/external/polyseed/libpolyseed.${APPENDIX} ${HOST_ABI}_libpolyseed.${APPENDIX}
- # rm ${HOST_ABI}_libpolyseed.${APPENDIX}.xz || true
- # xz -e ${HOST_ABI}_libpolyseed.${APPENDIX}
elif [[ "${HOST_ABI}" == "x86_64-apple-darwin11" || "${HOST_ABI}" == "aarch64-apple-darwin11" || "${HOST_ABI}" == "host-apple-darwin" || "${HOST_ABI}" == "x86_64-host-apple-darwin" || "${HOST_ABI}" == "aarch64-apple-darwin" || "${HOST_ABI}" == "x86_64-apple-darwin" || "${HOST_ABI}" == "host-apple-ios" || "${HOST_ABI}" == "aarch64-apple-ios" || "${HOST_ABI}" == "aarch64-apple-iossimulator" ]];
then
APPENDIX="${APPENDIX}dylib"
else
APPENDIX="${APPENDIX}so"
fi
- xz -ek ../../${repo}_libwallet2_api_c/build/${HOST_ABI}/libwallet2_api_c.${APPENDIX}
- mv ../../${repo}_libwallet2_api_c/build/${HOST_ABI}/libwallet2_api_c.${APPENDIX}.xz ${HOST_ABI}_libwallet2_api_c.${APPENDIX}.xz
+ cp ../../${repo}_libwallet2_api_c/build/${HOST_ABI}/libwallet2_api_c.${APPENDIX} ${HOST_ABI}_libwallet2_api_c.${APPENDIX}
# Extra libraries
if [[ "$HOST_ABI" == "x86_64-w64-mingw32" || "$HOST_ABI" == "i686-w64-mingw32" ]];
then
cp /usr/${HOST_ABI}/lib/libwinpthread-1.dll ${HOST_ABI}_libwinpthread-1.dll
- rm ${HOST_ABI}_libwinpthread-1.dll.xz || true
- xz -ek ${HOST_ABI}_libwinpthread-1.dll
- ####
cp /usr/lib/gcc/${HOST_ABI}/*-posix/libssp-0.dll ${HOST_ABI}_libssp-0.dll
- rm ${HOST_ABI}_libssp-0.dll.xz || true
- xz -ek ${HOST_ABI}_libssp-0.dll
fi
popd
diff --git a/patches/monero/0008-polyseed.patch b/patches/monero/0008-polyseed.patch
index 9289fc0..ffa9204 100644
--- a/patches/monero/0008-polyseed.patch
+++ b/patches/monero/0008-polyseed.patch
@@ -51,7 +51,7 @@ index 72af74d..b838e84 100644
+ url = https://github.com/JuliaStrings/utf8proc.git
+[submodule "external/polyseed"]
+ path = external/polyseed
-+ url = https://github.com/tevador/polyseed.git
++ url = https://github.com/MrCyjaneK/polyseed.git
[submodule "external/supercop"]
path = external/supercop
url = https://github.com/monero-project/supercop
diff --git a/patches/wownero/0002-fix-missing-___clear_cache-when-targetting-iOS.patch b/patches/wownero/0002-fix-missing-___clear_cache-when-targetting-iOS.patch
index ca9ccfd..f506f4a 100644
--- a/patches/wownero/0002-fix-missing-___clear_cache-when-targetting-iOS.patch
+++ b/patches/wownero/0002-fix-missing-___clear_cache-when-targetting-iOS.patch
@@ -1,12 +1,25 @@
-From 4828befb3843764eaaa5e5ea489cde6d101d71ce Mon Sep 17 00:00:00 2001
+From 4ea7d3ee65332d9c7c774e2c6959d044fdc909ce Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Wed, 23 Oct 2024 15:18:21 +0200
Subject: [PATCH 02/15] fix missing ___clear_cache when targetting iOS
---
+ .gitmodules | 2 +-
external/randomwow | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+diff --git a/.gitmodules b/.gitmodules
+index 991071fbe..f0ebd61a0 100644
+--- a/.gitmodules
++++ b/.gitmodules
+@@ -14,6 +14,6 @@
+ branch = monero
+ [submodule "external/randomwow"]
+ path = external/randomwow
+- url = https://codeberg.org/wownero/RandomWOW
++ url = https://github.com/MrCyjaneK/RandomWOW
+ branch = 1.2.1-wow
+
diff --git a/external/randomwow b/external/randomwow
index 27b099b6d..6f30d4b92 160000
--- a/external/randomwow
@@ -15,5 +28,5 @@ index 27b099b6d..6f30d4b92 160000
-Subproject commit 27b099b6dd6fef6e17f58c6dfe00009e9c5df587
+Subproject commit 6f30d4b924fecb231e5b683915cc75d18b3b5866
--
-2.48.0
+2.48.1
diff --git a/patches/wownero/0007-UR-functions.patch b/patches/wownero/0007-UR-functions.patch
index 0bdc695..c6892c9 100644
--- a/patches/wownero/0007-UR-functions.patch
+++ b/patches/wownero/0007-UR-functions.patch
@@ -45,7 +45,7 @@ index 991071fbe..b24855d9b 100644
+++ b/.gitmodules
@@ -16,4 +16,7 @@
path = external/randomwow
- url = https://codeberg.org/wownero/RandomWOW
+ url = https://github.com/MrCyjaneK/RandomWOW
branch = 1.2.1-wow
-
+[submodule "external/bc-ur"]
diff --git a/patches/wownero/0009-polyseed.patch b/patches/wownero/0009-polyseed.patch
index 6f5d5d3..615a7b3 100644
--- a/patches/wownero/0009-polyseed.patch
+++ b/patches/wownero/0009-polyseed.patch
@@ -61,7 +61,7 @@ index b24855d9b..589676649 100644
+ url = https://github.com/JuliaStrings/utf8proc.git
+[submodule "external/polyseed"]
+ path = external/polyseed
-+ url = https://github.com/tevador/polyseed.git
++ url = https://github.com/MrCyjaneK/polyseed.git
\ No newline at end of file
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 86000f811..96056e324 100644
diff --git a/tests/.DS_Store b/tests/.DS_Store
deleted file mode 100644
index 6914114..0000000
--- a/tests/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/tools/mirror/.gitignore b/tools/mirror/.gitignore
new file mode 100644
index 0000000..24016b3
--- /dev/null
+++ b/tools/mirror/.gitignore
@@ -0,0 +1,3 @@
+temp-list.txt
+mirror_work
+mirrors \ No newline at end of file
diff --git a/tools/mirror/mirror.sh b/tools/mirror/mirror.sh
new file mode 100644
index 0000000..7a2ab64
--- /dev/null
+++ b/tools/mirror/mirror.sh
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+# Create directories
+mkdir -p mirrors/bundles mirrors/temp
+
+# Function to convert URL to bundle name
+url_to_bundle_name() {
+ local url="$1"
+ local hash="$2"
+ # Remove https:// and .git, replace / and . with -
+ # Append first 8 chars of hash before .bundle
+ echo -n -e "$url" | sed 's|https://||' | sed 's|\.git$||' | tr '/' '-' | tr '.' '-' | tr '[:upper:]' '[:lower:]'
+ echo -n -e "-${hash:0:8}.bundle"
+}
+
+> mirrors/gitbundlemap.txt
+
+while read -r line; do
+ url=$(echo "$line" | cut -d' ' -f1)
+ commit=$(echo "$line" | cut -d' ' -f2)
+ if [ "$commit" == "b7a695cf4b41645a5f5c5a5c1f0d565b283a3585" ]; then
+ echo "Skipping $url ($commit)"
+ continue
+ fi
+ bundle_name="$(url_to_bundle_name "$url" "$commit")"
+
+ if [ ! -f "mirrors/bundles/$bundle_name" ]; then
+
+ echo "Processing $url ($commit) -> $bundle_name"
+
+ if curl -f -s -o "mirrors/bundles/$bundle_name" "https://static.mrcyjanek.net/download_mirror/git/$bundle_name"; then
+ echo "Downloaded existing bundle for $url ($commit)"
+ else
+ echo "No existing bundle found, cloning repository..."
+ rm -rf mirrors/temp/repo || true
+ # Clone repository
+ git clone --mirror "$url" "mirrors/temp/repo" || {
+ echo "Failed to clone $url"
+ exit 1
+ }
+
+ # Create bundle for specific commit
+ cd mirrors/temp/repo
+ git bundle create "../../bundles/$bundle_name" --all "$commit" || {
+ echo "Failed to create bundle for $url ($commit)"
+ cd ../../..
+ exit 1
+ }
+ cd ../../..
+
+ rm -rf mirrors/temp/repo
+ fi
+ fi
+
+ echo "$commit $bundle_name" >> mirrors/gitbundlemap.txt
+
+done < submodule-list.txt
+
+sort -u mirrors/gitbundlemap.txt -o mirrors/gitbundlemap.txt
+echo rsync -raz --progress $PWD/mirrors/bundles/'*' mrcyjanek@static.mrcyjanek.net:/home/mrcyjanek/web/static.mrcyjanek.net/public_html/download_mirror/git/
+echo "Done! Bundles are in mirrors/bundles/"
+echo "Commit mappings are in mirrors/gitbundlemap.txt" \ No newline at end of file
diff --git a/tools/mirror/pack_mirror.sh b/tools/mirror/pack_mirror.sh
new file mode 100644
index 0000000..5e13708
--- /dev/null
+++ b/tools/mirror/pack_mirror.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+set -e
+
+cd "$(dirname "$0")"
+
+MIRROR_DIR="$(pwd)/mirror_work/mirror.git"
+PACK_DIR="$(pwd)/mirror_work/pack"
+
+if [ ! -d "$MIRROR_DIR" ]; then
+ echo "Error: Mirror repository not found at $MIRROR_DIR"
+ exit 1
+fi
+
+rm -rf "$PACK_DIR"
+mkdir -p "$PACK_DIR"
+
+cp -r "$MIRROR_DIR" "$PACK_DIR/mirror.git"
+
+cd "$PACK_DIR/mirror.git"
+
+echo "Optimizing repository..."
+git gc --aggressive --prune=now
+
+git pack-refs --all
+
+rm -rf hooks/* info/* logs/* packed-refs.old
+
+git show-ref > info/refs
+
+git update-server-info
+
+mkdir -p objects
+
+while read -r hash ref; do
+ dir=${hash:0:2}
+ file=${hash:2}
+ mkdir -p "objects/$dir"
+
+ git cat-file -p "$hash" > "objects/$dir/$file"
+done < info/refs
+
+rm -rf "$TEMP_REPO"
+
+rm -f config
+
+cd "$PACK_DIR"
+
+echo rsync --delete -raz --progress "$PACK_DIR/mirror.git" "mrcyjanek@static.mrcyjanek.net:/home/mrcyjanek/web/static.mrcyjanek.net/public_html/download_mirror/git/"
+echo "Mirror packaged successfully at: $PACK_DIR/mirror.git" \ No newline at end of file
diff --git a/tools/mirror/submodule-list.txt b/tools/mirror/submodule-list.txt
new file mode 100644
index 0000000..fe8b64e
--- /dev/null
+++ b/tools/mirror/submodule-list.txt
@@ -0,0 +1,59 @@
+https://codeberg.org/wownero/RandomWOW 27b099b6dd6fef6e17f58c6dfe00009e9c5df587
+https://codeberg.org/wownero/wownero 3e302be710f4e6b4f58642989c8e47711362fa56
+https://codeberg.org/wownero/wownero 589efde6b3d6494645c0264a0a354d039c0f46fe
+https://codeberg.org/wownero/wownero dd46a31f3cab67b316e9239b15acf7d5cea60aa9
+https://git.wownero.com/wowlet/wownero-seed.git d3f68be347facfeebbd8f68fd74982c705cb917b
+https://git.wownero.com/wownero/RandomWOW 27b099b6dd6fef6e17f58c6dfe00009e9c5df587
+https://git.wownero.com/wownero/RandomWOW 607bad48f3687c2490d90f8c55efa2dcd7cbc195
+https://git.wownero.com/wownero/wownero 1b8475003c065b0387f21323dad8a03b131ae7d1
+https://git.wownero.com/wownero/wownero 589efde6b3d6494645c0264a0a354d039c0f46fe
+https://github.com/JuliaStrings/utf8proc.git 3de4596fbe28956855df2ecb3c11c0bbc3535838
+https://github.com/MrCyjaneK/OpenSSL-for-iPhone.git 394bac11f4347cc21b4ba976c1c0629afaf67c54
+https://github.com/MrCyjaneK/OpenSSL-for-iPhone.git d3ec433a47708594d18ef6e248b66e3d64f00f0f
+https://github.com/MrCyjaneK/RandomWOW 6f30d4b924fecb231e5b683915cc75d18b3b5866
+https://github.com/MrCyjaneK/RandomX ce72c9bb9cb799e0d9171094b9abb009e04c5bfc
+https://github.com/MrCyjaneK/bc-ur d82e7c753e710b8000706dc3383b498438795208
+https://github.com/MrCyjaneK/polyseed.git bd79f5014c331273357277ed8a3d756fb61b9fa1
+https://github.com/MrCyjaneK/wownero-seed 4a4e5b6c54c1710aa185cb0838b087238cbfc9a2
+https://github.com/NLnetLabs/unbound.git cbed768b8ff9bfcf11089a5f1699b7e5707f1ea5
+https://github.com/Tencent/rapidjson 129d19ba7f496df5e33658527a7158c79b99c21c
+https://github.com/Thalhammer/jwt-cpp.git 364a5572f4b46bb9f4304cb1c92acec8ddb2c620
+https://github.com/bitcoin-core/secp256k1.git a5269373fa13ff845f654d81b90629dd78495641
+https://github.com/cake-tech/Apple-Boost-BuildScript.git 513dd145f6e67a694160b858957978e375c8d694
+https://github.com/ethereum-lists/tokens.git 88414ef852e21279f217d2f3f8fd439cd7c5fd9f
+https://github.com/google/googletest.git 0a439623f75c029912728d80cb7f1b8b48739ca4
+https://github.com/hyle-team/tor-connect.git b589edb1906dccb387cfeded6ed12286c5f0405f
+https://github.com/hyle-team/zano 2817090c8ac7639d6f697d00fc8bcba2b3681d90
+https://github.com/hyle-team/zano_ui.git 7cd0e5e54a0d692ea819b9653f60a1cd5512dc2b
+https://github.com/jedisct1/libsodium.git 3c6da4b8c27c7d546746eadabc9e2dd6c1fdfc2c
+https://github.com/jedisct1/libsodium.git 443617d7507498f7477703f0b51cb596d4539262
+https://github.com/jedisct1/libsodium.git fb80cbfa59cb97c7e867074416bfde3ec337c05a
+https://github.com/leetal/ios-cmake 06465b27698424cf4a04a5ca4904d50a3c966c45
+https://github.com/leetal/ios-cmake ad96a372b168930c2a1ff9455e1a9ccb13021617
+https://github.com/libexpat/libexpat.git 038a0bf44f940ad7f7df59cfa5ed6fcb2c63f64f
+https://github.com/libexpat/libexpat.git 3bab6c09bbe8bf42d84b81563ddbcf4cca4be838
+https://github.com/libexpat/libexpat.git 46cf63aef169f8f12ea09579db883c5251bd47d0
+https://github.com/libexpat/libexpat.git 624da0f593bb8d7e146b9f42b06d8e6c80d032a3
+https://github.com/libexpat/libexpat.git ed4090af841ebd8a7b2e367280407d74e748a7dd
+https://github.com/miniupnp/miniupnp 544e6fcc73c5ad9af48a8985c94f0f1d742ef2e0
+https://github.com/miniupnp/miniupnp b55145ec095652289a59c33603f3abafee898273
+https://github.com/miniupnp/miniupnp bd836936f7ed7e697f36dff709d00a907644172a
+https://github.com/monero-project/monero 13002ddd4b1ba4b4dcd7c47aa368a87c353b2225
+https://github.com/monero-project/monero 81d4db08eb75ce5392c65ca6571e7b08e41b7c95
+https://github.com/monero-project/monero b089f9ee69924882c5d14dd1a6991deb05d9d1cd
+https://github.com/monero-project/monero b7a695cf4b41645a5f5c5a5c1f0d565b283a3585
+https://github.com/monero-project/monero ef3e18b51beb937c7f786ecef0d0a0e3f6295082
+https://github.com/monero-project/supercop 633500ad8c8759995049ccd022107d1fa8a1bbc9
+https://github.com/tevador/RandomX 102f8acf90a7649ada410de5499a7ec62e49e1da
+https://github.com/tevador/polyseed 3ef366993258a6f1c837d4908e3e4afb2cfefff7
+https://github.com/tevador/polyseed b7c35bb3c6b91e481ecb04fc235eaff69c507fa1
+https://github.com/trezor/trezor-common.git bff7fdfe436c727982cc553bdfb29a9021b423b0
+https://github.com/wownero-mirror/wownero 589efde6b3d6494645c0264a0a354d039c0f46fe
+https://github.com/wownero-mirror/wownero dd46a31f3cab67b316e9239b15acf7d5cea60aa9
+https://github.com/wownero-mirror/wownero-seed d3f68be347facfeebbd8f68fd74982c705cb917b
+https://github.com/x2on/OpenSSL-for-iPhone.git 394bac11f4347cc21b4ba976c1c0629afaf67c54
+https://github.com/zeromq/libzmq 0ed7a08cd946e0832ac4655b7a76c09ac221f63b
+https://github.com/zeromq/libzmq 59c91227b46b60b7f965816544b25fe0a3cc8bbe
+https://github.com/zeromq/libzmq 64db7d28fea695132834f6d2c5949cfea2f22d01
+https://github.com/zeromq/libzmq 90b4f410a07222fa2e9a5f53b454a09d4533e45a
+https://github.com/zeromq/libzmq b95d94935ed107679fd0ad9efd2f3d47309b6fd3
diff --git a/tools/mirror/submodule-scanner.sh b/tools/mirror/submodule-scanner.sh
new file mode 100644
index 0000000..11b97f1
--- /dev/null
+++ b/tools/mirror/submodule-scanner.sh
@@ -0,0 +1,101 @@
+#!/bin/bash
+set -euo pipefail
+
+cd "$(dirname "$0")"
+
+OUTPUT_DIR="$PWD"
+OUTPUT_FILE="${OUTPUT_DIR}/submodule-list.txt"
+TEMP_FILE="${OUTPUT_DIR}/temp-list.txt"
+
+mkdir -p "${OUTPUT_DIR}"
+
+> "${TEMP_FILE}"
+
+TEMP_DIR=$(mktemp -d)
+trap 'rm -rf "${TEMP_DIR}"' EXIT
+
+process_current_submodules() {
+ local repo_path="$1"
+ local is_main_repo="$2"
+ local parent_path="${3:-}"
+ local original_dir="$PWD"
+ cd "${repo_path}"
+
+ echo "DEBUG: Processing submodules in: $(pwd)"
+
+ if [[ -f ".gitmodules" ]]; then
+ echo "DEBUG: Found .gitmodules file"
+ git config --file .gitmodules --get-regexp '^submodule\.[^\.]+\.url' | while read -r key url; do
+ name=${key#submodule.}
+ name=${name%.url}
+
+ path=$(git config --file "${PWD}/.gitmodules" --get "submodule.${name}.path")
+
+ if [[ -z "$path" ]]; then
+ echo "Warning: Empty path for submodule ${name}, skipping..."
+ continue
+ fi
+
+ full_path="${parent_path:+$parent_path/}${path}"
+
+ url=$(echo "$url" | tr -d '"' | tr -d "'")
+
+ echo "DEBUG: Found submodule: name=${name}, path=${full_path}, url=${url}"
+
+ if [[ -d "${path}" ]]; then
+ hash=$(git submodule status "${path}" 2>/dev/null | awk '{print $1}' | tr -d '+' | tr -d '-' || echo "")
+ if [[ "${hash}" == "b7a695cf4b41645a5f5c5a5c1f0d565b283a3585" ]]; then
+ echo "Skipping known problematic commit: ${commit}"
+ return 0
+ fi
+ if [[ -n "${hash}" ]]; then
+ echo "${url} ${hash}" >> "${TEMP_FILE}"
+
+ echo "DEBUG: Initializing submodule: ${path}"
+ if git submodule update --force --init "${path}" 2>/dev/null; then
+ if [[ -f "${path}/.gitmodules" ]]; then
+ echo "DEBUG: Processing nested submodules in ${full_path}"
+ process_current_submodules "${PWD}/${path}" "false" "${full_path}"
+ fi
+ else
+ echo "Warning: Could not update submodule ${full_path} at commit ${hash}, skipping..."
+ continue
+ fi
+ else
+ echo "Warning: Could not get hash for submodule ${full_path}, skipping..."
+ exit 1
+ fi
+ fi
+ done
+ fi
+ cd "${original_dir}"
+}
+
+process_main_repo() {
+ local repo_path="$1"
+ cd "${repo_path}"
+
+ echo "Getting commit history for main repository..."
+ local COMMITS=$(git log --format="%H" --reverse)
+
+ for commit in $COMMITS; do
+ echo "Processing commit: ${commit}"
+
+ git checkout --force "${commit}"
+ git reset --hard
+
+ process_current_submodules "${repo_path}" "true"
+ done
+}
+
+echo "Cloning repository to temporary directory..."
+git clone --no-checkout https://github.com/MrCyjaneK/monero_c --branch develop "${TEMP_DIR}/main"
+
+process_main_repo "${TEMP_DIR}/main"
+
+cat "${OUTPUT_FILE}" >> "${TEMP_FILE}"
+sort -u "${TEMP_FILE}" > "${OUTPUT_FILE}"
+
+rm "${TEMP_FILE}"
+
+echo "Submodule information has been written to ${OUTPUT_FILE}"