diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 6d4da5c8..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,112 +0,0 @@ -name: CI - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - runs-on: ${{ matrix.os }} - defaults: - run: - shell: ${{ matrix.shell }} - - strategy: - fail-fast: false - matrix: - #os: [ubuntu-latest] - os: [ubuntu-latest, windows-latest] - #os: [windows-latest] - build_type: [Release] - include: - - os: windows-latest - arch: 'win64_msvc2019_64' - host: 'windows' - shell: 'powershell' - #shell: 'cmd' - #shell: 'msys2 {0}' - - os: ubuntu-latest - arch: 'gcc_64' - host: 'linux' - shell: 'bash' - - steps: - - uses: actions/checkout@v3 - with: - submodules: 'true' - - - name: Install ninja-build tool (must be after Qt due PATH changes) - uses: turtlesec-no/get-ninja@main - - - name: Make sure MSVC is found when Ninja generator is in use - if: matrix.os == 'windows-latest' - uses: ilammy/msvc-dev-cmd@v1 - - #- name: Install MSYS2 - #if: matrix.os == 'windows-latest' - #uses: msys2/setup-msys2@v2 - #with: - #install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake git - #msystem: mingw64 - #release: false - - - name: Install Linux Dependencies - if: matrix.os == 'ubuntu-latest' - run: sudo apt-get install -y build-essential libgl1-mesa-dev libxcb-cursor-dev xorg-dev libxrandr-dev libxcursor-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev libdrm-dev libgbm-dev xvfb libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 - - - name: Install 7zip - if: matrix.os == 'windows-latest' - run: choco install 7zip.install - - - name: Install Mesa - if: matrix.os == 'windows-latest' - shell: cmd - run: | - curl.exe -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/20.3.2/mesa3d-20.3.2-release-msvc.7z - "C:\Program Files\7-Zip\7z.exe" x mesa.7z - mklink opengl32.dll "x64\opengl32.dll" - mklink libglapi.dll "x64\libglapi.dll" - - - name: Install Qt - uses: jurplel/install-qt-action@v3 - with: - aqtversion: '==3.1.*' - version: '6.6.1' - host: ${{ matrix.host }} - target: 'desktop' - arch: ${{ matrix.arch }} - dir: '${{github.workspace}}/qt' - install-deps: 'true' - modules: 'qtcharts qtpositioning' - - - name: Configure - env: - CMAKE_PREFIX_PATH: ${{env.Qt6_Dir}}/lib/cmake - run: cmake -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DALP_ENABLE_POSITIONING=false -B ./build - - - name: Build - run: cmake --build ./build - - - name: Unittests on Linux - if: matrix.os == 'ubuntu-latest' - env: - QT_QPA_PLATFORM: offscreen - DISPLAY: :1 - run: | - ./build/alp_external/radix/unittests/unittests_radix - ./build/unittests/nucleus/unittests_nucleus - Xvfb :1 -screen 0 1024x768x16 & - sleep 5 - ./build/unittests/gl_engine/unittests_gl_engine - - - name: Unittests on Windows - if: matrix.os == 'windows-latest' - env: - MESA_GL_VERSION_OVERRIDE: 3.3 - run: | - ./build/alp_external/radix/unittests/unittests_radix.exe - ./build/unittests/unittests_nucleus.exe - ./build/unittests/unittests_gl_engine.exe - diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..a24007b5 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,225 @@ +name: "Deploy" +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "deploy" + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + qtarch: [wasm_singlethread, wasm_multithread, android_arm64_v8a, android_armv7] + qtversion: ['6.6.1'] + include: + - qtarch: wasm_singlethread + qttarget: 'desktop' + qtmodules: 'qtcharts' + additional_build_flags: '--target install' + - qtarch: wasm_multithread + qttarget: 'desktop' + qtmodules: 'qtcharts' + additional_cmake_flags: '-DALP_ENABLE_THREADING=ON' + additional_build_flags: '--target install' + - qtarch: android_arm64_v8a + qttarget: 'android' + qtmodules: 'qtcharts qtpositioning' + - qtarch: android_armv7 + qttarget: 'android' + qtmodules: 'qtcharts qtpositioning' + + steps: + - name: Install dependencies + run: sudo apt-get install -y build-essential ninja-build + + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + + - uses: mymindstorm/setup-emsdk@v13 + if: matrix.qttarget == 'desktop' + with: + version: 3.1.37 + + - name: Install Qt native version (required by android version) + uses: jurplel/install-qt-action@v3 + with: + aqtversion: '==3.1.*' + version: ${{ matrix.qtversion }} + host: linux + target: 'desktop' + arch: gcc_64 + dir: '${{github.workspace}}/qt' + install-deps: 'true' + + - name: Set QT_HOST_PATH + run: echo "QT_HOST_PATH=${Qt6_DIR}" >> "$GITHUB_ENV" + + - name: Install Qt crosscompile target version + uses: jurplel/install-qt-action@v3 + with: + aqtversion: '==3.1.*' + version: ${{ matrix.qtversion }} + host: linux + target: ${{ matrix.qttarget }} + arch: ${{ matrix.qtarch }} + dir: '${{github.workspace}}/qt' + install-deps: 'true' + modules: ${{ matrix.qtmodules }} + + - name: Make qt cross binaries executable + run: | + chmod u+x ${Qt6_DIR}/bin/* + + - name: Verify emcc + if: matrix.qttarget == 'desktop' + run: emcc -v + + - name: Set reusable strings + shell: bash + run: | + BUILD_DIR="build" + APK_TARGET="app" + echo "BUILD_DIR=$BUILD_DIR" >> $GITHUB_ENV + echo "APK_TARGET=$APK_TARGET" >> $GITHUB_ENV + + echo "INSTALL_DIR=install/${{ matrix.qtarch }}" >> $GITHUB_ENV + echo "APK_DIR=$BUILD_DIR/$APK_TARGET/android-build/build/outputs/apk/" >> $GITHUB_ENV + echo "ANDROID_BUILD_DIR=$BUILD_DIR/$APK_TARGET/android-build/" >> $GITHUB_ENV + echo "DEPLOYMENT_SETTINGS=$BUILD_DIR/$APK_TARGET/android-alpineapp-deployment-settings.json" >> $GITHUB_ENV + + - name: Configure CMake + env: + CMAKE_PREFIX_PATH: ${{env.Qt6_DIR}}/lib/cmake + run: > + ${Qt6_DIR}/bin/qt-cmake + -G Ninja + -B $BUILD_DIR + -DCMAKE_BUILD_TYPE=Release + -DALP_WWW_INSTALL_DIR=$INSTALL_DIR + -DALP_ENABLE_ASSERTS=ON + -DFMT_INSTALL=OFF + ${{ matrix.additional_cmake_flags }} + -S ${{ github.workspace }} + + - name: Build + run: cmake --build $BUILD_DIR ${{ matrix.additional_build_flags }} + + - name: Signing Android package + env: + secret_test: ${{ secrets.KEYSTOREPASSWORD }} + if: matrix.qttarget == 'android' && env.secret_test != '' + run: | + echo ${{ secrets.SIGNINGKEYBASE64 }} > release.keystore.base64 + base64 -d release.keystore.base64 > release.keystore + $QT_HOST_PATH/bin/androiddeployqt --input $DEPLOYMENT_SETTINGS --output $ANDROID_BUILD_DIR --android-platform android-33 --gradle --release --sign release.keystore alpinemaps --storepass ${{ secrets.KEYSTOREPASSWORD }} + + - name: Readme why Android package was not signed + env: + secret_test: ${{ secrets.KEYSTOREPASSWORD }} + if: matrix.qttarget == 'android' && env.secret_test == '' + run: | + README_PATH=$APK_DIR/read_me_in_case_you_wonder_why_the_apk_is_not_signed.txt + echo "Well, the apk wasn't signed because there is no key to sign it with in your repository (the one this was created in)." >> $README_PATH + echo "" >> $README_PATH + echo "These are the steps to generate such a key:" >> $README_PATH + echo "- https://stackoverflow.com/questions/3997748/how-can-i-create-a-keystore. Use 'alpinemaps' as the alias!" >> $README_PATH + echo "- If you have the android dev setup ready in Qt Creator, you can also create the keystore via Projects (on the left side toolboar) -> Android Qt ... -> Build -> Build Steps -> Build Android APK -> Application Signature -> Create. Use 'alpinemaps' as the alias!" >> $README_PATH + echo "- Then you have to encode the keystore in base64, e.g., on linux via 'base64 keystorefile > keystorefile.base64'" >> $README_PATH + echo "- Finally, create the following secrets in github -> your repo -> Settings -> Secrets and variables -> Actions -> Repository secrets" >> $README_PATH + echo " SIGNINGKEYBASE64 = the base64 encoded key" >> $README_PATH + echo " KEYSTOREPASSWORD = the password used to create the keystore" >> $README_PATH + echo "" >> $README_PATH + echo "Oh, and I hope this saved your day ;)" >> $README_PATH + + - name: Copy android packages + if: matrix.qttarget == 'android' + run: | + mkdir -p $INSTALL_DIR + cp -r $APK_DIR/* $INSTALL_DIR + + - name: Create artifact + uses: actions/upload-artifact@v4 + with: + name: files_${{ matrix.qtarch }} + path: ${{ github.workspace }}/install/ + if-no-files-found: error + + deploy: + if: github.event_name == 'push' + needs: build + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + + steps: + - name: Install dependencies + run: sudo apt-get install -y lftp + + - name: Clone repository (only for version number) + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + path: ${{github.workspace}}/downloaded + + - name: Move into place + run: | + mkdir $GITHUB_WORKSPACE/github_page + mv $GITHUB_WORKSPACE/downloaded/*/* $GITHUB_WORKSPACE/github_page/ + + - name: Upload to an FTP host + env: + FTP_USER: ${{ secrets.FTP_USER }} + FTP_PASS: ${{ secrets.FTP_PASS }} + FTP_HOST: ${{ secrets.FTP_HOST }} + if: env.FTP_HOST != '' + run: | + reponame=$(echo $GITHUB_REPOSITORY | grep -oE "[^/]*$") + lftp -c " + set ftp:ssl-force true; + open -u $FTP_USER,$FTP_PASS $FTP_HOST; + mirror -R -e -v -n $GITHUB_WORKSPACE/github_page/. ./${reponame}_$(git describe --tags --dirty=-d --abbrev=1); + " + + - name: Fix headers for wasm_multithread + run: | + cd $GITHUB_WORKSPACE/github_page/wasm_multithread + wget https://raw.githubusercontent.com/gzuidhof/coi-serviceworker/master/coi-serviceworker.min.js + sed -i -e 's###g' alpineapp.html + + - name: Generate Directory Listings + uses: jayanta525/github-pages-directory-listing@v4.0.0 + with: + FOLDER: github_page + + - name: Create Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ${{github.workspace}}/github_page + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 00000000..6eb12d51 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,105 @@ +name: Linux tests + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +concurrency: + group: "linux" + cancel-in-progress: true + +jobs: + build: + strategy: + fail-fast: false + matrix: + compiler: [gcc, clang15, clang17] + build_type: [Release] + include: + - compiler: gcc + CC: '/usr/bin/gcc' + CXX: '/usr/bin/g++' + - compiler: clang15 + CC: '/usr/bin/clang-15' + CXX: '/usr/bin/clang++-15' + - compiler: clang17 + CC: '/usr/bin/clang-17' + CXX: '/usr/bin/clang++-17' + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + submodules: 'true' + + - name: Install Clang 17 + if: matrix.compiler == 'clang17' + run: | + wget https://apt.llvm.org/llvm.sh + chmod +x ./llvm.sh + sudo ./llvm.sh 17 + + - name: Install Linux Dependencies + run: | + sudo apt-get install -y build-essential ninja-build lld clang-15 libgl1-mesa-dev libxcb-cursor-dev xorg-dev libxrandr-dev libxcursor-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev libdrm-dev libgbm-dev xvfb libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + aqtversion: '==3.1.*' + version: '6.6.1' + host: 'linux' + target: 'desktop' + arch: 'gcc_64' + dir: '${{github.workspace}}/qt' + install-deps: 'true' + modules: 'qtcharts qtpositioning' + + - name: Configure + env: + CC: ${{ matrix.CC }} + CXX: ${{ matrix.CXX }} + CMAKE_PREFIX_PATH: ${{env.Qt6_Dir}}/lib/cmake + run: > + cmake -G Ninja + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + -DALP_ENABLE_ASSERTS=ON + -DALP_ENABLE_ADDRESS_SANITIZER=ON + -DALP_ENABLE_APP_SHUTDOWN_AFTER_60S=ON + -DCMAKE_BUILD_TYPE=Debug + -DALP_USE_LLVM_LINKER=ON + -B ./build + + - name: Build + env: + CC: ${{ matrix.CC }} + CXX: ${{ matrix.CXX }} + run: | + cmake --build ./build + + - name: Don't close loaded libraries for better sanitizer output + env: + CC: ${{ matrix.CC }} + CXX: ${{ matrix.CXX }} + run: | + echo "#include " >> dlclose.c + echo "int dlclose(void*) { return 0; }" >> dlclose.c + $CC --shared dlclose.c -o libdlclose.so + + - name: Unittests on Linux + env: + QT_QPA_PLATFORM: offscreen + DISPLAY: :1 + LD_PRELOAD: ./libdlclose.so + LSAN_OPTIONS: suppressions=./sanitizer_supressions/linux_leak.supp + ASAN_OPTIONS: verify_asan_link_order=0 + run: | + ./build/alp_external/radix/unittests/unittests_radix + ./build/unittests/nucleus/unittests_nucleus + Xvfb :1 -screen 0 1024x768x16 & + sleep 5 + ./build/unittests/gl_engine/unittests_gl_engine + ./build/app/alpineapp diff --git a/.github/workflows/webassembly.yml b/.github/workflows/webassembly.yml deleted file mode 100644 index df2f2129..00000000 --- a/.github/workflows/webassembly.yml +++ /dev/null @@ -1,139 +0,0 @@ -name: "webassembly" -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: mymindstorm/setup-emsdk@v13 - with: - version: 3.1.37 - - uses: actions/checkout@v3 - - name: Install Qt native version (required by webassembly version) - uses: jurplel/install-qt-action@v3 - with: - aqtversion: '==3.1.*' - version: '6.6.1' - host: linux - target: 'desktop' - arch: gcc_64 - dir: '${{github.workspace}}/qt' - install-deps: 'true' - modules: 'qtcharts qtpositioning' - - - name: Set QT_HOST_PATH - run: echo "QT_HOST_PATH=${Qt6_DIR}" >> "$GITHUB_ENV" - - - name: Install Linux Dependencies - run: sudo apt-get install -y build-essential ninja-build - - - name: Install Qt Webassembly version - uses: jurplel/install-qt-action@v3 - with: - aqtversion: '==3.1.*' - version: '6.6.1' - host: linux - target: 'desktop' - arch: wasm_singlethread - dir: '${{github.workspace}}/qt' - install-deps: 'true' - modules: 'qtcharts' - - - name: Make qt webassembly binaries executable - run: | - chmod u+x ${Qt6_DIR}/bin/* - - - name: Verify emcc - run: emcc -v - - - name: Set reusable strings - # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. - id: strings - shell: bash - run: | - echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - echo "install-dir=${{ github.workspace }}/install" >> "$GITHUB_OUTPUT" - - - name: Configure CMake - env: - CMAKE_PREFIX_PATH: ${{env.Qt6_DIR}}/lib/cmake - run: > - ${Qt6_DIR}/bin/qt-cmake - -G Ninja - -B ${{ steps.strings.outputs.build-output-dir }} - -DCMAKE_BUILD_TYPE=Release - -DALP_WWW_INSTALL_DIR=${{ steps.strings.outputs.install-dir }} - -DALP_ENABLE_ADDRESS_SANITIZER=ON - -DALP_ENABLE_ASSERTS=ON - -DFMT_INSTALL=OFF - -S ${{ github.workspace }} - - - name: Build - run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --target install - - - name: Create artifact - uses: actions/upload-artifact@v4 - with: - name: webassembly_out - path: ${{ steps.strings.outputs.install-dir }} - if-no-files-found: error - - - name: Create index.html - run: | - echo "" >> ${{ steps.strings.outputs.install-dir }}/index.html - echo " " >> ${{ steps.strings.outputs.install-dir }}/index.html - echo " AlpineMaps build" >> ${{ steps.strings.outputs.install-dir }}/index.html - echo " " >> ${{ steps.strings.outputs.install-dir }}/index.html - echo " " >> ${{ steps.strings.outputs.install-dir }}/index.html - echo " " >> ${{ steps.strings.outputs.install-dir }}/index.html - echo " " >> ${{ steps.strings.outputs.install-dir }}/index.html - echo "" >> ${{ steps.strings.outputs.install-dir }}/index.html - echo "" >> ${{ steps.strings.outputs.install-dir }}/index.html - - - name: Create Pages artifact - uses: actions/upload-pages-artifact@v3 - with: - path: ${{ steps.strings.outputs.install-dir }} - - - name: Debug output - run: echo ${{ github.event_name }} - - deploy: - if: github.event_name == 'push' - needs: build - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Setup Pages - uses: actions/configure-pages@v4 - - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 - - - name: Debug output - run: echo ${{ steps.deployment.outputs.page_url }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 00000000..3fb46667 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,74 @@ +name: Windows Tests + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +concurrency: + group: "windows" + cancel-in-progress: true + +jobs: + build: + runs-on: windows-latest + defaults: + run: + shell: 'powershell' + + steps: + - uses: actions/checkout@v3 + with: + submodules: 'true' + + - name: Install ninja-build tool (must be after Qt due PATH changes) + uses: turtlesec-no/get-ninja@main + + - name: Make sure MSVC is found when Ninja generator is in use + uses: ilammy/msvc-dev-cmd@v1 + + - name: Install 7zip + run: choco install 7zip.install + + - name: Install Mesa + shell: cmd + run: | + curl.exe -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/20.3.2/mesa3d-20.3.2-release-msvc.7z + "C:\Program Files\7-Zip\7z.exe" x mesa.7z + mklink opengl32.dll "x64\opengl32.dll" + mklink libglapi.dll "x64\libglapi.dll" + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + aqtversion: '==3.1.*' + version: '6.6.1' + host: windows + target: 'desktop' + arch: 'win64_msvc2019_64' + dir: '${{github.workspace}}/qt' + install-deps: 'true' + modules: 'qtcharts qtpositioning' + + - name: Configure + env: + CMAKE_PREFIX_PATH: ${{env.Qt6_Dir}}/lib/cmake + run: > + cmake -G Ninja + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + -DALP_ENABLE_POSITIONING=false + -DALP_ENABLE_ASSERTS=ON + -B ./build + + - name: Build + run: cmake --build ./build --config Debug + + - name: Unittests on Windows + env: + MESA_GL_VERSION_OVERRIDE: 3.3 + run: | + ./build/alp_external/radix/unittests/unittests_radix.exe + ./build/unittests/unittests_nucleus.exe + ./build/unittests/unittests_gl_engine.exe + diff --git a/CMakeLists.txt b/CMakeLists.txt index a05fe2f4..b93e32b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,7 @@ option(ALP_ENABLE_ADDRESS_SANITIZER "compiles atb with address sanitizer enabled option(ALP_ENABLE_THREAD_SANITIZER "compiles atb with thread sanitizer enabled (only debug, works only on g++ and clang)" OFF) option(ALP_ENABLE_ASSERTS "enable asserts (do not define NDEBUG)" ON) option(ALP_ENABLE_TRACK_OBJECT_LIFECYCLE "enables debug cmd printout of constructors & deconstructors if implemented" OFF) +option(ALP_ENABLE_APP_SHUTDOWN_AFTER_60S "Shuts down the app after 60S, used for CI testing with asan." OFF) set(ALP_EXTERN_DIR "extern" CACHE STRING "name of the directory to store external libraries, fonts etc..") @@ -79,8 +80,8 @@ if (ALP_ENABLE_POSITIONING) endif() include(cmake/alp_add_git_repository.cmake) -alp_add_git_repository(renderer_static_data URL https://github.com/AlpineMapsOrg/renderer_static_data.git COMMITISH origin/main DO_NOT_ADD_SUBPROJECT) -alp_add_git_repository(alpineapp_fonts URL https://github.com/AlpineMapsOrg/fonts.git COMMITISH origin/main DO_NOT_ADD_SUBPROJECT) +alp_add_git_repository(renderer_static_data URL https://github.com/AlpineMapsOrg/renderer_static_data.git COMMITISH v23.11 DO_NOT_ADD_SUBPROJECT) +alp_add_git_repository(alpineapp_fonts URL https://github.com/AlpineMapsOrg/fonts.git COMMITISH v23.11 DO_NOT_ADD_SUBPROJECT) alp_add_git_repository(doc URL https://github.com/AlpineMapsOrg/documentation.git COMMITISH origin/main DO_NOT_ADD_SUBPROJECT DESTINATION_PATH doc) diff --git a/README.md b/README.md index 9a1e0d59..7d971683 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # alpine-renderer -A developer version is available at [alpinemaps.org](https://alpinemaps.org), and an apk for android under https://alpinemaps.org/apk. Be aware that it can break at any time! +This is the software behind [alpinemaps.org](https://alpinemaps.org). + +A developer version (trunk) is released [here](https://alpinemapsorg.github.io/renderer/), including APKs for android. Be aware that it can break at any time! We are in discord, talk to us! https://discord.gg/p8T9XzVwRa @@ -7,8 +9,8 @@ https://discord.gg/p8T9XzVwRa # Cloning and building `git clone git@github.com:AlpineMapsOrg/renderer.git` -After that it should be a normal cmake project. That is, you run cmake to generate a project or build file and then run your favourite tool. All dependencies should be pulled automatically into `renderer/external` while you run CMake. -We use Qt Creator (with mingw on Windows), which is the only tested setup atm and makes setup of Android and WebAssembly builds reasonably easy. If you have questions, please open a new [discussion](https://github.com/AlpineMapsOrg/renderer/discussions). +After that it should be a normal cmake project. That is, you run cmake to generate a project or build file and then run your favourite tool. All dependencies should be pulled automatically while you run CMake. +We use Qt Creator (with mingw on Windows), which is the only tested setup atm and makes setup of Android and WebAssembly builds reasonably easy. If you have questions, please go to discord. ## Dependencies * Qt 6.6.0, or greater @@ -45,3 +47,11 @@ We use Qt Creator (with mingw on Windows), which is the only tested setup atm an (in case you use Qt Creator, go to Preferences -> C++ -> Code Style: Formatting mode: Full, Format while typing, Format edited code on file save, don't override formatting) * follow the [Qt recommendations](https://wiki.qt.io/API_Design_Principles) and the [c++ core guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines) everywhere else. +# Developer workflow +* Fork this repository. +* Work in branches or your main. +* Make pull requests from your main branch. +* Github Actions will run the unit tests and creating packages for the browser and Android. +* Make sure that the unit tests run through. +* We will also look at the browser version during the pull request. +* Ideally you'll also setup the signing keys for Android packages ([instructions](https://github.com/AlpineMapsOrg/renderer/blob/main/creating_apk_keys.md)). diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index dadcc372..f863aaa6 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -68,7 +68,7 @@ qt_add_qml_module(alpineapp icons/peak.svg icons/search.svg icons/favicon.ico - icons/favicon_256.png + icons/icon.svg icons/material/monitoring.svg icons/material/3d_rotation.svg icons/material/map.svg @@ -85,6 +85,7 @@ qt_add_qml_module(alpineapp icons/presets/basic.png icons/presets/shaded.png icons/presets/snow.png + ) qt_add_resources(alpineapp "height_data" @@ -127,6 +128,9 @@ if (ALP_ENABLE_POSITIONING) target_link_libraries(alpineapp PUBLIC Qt::Positioning) target_compile_definitions(alpineapp PUBLIC "ALP_ENABLE_GNSS") endif() +if (ALP_ENABLE_APP_SHUTDOWN_AFTER_60S) + target_compile_definitions(alpineapp PUBLIC "ALP_APP_SHUTDOWN_AFTER_60S") +endif() if (ANDROID OR EMSCRIPTEN) target_compile_definitions(alpineapp PUBLIC ALP_QML_SOURCE_DIR="qrc:///qt/qml/app/") diff --git a/app/Main.qml b/app/Main.qml index da4cfccd..b20a7664 100644 --- a/app/Main.qml +++ b/app/Main.qml @@ -27,8 +27,8 @@ import "components" Item { id: main - property int theme: Material.Light //Material.System - property int accent: Material.Green + property int theme: Material.Light + property int accent: Material.BlueGrey property string selectedPage: "map"; @@ -95,7 +95,7 @@ Item { id: menu bannerTitle: "Alpine Maps" - bannerIconSource: "../icons/favicon_256.png" + bannerIconSource: "../icons/icon.svg" bannerSubtitle: _alpine_renderer_version selectedButtonId: 0 diff --git a/app/android/res/drawable-hdpi/icon.png b/app/android/res/drawable-hdpi/icon.png index b3258fb3..2f9d4c3b 100644 Binary files a/app/android/res/drawable-hdpi/icon.png and b/app/android/res/drawable-hdpi/icon.png differ diff --git a/app/android/res/drawable-ldpi/icon.png b/app/android/res/drawable-ldpi/icon.png index 150cb293..c7df150d 100644 Binary files a/app/android/res/drawable-ldpi/icon.png and b/app/android/res/drawable-ldpi/icon.png differ diff --git a/app/android/res/drawable-mdpi/icon.png b/app/android/res/drawable-mdpi/icon.png index 77a3a7b9..c131538a 100644 Binary files a/app/android/res/drawable-mdpi/icon.png and b/app/android/res/drawable-mdpi/icon.png differ diff --git a/app/android/res/drawable-xhdpi/icon.png b/app/android/res/drawable-xhdpi/icon.png index 7416be95..c816cee0 100644 Binary files a/app/android/res/drawable-xhdpi/icon.png and b/app/android/res/drawable-xhdpi/icon.png differ diff --git a/app/android/res/drawable-xxhdpi/icon.png b/app/android/res/drawable-xxhdpi/icon.png index cb08dc1c..1ad8e1e0 100644 Binary files a/app/android/res/drawable-xxhdpi/icon.png and b/app/android/res/drawable-xxhdpi/icon.png differ diff --git a/app/android/res/drawable-xxxhdpi/icon.png b/app/android/res/drawable-xxxhdpi/icon.png index e29f2e1e..c09070d6 100644 Binary files a/app/android/res/drawable-xxxhdpi/icon.png and b/app/android/res/drawable-xxxhdpi/icon.png differ diff --git a/app/icons/favicon.ico b/app/icons/favicon.ico index 92dcaed7..fba3e96a 100644 Binary files a/app/icons/favicon.ico and b/app/icons/favicon.ico differ diff --git a/app/icons/favicon_256.png b/app/icons/favicon_256.png deleted file mode 100644 index 0639c7f7..00000000 Binary files a/app/icons/favicon_256.png and /dev/null differ diff --git a/app/icons/icon.svg b/app/icons/icon.svg new file mode 100644 index 00000000..fc44b2fa --- /dev/null +++ b/app/icons/icon.svg @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + diff --git a/app/icons/icon_small.svg b/app/icons/icon_small.svg new file mode 100644 index 00000000..14d69f79 --- /dev/null +++ b/app/icons/icon_small.svg @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + diff --git a/app/main.cpp b/app/main.cpp index cee08bcd..d43184a9 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -135,8 +135,12 @@ int main(int argc, char **argv) #if (defined(__linux) && !defined(__ANDROID__)) || defined(_WIN32) || defined(_WIN64) root_window->showMaximized(); #endif +#ifdef ALP_APP_SHUTDOWN_AFTER_60S + QTimer::singleShot(60000, &app, &QCoreApplication::quit); +#endif - RenderThreadNotifier::instance()->set_root_window(root_window); + RenderThreadNotifier::instance() + ->set_root_window(root_window); return app.exec(); } diff --git a/cmake/alp_add_unittest.cmake b/cmake/alp_add_unittest.cmake index 7b3f23ea..c8205fd6 100644 --- a/cmake/alp_add_unittest.cmake +++ b/cmake/alp_add_unittest.cmake @@ -18,7 +18,7 @@ find_package(Qt6 REQUIRED COMPONENTS Test) if (NOT TARGET Catch2) - alp_add_git_repository(catch2 URL https://github.com/catchorg/Catch2.git COMMITISH v3.4.0) + alp_add_git_repository(catch2 URL https://github.com/catchorg/Catch2.git COMMITISH v3.5.1) endif() if (EMSCRIPTEN AND ALP_ENABLE_THREADING) diff --git a/cmake/alp_generate_version_file.cmake b/cmake/alp_generate_version_file.cmake index 86aacc87..18fac213 100644 --- a/cmake/alp_generate_version_file.cmake +++ b/cmake/alp_generate_version_file.cmake @@ -28,7 +28,7 @@ execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --dirty=-d --abbrev=1 if (ALP_VERSION STREQUAL "") message(WARNING "Retrieving version string from git was not successfull. Setting it to 'vUnknown'") - set(${output_variable} "vUnknown" PARENT_SCOPE) + set(ALP_VERSION "vUnknown") else() string(REPLACE "-g" "." ALP_VERSION ${ALP_VERSION}) string(REPLACE "-" "." ALP_VERSION ${ALP_VERSION}) diff --git a/creating_apk_keys.md b/creating_apk_keys.md new file mode 100644 index 00000000..30bb840c --- /dev/null +++ b/creating_apk_keys.md @@ -0,0 +1,13 @@ +# Easy way (shared keys) +Create the following secrets in github -> your repo -> Settings -> Secrets and variables -> Actions -> Repository secrets: +- SIGNINGKEYBASE64 = +> MIITVwIBAzCCEwEGCSqGSIb3DQEHAaCCEvIEghLuMIIS6jCCC1EGCSqGSIb3DQEHAaCCC0IEggs+MIILOjCCBZcGCyqGSIb3DQEMCgECoIIFQDCCBTwwZgYJKoZIh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h+PY82CVo4nMp86iqQr8L+78wICJxA= +- KEYSTOREPASSWORD = _asdfasdf_ + +# These are the steps to generate such a key: +- https://stackoverflow.com/questions/3997748/how-can-i-create-a-keystore. Use 'alpinemaps' as the alias! +- If you have the android dev setup ready in Qt Creator, you can also create the keystore via Projects (on the left side toolboar) -> Android Qt ... -> Build -> Build Steps -> Build Android APK -> Application Signature -> Create. Use 'alpinemaps' as the alias! +- Then you have to encode the keystore in base64, e.g., on linux via 'base64 keystorefile > keystorefile.base64' +- Finally, create the following secrets in github -> your repo -> Settings -> Secrets and variables -> Actions -> Repository secrets + SIGNINGKEYBASE64 = the base64 encoded key + KEYSTOREPASSWORD = the password used to create the keystore diff --git a/gl_engine/Window.cpp b/gl_engine/Window.cpp index 528aaa64..ecaecb05 100644 --- a/gl_engine/Window.cpp +++ b/gl_engine/Window.cpp @@ -255,8 +255,8 @@ void Window::paint(QOpenGLFramebufferObject* framebuffer) const GLuint clearNormalColor[2] = {0u, 0u}; f->glClearBufferuiv(GL_COLOR, 2, clearNormalColor); // Clear Encoded-Depth Buffer - const GLuint clearEncDepthColor[1] = {0u}; - f->glClearBufferuiv(GL_COLOR, 3, clearEncDepthColor); + const GLfloat clearEncDepthColor[] = { 0.0f, 0.0f, 0.0f, 0.0f }; + f->glClearBufferfv(GL_COLOR, 3, clearEncDepthColor); // Clear Depth-Buffer //f->glClearDepthf(0.0f); // for reverse z f->glClear(GL_DEPTH_BUFFER_BIT); diff --git a/nucleus/CMakeLists.txt b/nucleus/CMakeLists.txt index 46fb47e5..fd1eb690 100644 --- a/nucleus/CMakeLists.txt +++ b/nucleus/CMakeLists.txt @@ -21,10 +21,8 @@ project(alpine-renderer-nucleus LANGUAGES CXX) - alp_add_git_repository(stb_slim URL https://github.com/AlpineMapsOrg/stb_slim.git COMMITISH origin/main) -alp_add_git_repository(radix URL https://github.com/AlpineMapsOrg/radix.git COMMITISH origin/main NOT_SYSTEM) - +alp_add_git_repository(radix URL https://github.com/AlpineMapsOrg/radix.git COMMITISH v24.01.17 NOT_SYSTEM) alp_add_git_repository(tl_expected URL https://github.com/TartanLlama/expected.git COMMITISH v1.1.0 DO_NOT_ADD_SUBPROJECT) if (NOT TARGET fmt) alp_add_git_repository(fmt URL https://github.com/fmtlib/fmt.git COMMITISH 10.1.1) @@ -104,13 +102,10 @@ qt_add_library(nucleus STATIC target_include_directories(nucleus PRIVATE . PUBLIC ${CMAKE_SOURCE_DIR}) target_link_libraries(nucleus PUBLIC radix Qt::Core Qt::Gui Qt::Network Qt::Svg fmt::fmt zppbits tl_expected nucleus_version stb_slim) -if (EMSCRIPTEN) - target_compile_options(nucleus PUBLIC -O3) - target_link_options(nucleus PUBLIC -O3) -endif() -if (ALP_ENABLE_ASSERTS) - target_compile_options(nucleus PUBLIC "-U NDEBUG") -endif() +# if (EMSCRIPTEN) +# # target_compile_options(nucleus PUBLIC -fwasm-exceptions) +# # target_link_options(nucleus PUBLIC -fwasm-exceptions) +# endif() if (ALP_ENABLE_THREADING) target_compile_definitions(nucleus PUBLIC "ALP_ENABLE_THREADING") endif() diff --git a/nucleus/tile_scheduler/Scheduler.cpp b/nucleus/tile_scheduler/Scheduler.cpp index e4cc7383..c90b8cd9 100644 --- a/nucleus/tile_scheduler/Scheduler.cpp +++ b/nucleus/tile_scheduler/Scheduler.cpp @@ -25,8 +25,6 @@ #include #include #include -#include -#include #include "nucleus/tile_scheduler/utils.h" #include "nucleus/utils/tile_conversion.h" @@ -229,11 +227,16 @@ void Scheduler::persist_tiles() const auto start = std::chrono::steady_clock::now(); const auto r = m_ram_cache.write_to_disk(disk_cache_path()); const auto diff = std::chrono::steady_clock::now() - start; + if (diff > std::chrono::milliseconds(50)) - fmt::println(stderr, "Scheduler::persist_tiles took {} for {} quads.", std::chrono::duration_cast(diff), m_ram_cache.n_cached_objects()); + qDebug() << QString("Scheduler::persist_tiles took %1ms for %2 quads.") + .arg(std::chrono::duration_cast(diff).count()) + .arg(m_ram_cache.n_cached_objects()); if (!r.has_value()) { - qDebug("Writing tiles to disk into %s failed: %s. Removing all files.", disk_cache_path().c_str(), r.error().c_str()); + qDebug() << QString("Writing tiles to disk into %1 failed: %2. Removing all files.") + .arg(QString::fromStdString(disk_cache_path().string())) + .arg(QString::fromStdString(r.error())); std::filesystem::remove_all(disk_cache_path()); } } @@ -274,7 +277,9 @@ void Scheduler::read_disk_cache() if (r.has_value()) { update_stats(); } else { - qDebug("Reading tiles from disk cache (%s) failed: \n%s\nRemoving all files.", disk_cache_path().c_str(), r.error().c_str()); + qDebug() << QString("Reading tiles from disk cache (%1) failed: \n%2\nRemoving all files.") + .arg(QString::fromStdString(disk_cache_path().string())) + .arg(QString::fromStdString(r.error())); std::filesystem::remove_all(disk_cache_path()); } } diff --git a/nucleus/tile_scheduler/cache_quieries.h b/nucleus/tile_scheduler/cache_quieries.h index 096605ff..d7f5436d 100644 --- a/nucleus/tile_scheduler/cache_quieries.h +++ b/nucleus/tile_scheduler/cache_quieries.h @@ -47,7 +47,7 @@ inline float query_altitude(MemoryCache* cache, const glm::dvec2& lat_long) if (height_tile.isNull()) return 1000; const auto x = int(uv.x * height_tile.width()); - const auto y = int(uv.y * height_tile.height()); + const auto y = int((1 - uv.y) * height_tile.height()); const auto rgb = QColor(height_tile.pixel(x, y)); return radix::height_encoding::to_float({rgb.red(), rgb.green(), rgb.blue()}); } diff --git a/sanitizer_supressions/linux_leak.supp b/sanitizer_supressions/linux_leak.supp new file mode 100644 index 00000000..fa893459 --- /dev/null +++ b/sanitizer_supressions/linux_leak.supp @@ -0,0 +1,4 @@ +leak:dbus +leak:fontconfig +leak:icui18n +leak:gallium diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 5efeeb4e..6b20df7c 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -18,7 +18,7 @@ project(alpine-renderer-unittests LANGUAGES CXX) -alp_add_git_repository(qml_catch2_console URL https://github.com/AlpineMapsOrg/qml_catch2_console.git COMMITISH origin/main DO_NOT_ADD_SUBPROJECT) +alp_add_git_repository(qml_catch2_console URL https://github.com/AlpineMapsOrg/qml_catch2_console.git COMMITISH v24.01.17 DO_NOT_ADD_SUBPROJECT) include(${CMAKE_SOURCE_DIR}/cmake/alp_add_unittest.cmake) add_subdirectory(nucleus)