From 80374e47083700a7df13a5611c1f956a750e8d5b Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 02:11:25 +0900 Subject: [PATCH 01/33] chore(workflow): run CI on both x86_64 and aarch64 Linux --- .github/workflows/CI.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e6ceab5..5b59c13 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -13,7 +13,8 @@ jobs: strategy: matrix: - toolchain: [stable, nightly] + toolchain: ['stable', 'nightly'] + platform: ['x86_64-unknown-linux-gnu', 'aarch64-unknown-linux-gnu'] steps: - uses: actions/checkout@v5 @@ -21,9 +22,12 @@ jobs: - run: | rustup update rustup default ${{ matrix.toolchain }} - rustup component add rustfmt ### required for the build script to work ### + rustup component add rustfmt ### required for the build script to work ### + rustup target add ${{ matrix.platform }} - name: check fails without MUJOCO_DIR + env: + CARGO_BUILD_TARGET: ${{ matrix.platform }} run: | if cargo build; then echo 'cargo check succeeded without mujoco, which is unexpected.' @@ -42,6 +46,8 @@ jobs: echo "LD_LIBRARY_PATH=$HOME/.mujoco/mujoco-3.3.2/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV - name: check succeeds with MUJOCO_DIR + env: + CARGO_BUILD_TARGET: ${{ matrix.platform }} run: | if cargo build; then echo 'cargo check succeeded with mujoco, as expected.' @@ -57,15 +63,18 @@ jobs: strategy: matrix: toolchain: [stable, nightly] + platform: ['x86_64-unknown-linux-gnu', 'aarch64-unknown-linux-gnu'] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: setup run: | rustup update rustup default ${{ matrix.toolchain }} - rustup component add rustfmt ### required for the build script to work ### + rustup component add rustfmt ### required for the build script to work ### + rustup target add ${{ matrix.platform }} + mkdir -p $HOME/.mujoco cd $HOME/.mujoco wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-x86_64.tar.gz @@ -81,6 +90,8 @@ jobs: cmake .. && make && sudo make install - name: run tests + env: + CARGO_BUILD_TARGET: ${{ matrix.platform }} run: | cargo test --lib cargo test --doc From 45a80256a0c0f6d419abb9b1e84b1f460600fba9 Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 02:17:58 +0900 Subject: [PATCH 02/33] fix mujoco downloading --- .github/workflows/CI.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 5b59c13..dcd1e27 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -40,8 +40,13 @@ jobs: run: | mkdir -p $HOME/.mujoco cd $HOME/.mujoco - wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-x86_64.tar.gz - tar -xzf mujoco-3.3.2-linux-x86_64.tar.gz + if [ "${{ matrix.platform }}" = "x86_64-unknown-linux-gnu" ]; then + wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-x86_64.tar.gz + tar -xzf mujoco-3.3.2-linux-x86_64.tar.gz + elif [ "${{ matrix.platform }}" = "aarch64-unknown-linux-gnu" ]; then + wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-aarch64.tar.gz + tar -xzf mujoco-3.3.2-linux-aarch64.tar.gz + fi echo "MUJOCO_DIR=$HOME/.mujoco/mujoco-3.3.2" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=$HOME/.mujoco/mujoco-3.3.2/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV @@ -77,8 +82,13 @@ jobs: mkdir -p $HOME/.mujoco cd $HOME/.mujoco - wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-x86_64.tar.gz - tar -xzf mujoco-3.3.2-linux-x86_64.tar.gz + if [ "${{ matrix.platform }}" = "x86_64-unknown-linux-gnu" ]; then + wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-x86_64.tar.gz + tar -xzf mujoco-3.3.2-linux-x86_64.tar.gz + elif [ "${{ matrix.platform }}" = "aarch64-unknown-linux-gnu" ]; then + wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-aarch64.tar.gz + tar -xzf mujoco-3.3.2-linux-aarch64.tar.gz + fi echo "MUJOCO_DIR=$HOME/.mujoco/mujoco-3.3.2" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=$HOME/.mujoco/mujoco-3.3.2/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV From 23eb32082f3b29afa3f8cec484398bf569b91213 Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 02:39:39 +0900 Subject: [PATCH 03/33] refactor around matrix & specify `C_INCLUDE_PATH`, `CPLUS_INCLUDE_PATH` --- .github/workflows/CI.yml | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index dcd1e27..c1e57c7 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: toolchain: ['stable', 'nightly'] - platform: ['x86_64-unknown-linux-gnu', 'aarch64-unknown-linux-gnu'] + arch: ['x86_64', 'aarch64'] steps: - uses: actions/checkout@v5 @@ -23,11 +23,13 @@ jobs: rustup update rustup default ${{ matrix.toolchain }} rustup component add rustfmt ### required for the build script to work ### - rustup target add ${{ matrix.platform }} + rustup target add ${{ matrix.arch }}-unknown-linux-gnu - name: check fails without MUJOCO_DIR env: - CARGO_BUILD_TARGET: ${{ matrix.platform }} + CARGO_BUILD_TARGET: ${{ matrix.arch }}-unknown-linux-gnu + C_INCLUDE_PATH: /usr/include/${{ matrix.arch }}-linux-gnu + CPLUS_INCLUDE_PATH: /usr/include/${{ matrix.arch }}-linux-gnu run: | if cargo build; then echo 'cargo check succeeded without mujoco, which is unexpected.' @@ -40,19 +42,16 @@ jobs: run: | mkdir -p $HOME/.mujoco cd $HOME/.mujoco - if [ "${{ matrix.platform }}" = "x86_64-unknown-linux-gnu" ]; then - wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-x86_64.tar.gz - tar -xzf mujoco-3.3.2-linux-x86_64.tar.gz - elif [ "${{ matrix.platform }}" = "aarch64-unknown-linux-gnu" ]; then - wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-aarch64.tar.gz - tar -xzf mujoco-3.3.2-linux-aarch64.tar.gz - fi + wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-${{ matrix.arch }}.tar.gz + tar -xzf mujoco-3.3.2-linux-${{ matrix.arch }}.tar.gz echo "MUJOCO_DIR=$HOME/.mujoco/mujoco-3.3.2" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=$HOME/.mujoco/mujoco-3.3.2/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV - name: check succeeds with MUJOCO_DIR env: - CARGO_BUILD_TARGET: ${{ matrix.platform }} + CARGO_BUILD_TARGET: ${{ matrix.arch }}-unknown-linux-gnu + C_INCLUDE_PATH: /usr/include/${{ matrix.arch }}-linux-gnu + CPLUS_INCLUDE_PATH: /usr/include/${{ matrix.arch }}-linux-gnu run: | if cargo build; then echo 'cargo check succeeded with mujoco, as expected.' @@ -68,7 +67,7 @@ jobs: strategy: matrix: toolchain: [stable, nightly] - platform: ['x86_64-unknown-linux-gnu', 'aarch64-unknown-linux-gnu'] + arch: ['x86_64', 'aarch64'] steps: - uses: actions/checkout@v5 @@ -78,17 +77,12 @@ jobs: rustup update rustup default ${{ matrix.toolchain }} rustup component add rustfmt ### required for the build script to work ### - rustup target add ${{ matrix.platform }} + rustup target add ${{ matrix.arch }} mkdir -p $HOME/.mujoco cd $HOME/.mujoco - if [ "${{ matrix.platform }}" = "x86_64-unknown-linux-gnu" ]; then - wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-x86_64.tar.gz - tar -xzf mujoco-3.3.2-linux-x86_64.tar.gz - elif [ "${{ matrix.platform }}" = "aarch64-unknown-linux-gnu" ]; then - wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-aarch64.tar.gz - tar -xzf mujoco-3.3.2-linux-aarch64.tar.gz - fi + wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-${{ matrix.arch }}.tar.gz + tar -xzf mujoco-3.3.2-linux-${{ matrix.arch }}.tar.gz echo "MUJOCO_DIR=$HOME/.mujoco/mujoco-3.3.2" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=$HOME/.mujoco/mujoco-3.3.2/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV @@ -101,7 +95,9 @@ jobs: - name: run tests env: - CARGO_BUILD_TARGET: ${{ matrix.platform }} + CARGO_BUILD_TARGET: ${{ matrix.arch }}-unknown-linux-gnu + C_INCLUDE_PATH: /usr/include/${{ matrix.arch }}-linux-gnu + CPLUS_INCLUDE_PATH: /usr/include/${{ matrix.arch }}-linux-gnu run: | cargo test --lib cargo test --doc From 8df6399803da9b96b49734ca16ea6fd54c6e42e9 Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 03:00:48 +0900 Subject: [PATCH 04/33] considering cross-building on ubuntu-latest = x86_64 --- .github/workflows/CI.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c1e57c7..e67d664 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -22,15 +22,15 @@ jobs: - run: | rustup update rustup default ${{ matrix.toolchain }} - rustup component add rustfmt ### required for the build script to work ### rustup target add ${{ matrix.arch }}-unknown-linux-gnu + rustup component add rustfmt ### required for the build script to work ### - name: check fails without MUJOCO_DIR - env: - CARGO_BUILD_TARGET: ${{ matrix.arch }}-unknown-linux-gnu - C_INCLUDE_PATH: /usr/include/${{ matrix.arch }}-linux-gnu - CPLUS_INCLUDE_PATH: /usr/include/${{ matrix.arch }}-linux-gnu run: | + if [ "${{ matrix.arch }}" = 'aarch64' ]; then + export C_INCLUDE_PATH=/usr/aarch64-linux-gnu/include + export CPLUS_INCLUDE_PATH=/usr/aarch64-linux-gnu/include + fi if cargo build; then echo 'cargo check succeeded without mujoco, which is unexpected.' exit 1 @@ -50,9 +50,11 @@ jobs: - name: check succeeds with MUJOCO_DIR env: CARGO_BUILD_TARGET: ${{ matrix.arch }}-unknown-linux-gnu - C_INCLUDE_PATH: /usr/include/${{ matrix.arch }}-linux-gnu - CPLUS_INCLUDE_PATH: /usr/include/${{ matrix.arch }}-linux-gnu run: | + if [ "${{ matrix.arch }}" = 'aarch64' ]; then + export C_INCLUDE_PATH=/usr/aarch64-linux-gnu/include + export CPLUS_INCLUDE_PATH=/usr/aarch64-linux-gnu/include + fi if cargo build; then echo 'cargo check succeeded with mujoco, as expected.' else @@ -76,8 +78,8 @@ jobs: run: | rustup update rustup default ${{ matrix.toolchain }} + rustup target add ${{ matrix.arch }}-unknown-linux-gnu rustup component add rustfmt ### required for the build script to work ### - rustup target add ${{ matrix.arch }} mkdir -p $HOME/.mujoco cd $HOME/.mujoco @@ -96,9 +98,11 @@ jobs: - name: run tests env: CARGO_BUILD_TARGET: ${{ matrix.arch }}-unknown-linux-gnu - C_INCLUDE_PATH: /usr/include/${{ matrix.arch }}-linux-gnu - CPLUS_INCLUDE_PATH: /usr/include/${{ matrix.arch }}-linux-gnu run: | + if [ "${{ matrix.arch }}" = 'aarch64' ]; then + export C_INCLUDE_PATH=/usr/aarch64-linux-gnu/include + export CPLUS_INCLUDE_PATH=/usr/aarch64-linux-gnu/include + fi cargo test --lib cargo test --doc cargo test --tests From 5acca91e29ae1b461a206232d45ad46c0e9c0616 Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 03:05:50 +0900 Subject: [PATCH 05/33] when aarch64 `export BINDGEN_EXTRA_CLANG_ARGS=-I/usr/aarch64-linux-gnu/include` --- .github/workflows/CI.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e67d664..09d9e0b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -30,6 +30,7 @@ jobs: if [ "${{ matrix.arch }}" = 'aarch64' ]; then export C_INCLUDE_PATH=/usr/aarch64-linux-gnu/include export CPLUS_INCLUDE_PATH=/usr/aarch64-linux-gnu/include + export BINDGEN_EXTRA_CLANG_ARGS=-I/usr/aarch64-linux-gnu/include fi if cargo build; then echo 'cargo check succeeded without mujoco, which is unexpected.' @@ -54,6 +55,7 @@ jobs: if [ "${{ matrix.arch }}" = 'aarch64' ]; then export C_INCLUDE_PATH=/usr/aarch64-linux-gnu/include export CPLUS_INCLUDE_PATH=/usr/aarch64-linux-gnu/include + export BINDGEN_EXTRA_CLANG_ARGS=-I/usr/aarch64-linux-gnu/include fi if cargo build; then echo 'cargo check succeeded with mujoco, as expected.' @@ -102,6 +104,7 @@ jobs: if [ "${{ matrix.arch }}" = 'aarch64' ]; then export C_INCLUDE_PATH=/usr/aarch64-linux-gnu/include export CPLUS_INCLUDE_PATH=/usr/aarch64-linux-gnu/include + export BINDGEN_EXTRA_CLANG_ARGS=-I/usr/aarch64-linux-gnu/include fi cargo test --lib cargo test --doc From 647c641a66dcc0d023174915ce08b20ebba31f44 Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 03:13:15 +0900 Subject: [PATCH 06/33] when aarch64 install g++-aarch64-linux-gnu --- .github/workflows/CI.yml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 09d9e0b..761df5e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -24,14 +24,12 @@ jobs: rustup default ${{ matrix.toolchain }} rustup target add ${{ matrix.arch }}-unknown-linux-gnu rustup component add rustfmt ### required for the build script to work ### + [ "${{ matrix.arch }}" = 'aarch64' ] && sudo apt update && sudo apt install -y g++-aarch64-linux-gnu - name: check fails without MUJOCO_DIR + env: + CARGO_BUILD_TARGET: ${{ matrix.arch }}-unknown-linux-gnu run: | - if [ "${{ matrix.arch }}" = 'aarch64' ]; then - export C_INCLUDE_PATH=/usr/aarch64-linux-gnu/include - export CPLUS_INCLUDE_PATH=/usr/aarch64-linux-gnu/include - export BINDGEN_EXTRA_CLANG_ARGS=-I/usr/aarch64-linux-gnu/include - fi if cargo build; then echo 'cargo check succeeded without mujoco, which is unexpected.' exit 1 @@ -52,11 +50,6 @@ jobs: env: CARGO_BUILD_TARGET: ${{ matrix.arch }}-unknown-linux-gnu run: | - if [ "${{ matrix.arch }}" = 'aarch64' ]; then - export C_INCLUDE_PATH=/usr/aarch64-linux-gnu/include - export CPLUS_INCLUDE_PATH=/usr/aarch64-linux-gnu/include - export BINDGEN_EXTRA_CLANG_ARGS=-I/usr/aarch64-linux-gnu/include - fi if cargo build; then echo 'cargo check succeeded with mujoco, as expected.' else @@ -82,6 +75,7 @@ jobs: rustup default ${{ matrix.toolchain }} rustup target add ${{ matrix.arch }}-unknown-linux-gnu rustup component add rustfmt ### required for the build script to work ### + [ "${{ matrix.arch }}" = 'aarch64' ] && sudo apt update && sudo apt install -y g++-aarch64-linux-gnu mkdir -p $HOME/.mujoco cd $HOME/.mujoco @@ -101,11 +95,6 @@ jobs: env: CARGO_BUILD_TARGET: ${{ matrix.arch }}-unknown-linux-gnu run: | - if [ "${{ matrix.arch }}" = 'aarch64' ]; then - export C_INCLUDE_PATH=/usr/aarch64-linux-gnu/include - export CPLUS_INCLUDE_PATH=/usr/aarch64-linux-gnu/include - export BINDGEN_EXTRA_CLANG_ARGS=-I/usr/aarch64-linux-gnu/include - fi cargo test --lib cargo test --doc cargo test --tests From cfabf9566b9f7154c78f55fa1ba36184f33ed003 Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 03:16:30 +0900 Subject: [PATCH 07/33] prevent if-fail --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 761df5e..14ee61c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -24,7 +24,7 @@ jobs: rustup default ${{ matrix.toolchain }} rustup target add ${{ matrix.arch }}-unknown-linux-gnu rustup component add rustfmt ### required for the build script to work ### - [ "${{ matrix.arch }}" = 'aarch64' ] && sudo apt update && sudo apt install -y g++-aarch64-linux-gnu + [ "${{ matrix.arch }}" = 'aarch64' ] && sudo apt update && sudo apt install -y g++-aarch64-linux-gnu || : - name: check fails without MUJOCO_DIR env: @@ -75,7 +75,7 @@ jobs: rustup default ${{ matrix.toolchain }} rustup target add ${{ matrix.arch }}-unknown-linux-gnu rustup component add rustfmt ### required for the build script to work ### - [ "${{ matrix.arch }}" = 'aarch64' ] && sudo apt update && sudo apt install -y g++-aarch64-linux-gnu + [ "${{ matrix.arch }}" = 'aarch64' ] && sudo apt update && sudo apt install -y g++-aarch64-linux-gnu || : mkdir -p $HOME/.mujoco cd $HOME/.mujoco From 28e350fec1704775a13115eb5e63b0f88b1747e7 Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 03:46:12 +0900 Subject: [PATCH 08/33] try `sudo dpkg --add-architecture arm64`, `:arm64` and `PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig` --- .github/workflows/CI.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 14ee61c..2d4585f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -63,7 +63,7 @@ jobs: strategy: matrix: - toolchain: [stable, nightly] + toolchain: ['stable', 'nightly'] arch: ['x86_64', 'aarch64'] steps: @@ -84,12 +84,22 @@ jobs: echo "MUJOCO_DIR=$HOME/.mujoco/mujoco-3.3.2" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=$HOME/.mujoco/mujoco-3.3.2/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV - - name: setup additional dependencies for examples +# - name: setup additional dependencies for examples +# run: | +# sudo apt update && sudo apt install -y cmake build-essential libwayland-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev +# git clone https://github.com/glfw/glfw.git +# mkdir -p glfw/build && cd glfw/build +# cmake .. && make && sudo make install + - name: setup additional dependencies for examples (x86_64) + if: matrix.arch == 'x86_64' + run: | + sudo apt-get update && sudo apt-get install -y libglfw3-dev libwayland-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev + - name: setup additional dependencies for examples (aarch64) + if: matrix.arch == 'aarch64' run: | - sudo apt update && sudo apt install -y cmake build-essential libwayland-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev - git clone https://github.com/glfw/glfw.git - mkdir -p glfw/build && cd glfw/build - cmake .. && make && sudo make install + sudo dpkg --add-architecture arm64 + sudo apt-get update && sudo apt-get install -y libglfw3-dev:arm64 libwayland-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 + echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV - name: run tests env: From 47eccbc9afbaf9476ca1f8c18a5a7a41faf5709a Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 03:53:45 +0900 Subject: [PATCH 09/33] try `libglfw3` apt package --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2d4585f..3e9396f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -93,12 +93,12 @@ jobs: - name: setup additional dependencies for examples (x86_64) if: matrix.arch == 'x86_64' run: | - sudo apt-get update && sudo apt-get install -y libglfw3-dev libwayland-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev + sudo apt-get update && sudo apt-get install -y libglfw3 libglfw3-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev - name: setup additional dependencies for examples (aarch64) if: matrix.arch == 'aarch64' run: | sudo dpkg --add-architecture arm64 - sudo apt-get update && sudo apt-get install -y libglfw3-dev:arm64 libwayland-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 + sudo apt-get update && sudo apt-get install -y libglfw3 libglfw3-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV - name: run tests From 5550cc7ada1428d5e5c7ceadb161b59c74426b7e Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 03:54:05 +0900 Subject: [PATCH 10/33] fill missing `:arm64` --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3e9396f..a1b284c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -98,7 +98,7 @@ jobs: if: matrix.arch == 'aarch64' run: | sudo dpkg --add-architecture arm64 - sudo apt-get update && sudo apt-get install -y libglfw3 libglfw3-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 + sudo apt-get update && sudo apt-get install -y libglfw3:arm64 libglfw3-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV - name: run tests From 2bf840e09da184869e0972877a9854b72fb3951b Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 04:00:24 +0900 Subject: [PATCH 11/33] try source build glfw with conditional dependency libs --- .github/workflows/CI.yml | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a1b284c..1dfd32f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -84,22 +84,28 @@ jobs: echo "MUJOCO_DIR=$HOME/.mujoco/mujoco-3.3.2" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=$HOME/.mujoco/mujoco-3.3.2/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV -# - name: setup additional dependencies for examples -# run: | -# sudo apt update && sudo apt install -y cmake build-essential libwayland-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev -# git clone https://github.com/glfw/glfw.git -# mkdir -p glfw/build && cd glfw/build -# cmake .. && make && sudo make install - - name: setup additional dependencies for examples (x86_64) - if: matrix.arch == 'x86_64' - run: | - sudo apt-get update && sudo apt-get install -y libglfw3 libglfw3-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev - - name: setup additional dependencies for examples (aarch64) - if: matrix.arch == 'aarch64' + - name: setup additional dependencies for examples run: | - sudo dpkg --add-architecture arm64 - sudo apt-get update && sudo apt-get install -y libglfw3:arm64 libglfw3-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 - echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV + if [ "${{ matrix.arch }}" = 'x86_64' ]; then + sudo apt update && sudo apt install -y cmake build-essential libwayland-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev + elif [ "${{ matrix.arch }}" = 'aarch64' ]; then + sudo dpkg --add-architecture arm64 + echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV + sudo apt update && sudo apt install -y cmake:arm64 build-essential:arm64 libwayland-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 + fi + git clone https://github.com/glfw/glfw.git + mkdir -p glfw/build && cd glfw/build + cmake .. && make && sudo make install +# - name: setup additional dependencies for examples (x86_64) +# if: matrix.arch == 'x86_64' +# run: | +# sudo apt-get update && sudo apt-get install -y libglfw3 libglfw3-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev +# - name: setup additional dependencies for examples (aarch64) +# if: matrix.arch == 'aarch64' +# run: | +# sudo dpkg --add-architecture arm64 +# sudo apt-get update && sudo apt-get install -y libglfw3:arm64 libglfw3-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 +# echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV - name: run tests env: From ab9997830cf12159cac52f95fe3702c518b305c0 Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 04:05:48 +0900 Subject: [PATCH 12/33] try conditional cmake(\:arm64)? --- .github/workflows/CI.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1dfd32f..3c261fc 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -86,16 +86,17 @@ jobs: - name: setup additional dependencies for examples run: | + git clone https://github.com/glfw/glfw.git + mkdir -p glfw/build && cd glfw/build if [ "${{ matrix.arch }}" = 'x86_64' ]; then sudo apt update && sudo apt install -y cmake build-essential libwayland-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev + cmake .. && make && sudo make install elif [ "${{ matrix.arch }}" = 'aarch64' ]; then sudo dpkg --add-architecture arm64 echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV sudo apt update && sudo apt install -y cmake:arm64 build-essential:arm64 libwayland-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 + cmake:arm64 .. && make && sudo make install fi - git clone https://github.com/glfw/glfw.git - mkdir -p glfw/build && cd glfw/build - cmake .. && make && sudo make install # - name: setup additional dependencies for examples (x86_64) # if: matrix.arch == 'x86_64' # run: | From a14e692ed5ae21fbe66b61de2b840902276b0ff5 Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 04:14:12 +0900 Subject: [PATCH 13/33] use `-DCMAKE_C(XX)?_COMPILER=aarch64-linux-gnu-g(cc|++)` --- .github/workflows/CI.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3c261fc..ca095be 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -90,12 +90,14 @@ jobs: mkdir -p glfw/build && cd glfw/build if [ "${{ matrix.arch }}" = 'x86_64' ]; then sudo apt update && sudo apt install -y cmake build-essential libwayland-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev - cmake .. && make && sudo make install + cmake .. + make && sudo make install elif [ "${{ matrix.arch }}" = 'aarch64' ]; then sudo dpkg --add-architecture arm64 echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV sudo apt update && sudo apt install -y cmake:arm64 build-essential:arm64 libwayland-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 - cmake:arm64 .. && make && sudo make install + cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ + make && sudo make install fi # - name: setup additional dependencies for examples (x86_64) # if: matrix.arch == 'x86_64' From 2594fe0baec24a1199d9ebc070a0566b1985dc27 Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 04:21:27 +0900 Subject: [PATCH 14/33] try wayland-protocols --- .github/workflows/CI.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ca095be..3e213c7 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -89,13 +89,16 @@ jobs: git clone https://github.com/glfw/glfw.git mkdir -p glfw/build && cd glfw/build if [ "${{ matrix.arch }}" = 'x86_64' ]; then - sudo apt update && sudo apt install -y cmake build-essential libwayland-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev + sudo apt update + sudo apt install -y cmake build-essential libwayland-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev cmake .. make && sudo make install elif [ "${{ matrix.arch }}" = 'aarch64' ]; then sudo dpkg --add-architecture arm64 echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV - sudo apt update && sudo apt install -y cmake:arm64 build-essential:arm64 libwayland-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 + sudo apt update + sudo apt install -y cmake:arm64 build-essential:arm64 libwayland-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 + sudo apt install -y wayland-protocols cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ make && sudo make install fi From 518ec88acbcfacc3cb4d6021451a62ffa269ce40 Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 04:28:59 +0900 Subject: [PATCH 15/33] set -x --- .github/workflows/CI.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3e213c7..ea7ec11 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -94,6 +94,7 @@ jobs: cmake .. make && sudo make install elif [ "${{ matrix.arch }}" = 'aarch64' ]; then + set -x sudo dpkg --add-architecture arm64 echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV sudo apt update @@ -101,6 +102,7 @@ jobs: sudo apt install -y wayland-protocols cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ make && sudo make install + set +x fi # - name: setup additional dependencies for examples (x86_64) # if: matrix.arch == 'x86_64' From 8256b1504ef5753e49250aa53b5c08c07ff322bc Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 04:39:19 +0900 Subject: [PATCH 16/33] try restricting security repository to amd64 --- .github/workflows/CI.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ea7ec11..947b5c0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -94,15 +94,14 @@ jobs: cmake .. make && sudo make install elif [ "${{ matrix.arch }}" = 'aarch64' ]; then - set -x - sudo dpkg --add-architecture arm64 echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV + sudo dpkg --add-architecture arm64 + sudo sed -i -e 's/deb http:\/\/security.ubuntu.com/deb [arch=amd64] http:\/\/security.ubuntu.com/g' /etc/apt/sources.list ### restrict security repository to amd64, as it doesn't support arm64 ### sudo apt update sudo apt install -y cmake:arm64 build-essential:arm64 libwayland-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 sudo apt install -y wayland-protocols cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ make && sudo make install - set +x fi # - name: setup additional dependencies for examples (x86_64) # if: matrix.arch == 'x86_64' From cac5bf6d00811a2d410d6ae79288c69784143cef Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 04:43:31 +0900 Subject: [PATCH 17/33] ignore apt update error --- .github/workflows/CI.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 947b5c0..73f9fa8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -96,8 +96,7 @@ jobs: elif [ "${{ matrix.arch }}" = 'aarch64' ]; then echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV sudo dpkg --add-architecture arm64 - sudo sed -i -e 's/deb http:\/\/security.ubuntu.com/deb [arch=amd64] http:\/\/security.ubuntu.com/g' /etc/apt/sources.list ### restrict security repository to amd64, as it doesn't support arm64 ### - sudo apt update + sudo apt update || : ### fails to fetch security repositories that don't support arm64, but it doesn't matter ### sudo apt install -y cmake:arm64 build-essential:arm64 libwayland-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 sudo apt install -y wayland-protocols cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ From 93ffca5d3618bc0a203c9a171a3aff062380ce0b Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 04:58:18 +0900 Subject: [PATCH 18/33] add ports to /etc/apt/sources.list.d/ports.list --- .github/workflows/CI.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 73f9fa8..eb99969 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -96,6 +96,10 @@ jobs: elif [ "${{ matrix.arch }}" = 'aarch64' ]; then echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV sudo dpkg --add-architecture arm64 + echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/ports.list + echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports.list + echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-security main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports.list + echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports.list sudo apt update || : ### fails to fetch security repositories that don't support arm64, but it doesn't matter ### sudo apt install -y cmake:arm64 build-essential:arm64 libwayland-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 sudo apt install -y wayland-protocols From 3ee3f326fdbdcf14106d6b8da823aab1f3efd8de Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 05:03:02 +0900 Subject: [PATCH 19/33] `:arm64` only for `*-dev` --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index eb99969..300c972 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -101,7 +101,7 @@ jobs: echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-security main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports.list echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports.list sudo apt update || : ### fails to fetch security repositories that don't support arm64, but it doesn't matter ### - sudo apt install -y cmake:arm64 build-essential:arm64 libwayland-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 + sudo apt install -y cmake build-essential libwayland-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 sudo apt install -y wayland-protocols cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ make && sudo make install From db319f0587573c3f8f01599340af25b6b937f31d Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 05:10:28 +0900 Subject: [PATCH 20/33] run `echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV` in `setup` step --- .github/workflows/CI.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 300c972..855516b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -75,7 +75,10 @@ jobs: rustup default ${{ matrix.toolchain }} rustup target add ${{ matrix.arch }}-unknown-linux-gnu rustup component add rustfmt ### required for the build script to work ### - [ "${{ matrix.arch }}" = 'aarch64' ] && sudo apt update && sudo apt install -y g++-aarch64-linux-gnu || : + if [ "${{ matrix.arch }}" = 'aarch64' ]; then + sudo apt update && sudo apt install -y g++-aarch64-linux-gnu + echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV + fi mkdir -p $HOME/.mujoco cd $HOME/.mujoco @@ -94,13 +97,12 @@ jobs: cmake .. make && sudo make install elif [ "${{ matrix.arch }}" = 'aarch64' ]; then - echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV sudo dpkg --add-architecture arm64 echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/ports.list echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports.list echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-security main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports.list echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports.list - sudo apt update || : ### fails to fetch security repositories that don't support arm64, but it doesn't matter ### + sudo apt update || : ### fails to some fetch security repositories that don't support arm64, but it doesn't matter ### sudo apt install -y cmake build-essential libwayland-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 sudo apt install -y wayland-protocols cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ From 5e79b8206c6886c2f241de60ca6da7ee4e9cb61a Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 05:18:17 +0900 Subject: [PATCH 21/33] add `-DCMAKE_EXE_LINKER_FLAGS=-lm` to cmake flags --- .github/workflows/CI.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 855516b..16b7c0b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -75,10 +75,6 @@ jobs: rustup default ${{ matrix.toolchain }} rustup target add ${{ matrix.arch }}-unknown-linux-gnu rustup component add rustfmt ### required for the build script to work ### - if [ "${{ matrix.arch }}" = 'aarch64' ]; then - sudo apt update && sudo apt install -y g++-aarch64-linux-gnu - echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV - fi mkdir -p $HOME/.mujoco cd $HOME/.mujoco @@ -86,6 +82,11 @@ jobs: tar -xzf mujoco-3.3.2-linux-${{ matrix.arch }}.tar.gz echo "MUJOCO_DIR=$HOME/.mujoco/mujoco-3.3.2" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=$HOME/.mujoco/mujoco-3.3.2/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV + + if [ "${{ matrix.arch }}" = 'aarch64' ]; then + sudo apt update && sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu + echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV + fi - name: setup additional dependencies for examples run: | @@ -105,7 +106,7 @@ jobs: sudo apt update || : ### fails to some fetch security repositories that don't support arm64, but it doesn't matter ### sudo apt install -y cmake build-essential libwayland-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 sudo apt install -y wayland-protocols - cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ + cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_EXE_LINKER_FLAGS=-lm make && sudo make install fi # - name: setup additional dependencies for examples (x86_64) From 7cdd26a33e025528cc62812856f3bd9adf14ec1a Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 05:30:54 +0900 Subject: [PATCH 22/33] use `-DLINK_FLAGS="-lm"` --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 16b7c0b..ed2d89d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -106,7 +106,7 @@ jobs: sudo apt update || : ### fails to some fetch security repositories that don't support arm64, but it doesn't matter ### sudo apt install -y cmake build-essential libwayland-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 sudo apt install -y wayland-protocols - cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_EXE_LINKER_FLAGS=-lm + cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DLINK_FLAGS="-lm" make && sudo make install fi # - name: setup additional dependencies for examples (x86_64) From 0362e3ff8b431839d23ca3710c5d990d391c788c Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 05:40:00 +0900 Subject: [PATCH 23/33] `="-lm"` instead of `=-lm` for `-DCMAKE_EXE_LINKER_FLAGS` --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ed2d89d..23d1101 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -106,7 +106,7 @@ jobs: sudo apt update || : ### fails to some fetch security repositories that don't support arm64, but it doesn't matter ### sudo apt install -y cmake build-essential libwayland-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 sudo apt install -y wayland-protocols - cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DLINK_FLAGS="-lm" + cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_EXE_LINKER_FLAGS="-lm" make && sudo make install fi # - name: setup additional dependencies for examples (x86_64) From 2758fafe9ec4ad8792c1a9b542f08d9fb2b61c75 Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 05:43:58 +0900 Subject: [PATCH 24/33] specify ` -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF` for cmake --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 23d1101..e91500f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -95,7 +95,7 @@ jobs: if [ "${{ matrix.arch }}" = 'x86_64' ]; then sudo apt update sudo apt install -y cmake build-essential libwayland-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev - cmake .. + cmake .. -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF make && sudo make install elif [ "${{ matrix.arch }}" = 'aarch64' ]; then sudo dpkg --add-architecture arm64 @@ -106,7 +106,7 @@ jobs: sudo apt update || : ### fails to some fetch security repositories that don't support arm64, but it doesn't matter ### sudo apt install -y cmake build-essential libwayland-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 sudo apt install -y wayland-protocols - cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_EXE_LINKER_FLAGS="-lm" + cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF make && sudo make install fi # - name: setup additional dependencies for examples (x86_64) From 587d840c9f9f6f865778b4e6b903387e1c83511a Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 05:56:00 +0900 Subject: [PATCH 25/33] retain original $PKG_CONFIG_PATH --- .github/workflows/CI.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e91500f..1abbb51 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -85,7 +85,7 @@ jobs: if [ "${{ matrix.arch }}" = 'aarch64' ]; then sudo apt update && sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV + echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV fi - name: setup additional dependencies for examples @@ -103,22 +103,12 @@ jobs: echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports.list echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-security main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports.list echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports.list - sudo apt update || : ### fails to some fetch security repositories that don't support arm64, but it doesn't matter ### + sudo apt update || : ### fails to fetch some security repositories that don't support arm64, but it doesn't matter ### sudo apt install -y cmake build-essential libwayland-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 sudo apt install -y wayland-protocols cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF make && sudo make install fi -# - name: setup additional dependencies for examples (x86_64) -# if: matrix.arch == 'x86_64' -# run: | -# sudo apt-get update && sudo apt-get install -y libglfw3 libglfw3-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev -# - name: setup additional dependencies for examples (aarch64) -# if: matrix.arch == 'aarch64' -# run: | -# sudo dpkg --add-architecture arm64 -# sudo apt-get update && sudo apt-get install -y libglfw3:arm64 libglfw3-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 -# echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV - name: run tests env: From d8e6ce0e68724795fb7f0961697dd5f299d2efe7 Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 06:03:56 +0900 Subject: [PATCH 26/33] improve PKG_CONFIG_PATH --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1abbb51..6460dfd 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -85,7 +85,7 @@ jobs: if [ "${{ matrix.arch }}" = 'aarch64' ]; then sudo apt update && sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV + echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig:/usr/local/lib/aarch64-linux-gnu/pkgconfig:/usr/local/share/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV fi - name: setup additional dependencies for examples From 81affe05dca11adb76bc8d4dbc2997b64184f50c Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 06:09:32 +0900 Subject: [PATCH 27/33] set PKG_CONFIG=aarch64-linux-gnu-pkg-config --- .github/workflows/CI.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6460dfd..994c175 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -85,6 +85,7 @@ jobs: if [ "${{ matrix.arch }}" = 'aarch64' ]; then sudo apt update && sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu + echo "PKG_CONFIG=aarch64-linux-gnu-pkg-config" >> $GITHUB_ENV echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig:/usr/local/lib/aarch64-linux-gnu/pkgconfig:/usr/local/share/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV fi From b273815ccdd4473349551770dba04bc8f7d0e54e Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 06:15:07 +0900 Subject: [PATCH 28/33] apt install pkg-config when aarch64 --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 994c175..ddd380e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -84,7 +84,7 @@ jobs: echo "LD_LIBRARY_PATH=$HOME/.mujoco/mujoco-3.3.2/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV if [ "${{ matrix.arch }}" = 'aarch64' ]; then - sudo apt update && sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu + sudo apt update && sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu pkg-config echo "PKG_CONFIG=aarch64-linux-gnu-pkg-config" >> $GITHUB_ENV echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig:/usr/local/lib/aarch64-linux-gnu/pkgconfig:/usr/local/share/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV fi From cf5b2d299c8c2b6991fbfac683f26587503ef90c Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 06:30:00 +0900 Subject: [PATCH 29/33] split runner --- .github/workflows/CI.yml | 158 ++++++++++++++++++++++++++++++--------- 1 file changed, 122 insertions(+), 36 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ddd380e..4ff9dc8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -57,25 +57,23 @@ jobs: echo "[DEBUG] bindgen.rs content:" && cat ./src/bindgen.rs exit 1 fi - - test: - runs-on: ubuntu-latest - - strategy: - matrix: - toolchain: ['stable', 'nightly'] - arch: ['x86_64', 'aarch64'] + test-x86_64: + if: matrix.arch == 'x86_64' + + runs-on: ubuntu-24.04 + steps: - uses: actions/checkout@v5 - - - name: setup + + - name: setup Rust run: | rustup update rustup default ${{ matrix.toolchain }} - rustup target add ${{ matrix.arch }}-unknown-linux-gnu rustup component add rustfmt ### required for the build script to work ### + - name: setup MuJoCo + run: | mkdir -p $HOME/.mujoco cd $HOME/.mujoco wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-${{ matrix.arch }}.tar.gz @@ -83,40 +81,128 @@ jobs: echo "MUJOCO_DIR=$HOME/.mujoco/mujoco-3.3.2" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=$HOME/.mujoco/mujoco-3.3.2/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV - if [ "${{ matrix.arch }}" = 'aarch64' ]; then - sudo apt update && sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu pkg-config - echo "PKG_CONFIG=aarch64-linux-gnu-pkg-config" >> $GITHUB_ENV - echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig:/usr/local/lib/aarch64-linux-gnu/pkgconfig:/usr/local/share/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV - fi - - name: setup additional dependencies for examples run: | git clone https://github.com/glfw/glfw.git mkdir -p glfw/build && cd glfw/build - if [ "${{ matrix.arch }}" = 'x86_64' ]; then - sudo apt update - sudo apt install -y cmake build-essential libwayland-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev - cmake .. -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF - make && sudo make install - elif [ "${{ matrix.arch }}" = 'aarch64' ]; then - sudo dpkg --add-architecture arm64 - echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/ports.list - echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports.list - echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-security main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports.list - echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports.list - sudo apt update || : ### fails to fetch some security repositories that don't support arm64, but it doesn't matter ### - sudo apt install -y cmake build-essential libwayland-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 - sudo apt install -y wayland-protocols - cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF - make && sudo make install - fi + sudo apt update && sudo apt install -y cmake build-essential libwayland-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev + cmake .. && make && sudo make install + + - name: run tests + run: | + cargo test --lib + cargo test --doc + cargo test --tests + cargo test --benches + cargo test --examples + + test-aarch64: + if: matrix.arch == 'aarch64' + + runs-on: ubuntu-24.04-arm + + steps: + - uses: actions/checkout@v5 + + - name: setup Rust + run: | + rustup update + rustup default ${{ matrix.toolchain }} + rustup component add rustfmt ### required for the build script to work ### + - name: setup MuJoCo + run: | + mkdir -p $HOME/.mujoco + cd $HOME/.mujoco + wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-${{ matrix.arch }}.tar.gz + tar -xzf mujoco-3.3.2-linux-${{ matrix.arch }}.tar.gz + echo "MUJOCO_DIR=$HOME/.mujoco/mujoco-3.3.2" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=$HOME/.mujoco/mujoco-3.3.2/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV + + - name: setup additional dependencies for examples + run: | + git clone https://github.com/glfw/glfw.git + mkdir -p glfw/build && cd glfw/build + sudo apt update && sudo apt install -y cmake build-essential libwayland-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev + cmake .. && make && sudo make install + - name: run tests - env: - CARGO_BUILD_TARGET: ${{ matrix.arch }}-unknown-linux-gnu run: | cargo test --lib cargo test --doc cargo test --tests cargo test --benches cargo test --examples + + + + + + + + + + +# test: +# runs-on: ubuntu-latest +# +# strategy: +# matrix: +# toolchain: ['stable', 'nightly'] +# arch: ['x86_64', 'aarch64'] +# +# steps: +# - uses: actions/checkout@v5 +# +# - name: setup +# run: | +# rustup update +# rustup default ${{ matrix.toolchain }} +# rustup target add ${{ matrix.arch }}-unknown-linux-gnu +# rustup component add rustfmt ### required for the build script to work ### +# +# mkdir -p $HOME/.mujoco +# cd $HOME/.mujoco +# wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-${{ matrix.arch }}.tar.gz +# tar -xzf mujoco-3.3.2-linux-${{ matrix.arch }}.tar.gz +# echo "MUJOCO_DIR=$HOME/.mujoco/mujoco-3.3.2" >> $GITHUB_ENV +# echo "LD_LIBRARY_PATH=$HOME/.mujoco/mujoco-3.3.2/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV +# +# if [ "${{ matrix.arch }}" = 'aarch64' ]; then +# sudo apt update && sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu pkg-config +# echo "PKG_CONFIG=aarch64-linux-gnu-pkg-config" >> $GITHUB_ENV +# echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig:/usr/local/lib/aarch64-linux-gnu/pkgconfig:/usr/local/share/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV +# fi +# +# - name: setup additional dependencies for examples +# run: | +# git clone https://github.com/glfw/glfw.git +# mkdir -p glfw/build && cd glfw/build +# if [ "${{ matrix.arch }}" = 'x86_64' ]; then +# sudo apt update +# sudo apt install -y cmake build-essential libwayland-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev +# cmake .. -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF +# make && sudo make install +# elif [ "${{ matrix.arch }}" = 'aarch64' ]; then +# sudo dpkg --add-architecture arm64 +# echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/ports.list +# echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports.list +# echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-security main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports.list +# echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports.list +# sudo apt update || : ### fails to fetch some security repositories that don't support arm64, but it doesn't matter ### +# sudo apt install -y cmake build-essential libwayland-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 +# sudo apt install -y wayland-protocols +# cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF +# make && sudo make install +# fi +# +# - name: run tests +# env: +# CARGO_BUILD_TARGET: ${{ matrix.arch }}-unknown-linux-gnu +# run: | +# cargo test --lib +# cargo test --doc +# cargo test --tests +# cargo test --benches +# cargo test --examples +# \ No newline at end of file From 0236efc7d23dc3a1df9a2fa93ba172c0f4505948 Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 06:48:52 +0900 Subject: [PATCH 30/33] use needs's output for job-level if-condition --- .github/workflows/CI.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 4ff9dc8..eb27379 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -57,11 +57,19 @@ jobs: echo "[DEBUG] bindgen.rs content:" && cat ./src/bindgen.rs exit 1 fi + + tester: + runs-on: ubuntu-latest + outputs: + arch: ${{ steps.determine_arch.outputs.arch }} + steps: + - id: determine_arch + run: echo "${{ matrix.arch }}" >> $GITHUB_OUTPUT test-x86_64: - if: matrix.arch == 'x86_64' - runs-on: ubuntu-24.04 + needs: tester + if: needs.tester.outputs.arch == 'x86_64' steps: - uses: actions/checkout@v5 @@ -97,9 +105,9 @@ jobs: cargo test --examples test-aarch64: - if: matrix.arch == 'aarch64' - runs-on: ubuntu-24.04-arm + needs: tester + if: needs.tester.outputs.arch == 'aarch64' steps: - uses: actions/checkout@v5 From 34ce3db4cd1456e393e0aff601c7371a88423aa8 Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 06:57:11 +0900 Subject: [PATCH 31/33] fix around strategy --- .github/workflows/CI.yml | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index eb27379..abaac0d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -58,18 +58,12 @@ jobs: exit 1 fi - tester: - runs-on: ubuntu-latest - outputs: - arch: ${{ steps.determine_arch.outputs.arch }} - steps: - - id: determine_arch - run: echo "${{ matrix.arch }}" >> $GITHUB_OUTPUT - - test-x86_64: + test-linux-x86_64: runs-on: ubuntu-24.04 - needs: tester - if: needs.tester.outputs.arch == 'x86_64' + + strategy: + matrix: + toolchain: ['stable', 'nightly'] steps: - uses: actions/checkout@v5 @@ -82,10 +76,9 @@ jobs: - name: setup MuJoCo run: | - mkdir -p $HOME/.mujoco - cd $HOME/.mujoco - wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-${{ matrix.arch }}.tar.gz - tar -xzf mujoco-3.3.2-linux-${{ matrix.arch }}.tar.gz + mkdir -p $HOME/.mujoco && cd $HOME/.mujoco + wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-x86_64.tar.gz + tar -xzf mujoco-3.3.2-linux-x86_64.tar.gz echo "MUJOCO_DIR=$HOME/.mujoco/mujoco-3.3.2" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=$HOME/.mujoco/mujoco-3.3.2/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV @@ -104,10 +97,12 @@ jobs: cargo test --benches cargo test --examples - test-aarch64: + test-linux-aarch64: runs-on: ubuntu-24.04-arm - needs: tester - if: needs.tester.outputs.arch == 'aarch64' + + strategy: + matrix: + toolchain: ['stable', 'nightly'] steps: - uses: actions/checkout@v5 @@ -120,10 +115,9 @@ jobs: - name: setup MuJoCo run: | - mkdir -p $HOME/.mujoco - cd $HOME/.mujoco - wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-${{ matrix.arch }}.tar.gz - tar -xzf mujoco-3.3.2-linux-${{ matrix.arch }}.tar.gz + mkdir -p $HOME/.mujoco && cd $HOME/.mujoco + wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-aarch64.tar.gz + tar -xzf mujoco-3.3.2-linux-aarch64.tar.gz echo "MUJOCO_DIR=$HOME/.mujoco/mujoco-3.3.2" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=$HOME/.mujoco/mujoco-3.3.2/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV From 71dbb0e298686218a0dc91ce7da8177fd9fd74af Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 07:08:13 +0900 Subject: [PATCH 32/33] unify tests --- .github/workflows/CI.yml | 56 +++++++++------------------------------- 1 file changed, 12 insertions(+), 44 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index abaac0d..1b8bee6 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -57,52 +57,14 @@ jobs: echo "[DEBUG] bindgen.rs content:" && cat ./src/bindgen.rs exit 1 fi - - test-linux-x86_64: - runs-on: ubuntu-24.04 - - strategy: - matrix: - toolchain: ['stable', 'nightly'] - - steps: - - uses: actions/checkout@v5 - - - name: setup Rust - run: | - rustup update - rustup default ${{ matrix.toolchain }} - rustup component add rustfmt ### required for the build script to work ### - - - name: setup MuJoCo - run: | - mkdir -p $HOME/.mujoco && cd $HOME/.mujoco - wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-x86_64.tar.gz - tar -xzf mujoco-3.3.2-linux-x86_64.tar.gz - echo "MUJOCO_DIR=$HOME/.mujoco/mujoco-3.3.2" >> $GITHUB_ENV - echo "LD_LIBRARY_PATH=$HOME/.mujoco/mujoco-3.3.2/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV - - - name: setup additional dependencies for examples - run: | - git clone https://github.com/glfw/glfw.git - mkdir -p glfw/build && cd glfw/build - sudo apt update && sudo apt install -y cmake build-essential libwayland-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev - cmake .. && make && sudo make install - - name: run tests - run: | - cargo test --lib - cargo test --doc - cargo test --tests - cargo test --benches - cargo test --examples - - test-linux-aarch64: - runs-on: ubuntu-24.04-arm - + test: strategy: matrix: toolchain: ['stable', 'nightly'] + os: ['ubuntu-24.04', 'ubuntu-24.04-arm'] + + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v5 @@ -115,9 +77,15 @@ jobs: - name: setup MuJoCo run: | + MUJOCO_FILENAME='mujoco-3.3.2' + if [ "${{ matrix.os }}" = 'ubuntu-24.04' ]; then + MUJOCO_FILENAME+='-linux-x86_64.tar.gz' + elif [ "${{ matrix.os }}" = 'ubuntu-24.04-arm' ]; then + MUJOCO_FILENAME+='-linux-aarch64.tar.gz' + fi mkdir -p $HOME/.mujoco && cd $HOME/.mujoco - wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-aarch64.tar.gz - tar -xzf mujoco-3.3.2-linux-aarch64.tar.gz + wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/$MUJOCO_FILENAME + tar -xzf $MUJOCO_FILENAME echo "MUJOCO_DIR=$HOME/.mujoco/mujoco-3.3.2" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=$HOME/.mujoco/mujoco-3.3.2/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV From 8a78b9e478844ad2c6c13b910adad9fa47eceed3 Mon Sep 17 00:00:00 2001 From: kanarus Date: Tue, 16 Sep 2025 07:14:01 +0900 Subject: [PATCH 33/33] remove unused comments & refine conditional filename --- .github/workflows/CI.yml | 78 ++-------------------------------------- 1 file changed, 2 insertions(+), 76 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1b8bee6..d007141 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -77,11 +77,10 @@ jobs: - name: setup MuJoCo run: | - MUJOCO_FILENAME='mujoco-3.3.2' if [ "${{ matrix.os }}" = 'ubuntu-24.04' ]; then - MUJOCO_FILENAME+='-linux-x86_64.tar.gz' + MUJOCO_FILENAME='mujoco-3.3.2-linux-x86_64.tar.gz' elif [ "${{ matrix.os }}" = 'ubuntu-24.04-arm' ]; then - MUJOCO_FILENAME+='-linux-aarch64.tar.gz' + MUJOCO_FILENAME='mujoco-3.3.2-linux-aarch64.tar.gz' fi mkdir -p $HOME/.mujoco && cd $HOME/.mujoco wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/$MUJOCO_FILENAME @@ -103,76 +102,3 @@ jobs: cargo test --tests cargo test --benches cargo test --examples - - - - - - - - - - -# test: -# runs-on: ubuntu-latest -# -# strategy: -# matrix: -# toolchain: ['stable', 'nightly'] -# arch: ['x86_64', 'aarch64'] -# -# steps: -# - uses: actions/checkout@v5 -# -# - name: setup -# run: | -# rustup update -# rustup default ${{ matrix.toolchain }} -# rustup target add ${{ matrix.arch }}-unknown-linux-gnu -# rustup component add rustfmt ### required for the build script to work ### -# -# mkdir -p $HOME/.mujoco -# cd $HOME/.mujoco -# wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-${{ matrix.arch }}.tar.gz -# tar -xzf mujoco-3.3.2-linux-${{ matrix.arch }}.tar.gz -# echo "MUJOCO_DIR=$HOME/.mujoco/mujoco-3.3.2" >> $GITHUB_ENV -# echo "LD_LIBRARY_PATH=$HOME/.mujoco/mujoco-3.3.2/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV -# -# if [ "${{ matrix.arch }}" = 'aarch64' ]; then -# sudo apt update && sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu pkg-config -# echo "PKG_CONFIG=aarch64-linux-gnu-pkg-config" >> $GITHUB_ENV -# echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig:/usr/local/lib/aarch64-linux-gnu/pkgconfig:/usr/local/share/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV -# fi -# -# - name: setup additional dependencies for examples -# run: | -# git clone https://github.com/glfw/glfw.git -# mkdir -p glfw/build && cd glfw/build -# if [ "${{ matrix.arch }}" = 'x86_64' ]; then -# sudo apt update -# sudo apt install -y cmake build-essential libwayland-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev -# cmake .. -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF -# make && sudo make install -# elif [ "${{ matrix.arch }}" = 'aarch64' ]; then -# sudo dpkg --add-architecture arm64 -# echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/ports.list -# echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports.list -# echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-security main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports.list -# echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports.list -# sudo apt update || : ### fails to fetch some security repositories that don't support arm64, but it doesn't matter ### -# sudo apt install -y cmake build-essential libwayland-dev:arm64 libxkbcommon-x11-dev:arm64 libgl1-mesa-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libxinerama-dev:arm64 libxrandr-dev:arm64 -# sudo apt install -y wayland-protocols -# cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF -# make && sudo make install -# fi -# -# - name: run tests -# env: -# CARGO_BUILD_TARGET: ${{ matrix.arch }}-unknown-linux-gnu -# run: | -# cargo test --lib -# cargo test --doc -# cargo test --tests -# cargo test --benches -# cargo test --examples -# \ No newline at end of file