From d393a09a58dfcfe9826b137e022a497464d78808 Mon Sep 17 00:00:00 2001 From: "Echo J." Date: Thu, 26 Mar 2026 15:12:41 +0200 Subject: [PATCH 01/10] CI: Remove redundant ccache options --- .github/workflows/build-linux.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index ece858d39..1850b0ff1 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -32,9 +32,6 @@ jobs: sudo apt-get update sudo apt-get install -y build-essential ccache python3 python3-pip ninja-build libsdl2-dev libgl-dev libglu1-mesa-dev libpthread-stubs0-dev libglm-dev python -m pip install meson - # Set a reasonable ccache size - ccache -M 5G || true - python -m pip install meson - name: Restore ccache uses: actions/cache@v4 @@ -52,10 +49,7 @@ jobs: env: CC: "ccache clang" CXX: "ccache clang++" - CCACHE_DIR: ${{ runner.temp }}/ccache run: | - mkdir -p "$CCACHE_DIR" - export CCACHE_DIR="$CCACHE_DIR" meson setup build --wipe --native-file=./scripts/llvm_native.txt - name: Build with Meson @@ -64,7 +58,6 @@ jobs: CXX: "ccache clang++" CCACHE_DIR: ${{ runner.temp }}/ccache run: | - export CCACHE_DIR="${{ runner.temp }}/ccache" # Use all available cores for faster parallel builds meson compile -C build -j $(nproc) -v Minecraft.Client @@ -76,4 +69,4 @@ jobs: with: name: minecraft-client-linux-${{ github.sha }} path: build/Minecraft.Client/Minecraft.Client - retention-days: 7 \ No newline at end of file + retention-days: 7 From b6699f02690b5cde2358552c5e07cc81e6a964f3 Mon Sep 17 00:00:00 2001 From: "Echo J." Date: Thu, 26 Mar 2026 15:27:48 +0200 Subject: [PATCH 02/10] CI: Use direct compiler variables instead of a native file This interferes with our ccache setup --- .github/workflows/build-linux.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 1850b0ff1..36c2deb84 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -49,13 +49,13 @@ jobs: env: CC: "ccache clang" CXX: "ccache clang++" + CC_LD: lld + CXX_LD: lld run: | - meson setup build --wipe --native-file=./scripts/llvm_native.txt + meson setup build --wipe - name: Build with Meson env: - CC: "ccache clang" - CXX: "ccache clang++" CCACHE_DIR: ${{ runner.temp }}/ccache run: | # Use all available cores for faster parallel builds From a045d26f052866fb26c3f934eadc816dbdeac192 Mon Sep 17 00:00:00 2001 From: "Echo J." Date: Mon, 30 Mar 2026 08:02:04 +0000 Subject: [PATCH 03/10] CI: Fix the ccache path (and re-add cache key fallback) --- .github/workflows/build-linux.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 36c2deb84..d5d0369cb 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -36,8 +36,9 @@ jobs: - name: Restore ccache uses: actions/cache@v4 with: - path: ~/.ccache + path: ${{ runner.temp }}/ccache key: ${{ runner.os }}-ccache-${{ hashFiles('**/meson.build') }} + restore-keys: ${{ runner.os }}-ccache- - name: Restore meson cache uses: actions/cache@v4 From 4f9250466844846df633ce421099d2d9e6e193d7 Mon Sep 17 00:00:00 2001 From: "Echo J." Date: Mon, 30 Mar 2026 08:03:21 +0000 Subject: [PATCH 04/10] CI: Remove useless Meson cache/patchelf installation --- .github/workflows/build-linux.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index d5d0369cb..e6f20ee67 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -40,12 +40,6 @@ jobs: key: ${{ runner.os }}-ccache-${{ hashFiles('**/meson.build') }} restore-keys: ${{ runner.os }}-ccache- - - name: Restore meson cache - uses: actions/cache@v4 - with: - path: ~/.cache/meson - key: ${{ runner.os }}-meson-${{ hashFiles('**/meson.build') }} - - name: Configure Meson env: CC: "ccache clang" @@ -62,9 +56,6 @@ jobs: # Use all available cores for faster parallel builds meson compile -C build -j $(nproc) -v Minecraft.Client - - name: Install patchelf - run: sudo apt-get install -y patchelf - - name: Upload artifact uses: actions/upload-artifact@v4 with: From a03bdcaedf775976987cc69b8ee4c4990b8dc091 Mon Sep 17 00:00:00 2001 From: "Echo J." Date: Mon, 30 Mar 2026 08:05:18 +0000 Subject: [PATCH 05/10] CI: Update cache action version --- .github/workflows/build-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index e6f20ee67..1cc6c6307 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -34,7 +34,7 @@ jobs: python -m pip install meson - name: Restore ccache - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: ${{ runner.temp }}/ccache key: ${{ runner.os }}-ccache-${{ hashFiles('**/meson.build') }} From b9b033c0a04df4e134ac15a44dc49aa6127ade77 Mon Sep 17 00:00:00 2001 From: "Echo J." Date: Mon, 30 Mar 2026 08:39:15 +0000 Subject: [PATCH 06/10] CI: Allow manual triggering for all workflows --- .github/workflows/build-doxygen.yml | 2 ++ .github/workflows/build-linux.yml | 2 ++ .github/workflows/clang-format.yml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/.github/workflows/build-doxygen.yml b/.github/workflows/build-doxygen.yml index 51fbce205..fd18e81bc 100644 --- a/.github/workflows/build-doxygen.yml +++ b/.github/workflows/build-doxygen.yml @@ -9,6 +9,8 @@ on: - "Minecraft.World/**" - "docs/**" + workflow_dispatch: + jobs: build: permissions: diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 1cc6c6307..030b10ca1 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -19,6 +19,8 @@ on: pull_request: paths: *workflow_paths + workflow_dispatch: + jobs: build-linux: runs-on: ubuntu-latest diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 84820ad88..b9e7f8c0b 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -19,6 +19,8 @@ on: pull_request: paths: *workflow_paths + workflow_dispatch: + jobs: clang-format: runs-on: ubuntu-latest From ddfdbcd1bcbbfd4150e00a46682dbc4c46ec9168 Mon Sep 17 00:00:00 2001 From: JuiceyDev Date: Mon, 30 Mar 2026 18:02:02 +0200 Subject: [PATCH 07/10] Update README progress numbers. (#370) * Updated Readme numberz * README: fix asset paths --------- Co-authored-by: ffqq <36998498+realffqq@users.noreply.github.com> --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 73f7bd60d..cff673db3 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,11 @@ At the moment, we're aiming to support the following platforms: Please note that these percentages are **estimates** and do not necessarily reflect the final playability of the game on each platform. -- Linux (~85%) +- Linux (~90%) - Emscripten (~10%) [[Check the Emscripten Branch](https://github.com/4jcraft/4jcraft/tree/feat/emscripten)] - macOS (not started) [No official support but people have been able to run the game on MacOS] - iOS (not started) -- Android (~5%) +- Android (~35%) > [!WARNING] > There is NO Windows support, for that, go to [smartcmd/MinecraftConsoles](https://github.com/smartcmd/MinecraftConsoles/). From d11a24c720b2ca811a40c6196932fa22b13e9545 Mon Sep 17 00:00:00 2001 From: Hadi Chokr Date: Tue, 31 Mar 2026 18:39:23 +0200 Subject: [PATCH 08/10] Refactor subprojects in nix flake to be attributes. Also wrote and by wrote I mean stole from other projects helper functions for bypassing the nodownload restriction of the nix sandbox. This uses the wrap files in the repo ecxept for the download part which has to be an input for reproducibility sake. The Nix Code is ugly and I am gonna vomit. --- flake.nix | 83 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 53 insertions(+), 30 deletions(-) diff --git a/flake.nix b/flake.nix index 05ceb4fef..80e07de1d 100644 --- a/flake.nix +++ b/flake.nix @@ -20,6 +20,7 @@ flake = false; }; + # patches only get applied if they follow -patch naming miniaudio-patch = { url = "https://wrapdb.mesonbuild.com/v2/miniaudio_0.11.22-2/get_patch"; flake = false; @@ -37,16 +38,51 @@ }; outputs = - { - self, - nixpkgs, - flake-utils, - ... - }@inputs: + { self, nixpkgs, flake-utils, ... }@inputs: flake-utils.lib.eachDefaultSystem ( system: let pkgs = import nixpkgs { inherit system; }; + lib = pkgs.lib; + + subprojectNames = [ + "shiggy" + "4jlibs" + "stb" + "simdutf" + "miniaudio" + ]; + + # helper: copy all subproject sources + copySubprojects = '' + mkdir -p $sourceRoot/subprojects + ${lib.concatMapStringsSep "\n" (name: "cp -r ${inputs.${name}} $sourceRoot/subprojects/${name}") subprojectNames} + chmod -R u+w $sourceRoot/subprojects + ''; + + # helper: copy packagefiles + copyPackagefiles = '' + for proj in ${builtins.toString subprojectNames}; do + if [ -d "subprojects/packagefiles/$proj" ]; then + cp -r subprojects/packagefiles/$proj/* subprojects/$proj/ + fi + done + ''; + + # helper: apply patches from '-patch' inputs + applyPatches = lib.concatMapStringsSep "\n" (name: '' + patch_input="${inputs.${name + "-patch"} or ""}" + if [ -n "$patch_input" ]; then + unzip "$patch_input" -d ${name}-patch-tmp + if [ $(ls -1 ${name}-patch-tmp | wc -l) -eq 1 ] && [ -d ${name}-patch-tmp/* ]; then + cp -r ${name}-patch-tmp/*/* subprojects/${name}/ + else + cp -r ${name}-patch-tmp/* subprojects/${name}/ + fi + rm -rf ${name}-patch-tmp + fi + '') subprojectNames; + in { packages.default = pkgs.clangStdenv.mkDerivation { @@ -57,34 +93,21 @@ dontFixup = true; dontUseCmakeConfigure = true; - # 4jcraft - Meson expects this subprojects structure + # Disable fortify to prevent buffer overflow detection + hardeningDisable = [ "fortify3" "fortify" ]; + postUnpack = '' - mkdir -p $sourceRoot/subprojects - - cp -r ${inputs.shiggy} $sourceRoot/subprojects/shiggy - cp -r ${inputs."4jlibs"} $sourceRoot/subprojects/4jlibs - cp -r ${inputs.stb} $sourceRoot/subprojects/stb - cp -r ${inputs.simdutf} $sourceRoot/subprojects/simdutf - cp -r ${inputs.miniaudio} $sourceRoot/subprojects/miniaudio - - chmod -R u+w $sourceRoot/subprojects + ${copySubprojects} ''; - # 4jcraft - `stb` and `simdutf` patches postPatch = '' - cp subprojects/packagefiles/stb/meson.build subprojects/stb/meson.build - cp subprojects/packagefiles/simdutf/meson.build subprojects/simdutf/meson.build - cp subprojects/packagefiles/simdutf/meson.options subprojects/simdutf/meson.options + # Remove wrap files so Meson doesn't try to download them + for proj in ${builtins.toString subprojectNames}; do + rm -f subprojects/$proj.wrap + done - unzip ${inputs.miniaudio-patch} -d miniaudio-patch-tmp - cp -r miniaudio-patch-tmp/*/. subprojects/miniaudio/ - - cat > subprojects/miniaudio.wrap < Date: Tue, 31 Mar 2026 21:01:20 +0200 Subject: [PATCH 09/10] Made a PR for the overflow fix, reenable hardening. --- flake.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/flake.nix b/flake.nix index 80e07de1d..699f7a74c 100644 --- a/flake.nix +++ b/flake.nix @@ -93,9 +93,6 @@ dontFixup = true; dontUseCmakeConfigure = true; - # Disable fortify to prevent buffer overflow detection - hardeningDisable = [ "fortify3" "fortify" ]; - postUnpack = '' ${copySubprojects} ''; From 74db0074036737ba33e2018a171f7f41fb4dda2b Mon Sep 17 00:00:00 2001 From: /home/neo <158327205+neoapps-dev@users.noreply.github.com> Date: Fri, 3 Apr 2026 10:13:30 +0300 Subject: [PATCH 10/10] feat(CI): add nightly build workflow (#390) * feat(CI): add nightly build workflow * ci: trigger nightly * ci: workflow dispatch * ci: oh god * fix(ci): build the whole game not just the executable --- .github/workflows/release-linux.yml | 87 +++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .github/workflows/release-linux.yml diff --git a/.github/workflows/release-linux.yml b/.github/workflows/release-linux.yml new file mode 100644 index 000000000..a44c987e6 --- /dev/null +++ b/.github/workflows/release-linux.yml @@ -0,0 +1,87 @@ +name: Nightly (Linux, x86-64) + +on: + push: + paths: &workflow_paths + - '**.cpp' + - '**.h' + - '**.c' + - '**.cc' + - '**.cxx' + - '**.hh' + - '**.hpp' + - '**.hxx' + - '**.inl' + - "**meson.build" + - "flake.nix" + - '.github/workflows/build-linux.yml' + workflow_dispatch: + +jobs: + build-linux: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential ccache python3 python3-pip ninja-build libsdl2-dev libgl-dev libglu1-mesa-dev libpthread-stubs0-dev libglm-dev + python -m pip install meson + ccache -M 5G || true + + - name: Restore ccache + uses: actions/cache@v4 + with: + path: ~/.ccache + key: ${{ runner.os }}-ccache-${{ hashFiles('**/meson.build') }} + + - name: Restore meson cache + uses: actions/cache@v4 + with: + path: ~/.cache/meson + key: ${{ runner.os }}-meson-${{ hashFiles('**/meson.build') }} + + - name: Configure Meson + env: + CC: "ccache clang" + CXX: "ccache clang++" + CCACHE_DIR: ${{ runner.temp }}/ccache + run: | + mkdir -p "$CCACHE_DIR" + export CCACHE_DIR="$CCACHE_DIR" + meson setup build --wipe --native-file=./scripts/llvm_native.txt + + - name: Build with Meson + env: + CC: "ccache clang" + CXX: "ccache clang++" + CCACHE_DIR: ${{ runner.temp }}/ccache + run: | + export CCACHE_DIR="${{ runner.temp }}/ccache" + meson compile -C build -j $(nproc) + + - name: Install patchelf + run: sudo apt-get install -y patchelf + + - name: Package artifact + run: | + cd build + zip -r ../minecraft-client-linux.zip Minecraft.Client --exclude "Minecraft.Client/Minecraft.Client.p/*" + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: minecraft-client-linux-${{ github.sha }} + path: minecraft-client-linux.zip + retention-days: 7 + + - name: Create nightly release + uses: softprops/action-gh-release@v2 + with: + tag_name: nightly + name: Nightly + prerelease: true + files: minecraft-client-linux.zip