Skip to content

Commit 183dc92

Browse files
committed
greatly improved Donate CPU section in documentation / cleaned up some donate-cpu scripts [skip ci]
1 parent 76b1011 commit 183dc92

5 files changed

Lines changed: 43 additions & 87 deletions

readme.md

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,51 @@ A manual is available [online](https://cppcheck.sourceforge.io/manual.pdf).
1717

1818
## Donate CPU
1919

20-
Cppcheck is a hobby project with limited resources. You can help us by donating CPU (1 core or as many as you like). It is simple:
20+
Cppcheck is a project with limited resources.
2121

22-
1. Download (and extract) Cppcheck source code.
23-
2. Run:
24-
```
25-
cd cppcheck/
26-
virtualenv .env
27-
.env/bin/pip install -r tools/donate-cpu-requirements.txt
28-
.env/bin/python tools/donate-cpu.py
29-
```
22+
To monitor for stability, performance and regression we are analyzing the available source code of Debian packages with our latest development code
23+
and compare the results with the latest stable release.
3024

31-
The script will analyse debian source code and upload the results to a cppcheck server. We need these results both to improve Cppcheck and to detect regressions.
25+
You can help with this by donating CPU time (1 core or as many as you like) and bandwidth.
3226

33-
You can stop the script whenever you like with Ctrl C.
27+
It is as simple as running a shell script.
28+
29+
You need a Linux (or WSL) shell (MacOS should work as well) with Python 3.x, Git and some common (development) tools (the script will tell you which) installed.
30+
31+
NOTE: This will constantly and fully utilize the specified amount of cores while the script is running. It will also constantly fetch the sources which will be analyzed from a remote server (some of the packages are hundreds of megabytes in size).<br>
32+
If your resources and bandwidth are limited and/or would inflict certain costs on you (because of high energy prices or since you have to pay based on your data usage) you should probably not contribute.
33+
34+
```shell
35+
echo 'Thank you for providing resources and supporting the Cppcheck project!'
36+
37+
# clone the 'main' branch of the official repository if it doesn't exist yet
38+
if [ ! -d cppcheck ]; then
39+
git clone -b main https://github.com/danmar/cppcheck.git
40+
fi
41+
42+
cd cppcheck
43+
44+
while :
45+
do
46+
# create a virtual environment to install the required Python dependencies (or update it)
47+
python -m venv --upgrade --upgrade-deps .env
48+
49+
# install or upgrade the Python dependencies
50+
.env/bin/pip install -r tools/donate-cpu-requirements.txt --upgrade
51+
52+
# update to the latest source to make sure we run the latest client
53+
git pull
54+
55+
# run the client for a limited amount of packages (adjust -j to the amount of cores to use)
56+
.env/bin/python tools/donate-cpu.py --max-packages=1000 -j1
57+
58+
sleep 1
59+
done
60+
```
61+
62+
The bandwidth used can be limited by adding `--bandwidth-limit=` to the script invocation (see `--limit-rate=amount` on https://www.gnu.org/software/wget/manual/html_node/Download-Options.html for possible values).
63+
64+
The script can be stopped at any time with `CTRL+C`.
3465

3566
## Compiling
3667

tools/test/start_donate_cpu_server_test_local.sh renamed to tools/run_donate_cpu_server.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ fi
2727

2828
while :
2929
do
30-
"${cppcheck_tools_path}/donate-cpu-server.py" --test
30+
"${cppcheck_tools_path}/donate-cpu-server.py"
3131
done

tools/test/run_donate_cpu_client_tests.sh

Lines changed: 0 additions & 49 deletions
This file was deleted.

tools/test/start_donate_cpu_client_productive.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

tools/test/start_donate_cpu_client_test_local.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)