From ffcab114a1de1f844db4eedf623a643386730efd Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Mon, 22 Jul 2024 15:43:03 +0200 Subject: [PATCH 1/3] Fix debug compilation error --- Common/Data/Collections/FastVec.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Common/Data/Collections/FastVec.h b/Common/Data/Collections/FastVec.h index 673c3ef5db..a8abb5e140 100644 --- a/Common/Data/Collections/FastVec.h +++ b/Common/Data/Collections/FastVec.h @@ -7,6 +7,7 @@ #include #include +#include #include "Common/Log.h" From 96fd0f4bcd314878f3f286c4edd5bc4a2f720b21 Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Fri, 26 Jul 2024 20:23:45 +0200 Subject: [PATCH 2/3] Add NO_MMAP flag in the compilation scripts --- CMakeLists.txt | 7 +++++++ Common/MemArenaPosix.cpp | 2 +- b.sh | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 93d9ce7ed5..ad2be076bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -186,6 +186,7 @@ option(USE_SYSTEM_MINIUPNPC "Dynamically link against system miniUPnPc" ${USE_SY option(USE_ASAN "Use address sanitizer" OFF) option(USE_UBSAN "Use undefined behaviour sanitizer" OFF) option(USE_CCACHE "Use ccache if detected" ON) +option(USE_NO_MMAP "Disable mmap usage" OFF) if(USE_CCACHE) include(ccache) @@ -247,6 +248,12 @@ if(HTTPS_NOT_AVAILABLE) add_definitions(-DHTTPS_NOT_AVAILABLE) endif() +# Disable the usage of MMAP for the memory system. +# It is not tested on all platforms and can cause issues. +if(USE_NO_MMAP) + add_definitions(-DNO_MMAP -DMASKED_PSP_MEMORY) +endif() + # Work around for some misfeature of the current glslang build system include_directories(ext/glslang) diff --git a/Common/MemArenaPosix.cpp b/Common/MemArenaPosix.cpp index 6f3c25c900..a413f4eaf2 100644 --- a/Common/MemArenaPosix.cpp +++ b/Common/MemArenaPosix.cpp @@ -137,7 +137,7 @@ void MemArena::ReleaseView(s64 offset, void* view, size_t size) { u8* MemArena::Find4GBBase() { // Now, create views in high memory where there's plenty of space. -#if PPSSPP_ARCH(64BIT) && !defined(USE_ASAN) +#if PPSSPP_ARCH(64BIT) && !defined(USE_ASAN) && !defined(NO_MMAP) // We should probably just go look in /proc/self/maps for some free space. // But let's try the anonymous mmap trick, just like on 32-bit, but bigger and // aligned to 4GB for the movk trick. We can ensure that we get an aligned 4GB diff --git a/b.sh b/b.sh index e09561ee2b..938a66f85f 100755 --- a/b.sh +++ b/b.sh @@ -81,6 +81,9 @@ do --alderlake) echo "Alderlake opt" CMAKE_ARGS="-DCMAKE_C_FLAGS=\"-march=alderlake\" -DCMAKE_CPP_FLAGS=\"-march=alderlake\"" ;; + --no_mmap) echo "Disable mmap" + CMAKE_ARGS="-DUSE_NO_MMAP=ON ${CMAKE_ARGS}" + ;; *) MAKE_OPT="$1 ${MAKE_OPT}" ;; esac From 1146b6cf57ce9be6804d6a0a103bf0918caecb0c Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Fri, 26 Jul 2024 20:24:05 +0200 Subject: [PATCH 3/3] Run unit tests on alpine docker too --- .github/workflows/build.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 71e62c455c..2f249aeb63 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -362,3 +362,40 @@ jobs: - name: Execute headless tests working-directory: ${{ env.GITHUB_WORKSPACE }} run: python test.py -g --graphics=software + + build_test_headless_alpine: + runs-on: ubuntu-latest + container: + image: alpine:latest + options: --shm-size=8g + steps: + - name: Install Linux dependencies (Alpine) + run: | + apk add build-base wget git bash cmake python3 glu-dev sdl2-dev + + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Fix git detected dubious ownership in repository + run: | + chown -R $(id -u):$(id -g) $PWD + + - name: Setup ccache + uses: hendrikmuhs/ccache-action@v1.2 + + - name: Compile ffmpeg + run: | + cd ffmpeg && ./linux_x86-64.sh + + - name: Build for testing + run: | + ./b.sh --headless --unittest + + - name: Execute unit tests + run: | + ./build/PPSSPPUnitTest ALL + + - name: Execute headless tests + run: | + python test.py -g --graphics=software