Skip to content

Conversation

RK-BFX
Copy link
Contributor

@RK-BFX RK-BFX commented Jun 10, 2025

Fixes #501:

  1. Add necessary #includes to get the per-platform calls in GetExecutableFileName() to compile.
  2. Fix buffer size passed to _NSGetExecutablePath() in macOS.

Plus:
A. Add more diagnostics for test failures like this.
B. Add useful TODO comments.

Also fix some linter warnings:
a. 3 signed-unsigned comparison mismatches;
b. 1 possibly unused variable.

Fixes apache#501:
1. Add necessary `#include`s to get the per-platform calls in `GetExecutableFileName()` to compile.
2. Fix buffer size passed to `_NSGetExecutablePath()` in macOS.

Plus:
A. Add more diagnostics for test failures like this.
B. Add useful TODO comments.

Also fix some linter warnings:
a. 3 signed-unsigned comparison mismatches;
b. 1 possibly unused variable.
@swebb2066
Copy link
Contributor

Thanks for the fix.

To prevent future regressions, it may be advisable to include the multiprocessrollingtest in a CI task by adding to a MacOs task:

diff --git a/.github/workflows/log4cxx-macos.yml b/.github/workflows/log4cxx-macos.yml
index 21186763..55b56d23 100644
--- a/.github/workflows/log4cxx-macos.yml
+++ b/.github/workflows/log4cxx-macos.yml
@@ -31,16 +31,19 @@ jobs:
             cxx: clang++
             odbc: OFF
             qt: ON
+            multiprocess: OFF
           - name: osx-14
             os: macos-14
             cxx: clang++
             odbc: ON
             qt: OFF
+            multiprocess: ON
           - name: osx-g++
             os: macos-latest
             cxx: g++-14
             odbc: OFF
             qt: OFF
+            multiprocess: OFF

     steps:
     - uses: actions/checkout@v4
@@ -59,7 +62,13 @@ jobs:
         cd main
         mkdir build
         cd build
-        cmake -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DLOG4CXX_ENABLE_ODBC=${{ matrix.odbc }} -DLOG4CXX_CFSTRING=ON -DCMAKE_BUILD_TYPE=Debug ..
+        cmake \
+          -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
+          -DLOG4CXX_ENABLE_ODBC=${{ matrix.odbc }} \
+          -DLOG4CXX_MULTIPROCESS_ROLLING_FILE_APPENDER=${{ matrix.multiprocess }} \
+          -DLOG4CXX_CFSTRING=ON \
+          -DCMAKE_BUILD_TYPE=Debug \
+          ..
         cmake --build .

     - name: run unit tests

@RK-BFX
Copy link
Contributor Author

RK-BFX commented Jun 10, 2025

it may be advisable to include the multiprocessrollingtest in a CI task by adding to a MacOs task

Am I supposed to include these changes to my PR? I don't have experience with GitHub CI and don't know how to test this.
If you're a maintainer, are you able to amend the PR accordingly?

@swebb2066
Copy link
Contributor

Am I supposed to include these changes to my PR?

Yes, it helps the commit history to keep related changes together.

I don't have experience with GitHub CI and don't know how to test this.

Just apply that change an push the commit to the same branch. The GitHub actions will run when we (the maintainers) approve the change. The build logs from the Github action are available in a drop down list when you click the check-mark that getss added beside the commit hash.

@RK-BFX
Copy link
Contributor Author

RK-BFX commented Jun 10, 2025

Wouldn't it make sense to add at least one Release build in the similar manner? E.g. a new one with all of multiprocess, odbc, and qt set to ON?

@swebb2066
Copy link
Contributor

Leave the issue of what to test in CI for another day. Just apply the change to log4cxx-macos.yml so we can verify this change works.

… as requested by a Log4cxx maintainer in the Pull Request
@swebb2066 swebb2066 merged commit 0d2c5c8 into apache:master Jun 14, 2025
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

multiprocessrollingtest fails to compile in macOS; when fixed and built, the test fails

2 participants