From 861fea59a64b1c672ae6280e230474a17c1d909f Mon Sep 17 00:00:00 2001 From: Maschell Date: Sun, 9 Oct 2022 16:16:24 +0200 Subject: [PATCH] Log the WUMSLoader version on each application start --- .github/workflows/ci.yml | 7 +++++++ .github/workflows/pr.yml | 7 +++++++ wumsloader/src/entry.cpp | 5 +++++ wumsloader/src/version.h | 2 ++ 4 files changed, 21 insertions(+) create mode 100644 wumsloader/src/version.h diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87ffbdc..5cd86be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,13 @@ jobs: needs: clang-format steps: - uses: actions/checkout@v2 + - name: create version.h + run: | + git_hash=$(git rev-parse --short "$GITHUB_SHA") + cat < ./wumsloader/src/version.h + #pragma once + #define VERSION_EXTRA " (nightly-$git_hash)" + EOF - name: build binary run: | docker build . -t builder diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index f349956..dd6400f 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -26,6 +26,13 @@ jobs: needs: clang-format steps: - uses: actions/checkout@v2 + - name: create version.h + run: | + git_hash=$(git rev-parse --short "${{ github.event.pull_request.head.sha }}") + cat < ./wumsloader/src/version.h + #pragma once + #define VERSION_EXTRA " (nightly-$git_hash)" + EOF - name: build binary run: | docker build . -t builder diff --git a/wumsloader/src/entry.cpp b/wumsloader/src/entry.cpp index 42c28b2..b63f62b 100644 --- a/wumsloader/src/entry.cpp +++ b/wumsloader/src/entry.cpp @@ -8,10 +8,13 @@ #include "utils/dynamic.h" #include "utils/hooks.h" #include "utils/logger.h" +#include "version.h" #include #include #include +#define VERSION "v0.1" + void CallInitHooksForModule(const std::shared_ptr &curModule); std::vector> OrderModulesByDependencies(const std::vector> &loadedModules); @@ -62,6 +65,8 @@ void doStart(int argc, char **argv) { init_wut(); initLogging(); + OSReport("Running WUMSLoader " VERSION VERSION_EXTRA "\n"); + gUsedRPLs.clear(); // If an allocated rpl was not released properly (e.g. if something else calls OSDynload_Acquire without releasing it) // memory gets leaked. Let's clean this up! diff --git a/wumsloader/src/version.h b/wumsloader/src/version.h new file mode 100644 index 0000000..66a2c7e --- /dev/null +++ b/wumsloader/src/version.h @@ -0,0 +1,2 @@ +#pragma once +#define VERSION_EXTRA "" \ No newline at end of file