Commit Graph

157 Commits

Author SHA1 Message Date
Oliver Stöneberg 4aae670b45
donate-cpu: fixed #11276 (donate-cpu: Improve library detection) / respect `--no-upload` in "nodata" uploads (#5292)
We were only matching each library once as the entry was removed from
the container stored in the class as we did not modify a copy but a
reference.
2023-08-04 10:30:58 +02:00
Rikard Falkeborn 9acc9659aa
test-my-pr robustification (#4756)
* Add try_retry-logic to get_packages_count()

Occasionally, get_packages_count() fails, which is a bit annoying since
it happens after compilation and therefore can take some time to detect.
Add try-retry to the function to make it more robust.

* Move try_retry-logic to lib.get_package()

Moving it to the library means test-my-pr also benefits from it. This
fixes Trac ticket #11405.
2023-01-31 22:39:55 +01:00
Oliver Stöneberg d8451eda5f
donate-cpu: fixed interrupted `main` branch compilation (#4643) 2022-12-18 19:50:22 +01:00
Oliver Stöneberg 67f46b7353
donate-cpu: avoid unnecessary build invocation for `main` (#4596) 2022-11-28 20:49:05 +01:00
Oliver Stöneberg f6c2afa2ea
fix #10159 - donate-cpu: collect and avoid packages with no files to process (#4498) 2022-11-23 19:13:54 +01:00
Oliver Stöneberg a7dde5d470
donate-cpu: improved client stability by consistently re-trying remote calls / cleanups (#4545) 2022-11-20 14:47:19 +01:00
Oliver Stöneberg 12afb9bbf4
cleaned up global `donate_cpu_lib.py` configuration variables (#4532) 2022-10-06 20:49:47 +02:00
Oliver Stöneberg cee04f4ee5
donate-cpu: fixed `make` build / cleanups (#4398) 2022-08-25 22:20:30 +02:00
Oliver Stöneberg 9cd9afa1b6
donate-cpu: added support for `mingw32-make` and improved support for `msbuild.exe` (#4352) 2022-08-21 17:08:58 +02:00
Oliver Stöneberg 30b20d17cb
donate-cpu: some cleanups (#4291)
* donate_cpu_lib.py: bumped version

* donate-cpu.py: replaced `version.StrictVersion` from deprecated `distutils` with `version.Version` from `packaging`

* donate_cpu_lib.py: omit `-rp=` from `cppcheck-options`

* donate-cpu.py: use `get_client_version()` instead of constant
2022-07-19 07:52:23 +02:00
Oliver Stöneberg 7ee450ed21
donate-cpu.py: fixed stupid mistakes in client version update notification (#4290) 2022-07-18 23:10:33 +02:00
Oliver Stöneberg cc9c5a2768
donate-cpu.py: added `--version` and show a message when a newer client is available (#4288) 2022-07-18 16:24:04 +02:00
Oliver Stöneberg bc58f55c6e
donate-cpu: greatly improved `LibraryIncludes.get_libraries()` performance / some optimizations and cleanups (#4273)
* donate_cpu_lib.py: use `os.path.join()`

* donate-cpu: removed remaining usage of `os.chdir()`

* donate_cpu_lib.py: moved library includes code into class

* donate_cpu_lib.py: pre-compile library include regular expressions

* donate_cpu_lib.py: pre-compile some more regular expressions

* donate_cpu_lib.py: small unpack_package() cleanup and optimization

* donate_cpu_lib.py: added some information about the extracted files to unpack_package()

* donate_cpu_lib.py: bumped version

* added test_donate_cpu_lib.py

* donate_cpu_lib.py: greatly improved `LibraryIncludes.get_libraries()` performance

only scan each file once for previously undetected libraries only

* test_donate_cpu_lib.py: fix for Python 3.5

* scriptcheck.yml: added `-v` to pytest calls so we get the complete diff on assertions

* fixed `test_arguments_regression()` Python tests with additional pytest arguments

* donate_cpu_lib.py: use `subprocess.check_call()`

* test_donate_cpu_lib.py: sort results to address differences in order with Python 3.5
2022-07-13 21:09:29 +02:00
Oliver Stöneberg 1d9b6e1aac
donate-cpu: fixed library detection (#4261) 2022-07-12 19:39:07 +02:00
Daniel Marjamäki 31560299f8 donate-cpu: skip torture test file 2022-05-20 23:20:16 +02:00
Oliver Stöneberg d3ba5a0829
donate-cpu.py: added "--packages" parameter to specify a list of packages to process (#3742) 2022-02-14 12:59:38 +01:00
guillaume-uH57J9 dfd22919bc
donate_cpu_lib.py: fix callstack capture, fix dependency check (#3665)
* donate_cpu_lib.py: fix callstack capture, fix dependency check

check_requirements: verify that module psutil is available. 
scan_package: collect crash callstack regardless of cppcheck_path and cppcheck version

* donate_cpu_lib.pu: remove debug code

* donate_cpu_lib.py: add parameter capture_callstack
2022-01-02 22:16:00 +01:00
guillaume-uH57J9 a3560aaf5a
Better git usage in donate-cpu.py to reduce bandwidth and disk usage (#3584)
* Better git usage in donate-cpu.py to reduce bandwidth and disk usage

Main changes:
* Bump client version
* Move try+retry logic to function try_retry to reduce duplication
* Use exponential backoff for try_retry
* git clone with --depth=1 to reduce bandwidth and disk use
* Use multiple worktree to work with multiple versions, instead of back-and-forth checkouts

* donate-cpu.py fixes for review comments and automated check failures

* Move compile_cppcheck within (if ver == 'main) branch to avoid duplicate compile_cppcheck+compile_version cals
* Use classic format syntax for python 3.5 compatibility
* Fix undefined CalledProcessError detected by pylint

* donate-cpu.py code changes following code review

* Migration existing "cppcheck" directory if available instead of "git clone"
* Logging message tweaks
* Use subprocess' cwd parameter instead of os.chdir() to avoid risk around changing and not restoring the working directory

* Update tools/test-my-pr.py to account for donate_cpu_lib changes

* donate-cpu.py: ensure correct workspace locations with relative --work-path
2021-12-19 18:52:36 +01:00
Oliver Stöneberg f8edb7b6e6
various daca@home client cleanups (#3161) 2021-03-06 12:34:12 +01:00
Oliver Stöneberg b472b4e65d
some Python cleanups based on PyCharm inspections (#2999)
* some Python cleanups based on PyCharm inspections

* test-helloworld.py: adjusted assert in test_addon_relative_path()
2021-01-31 14:27:11 +01:00
Rikard Falkeborn 0d361f8a2e
test-my-pr: Retry if failed to get package (#2515) 2020-02-02 18:00:36 +01:00
Sebastian 2d95c35974
Donate CPU/test-my-pr: Add timeout for the Cppcheck execution (#2500)
This adds a timeout of 60 minutes for the Cppcheck analysis.
Timed out results do not count as crash but they are uploaded and
marked with "TO!" in the list of the latest results. No "diff" is
generated for timed out results so they do not add wrong entries to
the "Diff report".
In test-my-pr.py the timed out results are listed separately just like
the crashes.
donate-cpu-server.py: Add timeout report
2020-01-24 12:33:51 +01:00
Sebastian d8e0f40663
donate-cpu/test-my-pr: Minor fixes (PEP 8, old Python 2 code, ...) (#2499)
* donate-cpu/test-my-pr: Minor fixes (PEP 8, old Python 2 code, ...)

* test-my-pr.py: Add Python 3 shebang
2020-01-21 14:27:39 +01:00
Sebastian 7c7b0e55ed
daca2-getpackages.py: Fix #9508: Add support for xz compressed archives (#2493)
Using .tar.xz packages adds about 4500 additional packages that can be
tested and changes many existing packages where a more recent version
can be used now that is only available as .tar.xz file.

Related ticket: https://trac.cppcheck.net/ticket/9508

donate-cpu.py: Require at least Python 3.4
xz support was added with 3.3.
2020-01-17 12:23:07 +01:00
Sebastian cd9ec5aac6
daca@home client: Require at least Python 3 from now on (#2491)
This makes it possible to implement new features like .tar.xz support
(see https://trac.cppcheck.net/ticket/9508) or aborting endlessly
running analysis via timeout (see
https://sourceforge.net/p/cppcheck/discussion/development/thread/86813a8a53/).
2020-01-16 20:01:46 +01:00
Sebastian 1b28fb2d1a
donate-cpu.py: Verify argument for jobs (-jN) (#2386)
Yesterday, I observed that some client with a wrong jobs setting
(only "-j") requested one package after another and always uploaded
results where it only said that the argument "-j" is invalid for
Cppcheck.
This check should avoid such cases where results are overwritten with
useless data and the server is kept busy for nothing.
2019-11-22 22:04:41 +01:00
Sebastian b93321e038
donate-cpu.py: Add shebang, warn when run under Python 2 (#2336)
Add shebang to run the client via Python 3 by default.
Add warning if Python 2 is used.
As discussed in the forum https://sourceforge.net/p/cppcheck/discussion/development/thread/86813a8a53/ switching to Python 3 has some benefits.
2019-11-09 18:18:57 +01:00
Sebastian 83caedec8a
donate-cpu.py: Fix two pylint warnings (#2327)
Line 102: Comparison to literal
Line 117: Unnecessary "else" after "break"
2019-11-04 18:36:14 +01:00
Maksim Derbasov 2500964b58 [tools] test-my-PR functionality (#2288)
* test my PR functionallity

* Improvement for test-my-pr script

* test-my-pr align master with branch
2019-10-23 09:12:15 +02:00
Sebastian 478625c802
kde.cfg: Add KDE configuration and tests (#2278)
Reference: https://kde.org
2019-10-17 21:29:32 +02:00
Sebastian bf8f96255b
donate-cpu.py: Add internal timing information of Cppcheck to output (#2217)
* donate-cpu.py: Add internal timing information of Cppcheck to output

The option "--showtime=top5" is added to the Cppcheck command line.
The timing output is collected and only for HEAD it is shown in the new
category "head-timing-info" in the results output.
The timing output is indented with one white space, so even in the
unlikely case that a function is named "head result:" or "diff:" it does
not break the parser in the server.

* donate-cpu.py: Also print the "old" timing information for comparison
2019-09-28 22:09:58 +02:00
Sebastian 8207fb7b14
cairo.cfg: Add library configuration/tests/... for cairo library (#2176)
Reference: https://www.cairographics.org/
2019-09-19 08:48:04 +02:00
Sebastian fe236dbdc4 donate-cpu.py: Improve Qt library detection (#2171)
Some projects only use this (older?) style of Qt header inclusion.
There are (older) books and examples which use this style, too.
It seems to be perfectly valid, so we should support it.
2019-09-12 15:14:18 +02:00
Rikard Falkeborn 32eb6e1b19 donate-cpu: Only check libraries once (#2158)
There is no point in checking which libraries to use for each cppcheck
version since there is no change. Refactor the checking to a separate
function and run that once instead. This halves the time it takes to
check for libraries.
2019-09-09 13:42:57 +02:00
Daniel Marjamäki 92ab7c6b92 donate-cpu: switch to new server 2019-09-06 22:28:34 +02:00
Sebastian 1c77661b7e donate-cpu.py: Improve detection of Ruby library usage (#2148)
I looked into many packages where the detection failed and they all use
`#include "ruby.h"`. Some of these packages seem to be Ruby modules,
others seem to be "normal" software.
2019-09-05 20:33:12 +02:00
Rikard Falkeborn 02fd1ac7f7 donate-cpu: Show cppcheck head git hash and commit time (#2096)
This adds one line in the package report to show the git hash and commit
date. This makes it possible to see exactely which revision the result
was obtained with.

The cppcheck head info line is now shown as

	head-info: 1a25d3f9e (2019-08-30 18:34:14 +0200)
2019-09-05 09:08:45 +02:00
Sebastian 901565233b
donate-cpu.py: Enable detection of new library configurations (#2139) 2019-09-02 11:32:50 +02:00
Sebastian a501f65c8c
libcurl.cfg: Add library configuration for libcurl (#2120)
Add curl_easy_*() functions and deprecated functions with warnings.
Add tests and prepare donate-cpu.py
Reference: https://curl.haxx.se/libcurl/c/
2019-08-29 15:11:59 +02:00
Sebastian 8782a5f5e4
lua.cfg: Add Lua C API library configuration with tests (#2119) 2019-08-29 11:38:21 +02:00
Sebastian cf7616a5cf donate-cpu.py: Improve detection of SDL library usage. (#2116)
Add more commonly used includes for SDL headers.
2019-08-27 13:09:56 +02:00
Rikard Falkeborn 9a7089d262 donate-cpu.py: Try a fresh clone if fail to update (#2105)
Check if fetching and updating the cppcheck sources are successful. If
not successful after five retries, try removing the existing clone and
checkout again.
2019-08-27 06:48:00 +02:00
Sebastian 486170489a donate-cpu.py: Use "gtk" library cfg if "<gnome.h>" is included. (#2103)
Gnome includes GTK+, GLib and other libraries, see
https://developer.gnome.org/platform-overview/unstable/tech.html.en
Some projects simply include "<gnome.h>" and use Gtk/GLib functions.
2019-08-20 21:24:49 +02:00
Sebastian ee72bb7107
donate-cpu.py: Improve detection of Qt library usage (#2042) 2019-07-26 13:50:04 +02:00
Sebastian 6d1ce99dce
donate-cpu.py: Do not report crash if no source file has been found. (#2028)
Sometimes there are no relevant source files (.c, .cpp, ...) extracted,
but other files are (.h, ...).
There could be only header files for example. Then Cppcheck returns with
exit code 1 and prints an error message. This is no crash and now no
longer reported as such.
2019-07-26 10:15:09 +02:00
Oliver Stöneberg 4561229906 donate-cpu.py: treat signal 6 (SIGABRT) as crash as well so we get a … (#1995)
* donate-cpu.py: treat signal 6 (SIGABRT) as crash as well so we get a stack trace in the result

* donate-cpu.py: simplified returncode/signal check / also generate stack traces for SIGILL, SIGFPE, SIGBUS

* donate-cpu.py: avoid usage of "not" in if

* donate-cpu.py: do not overwrite returncode in crash handling
2019-07-15 15:37:31 +02:00
Sebastian 9b1066f0bc donate-cpu.py: Enable sqlite3 library for local includes. (#1973)
Many projects use a local copy of the sqlite3 library and several of
them use local includes.
2019-07-09 15:59:00 +02:00
Sebastian c45dff1e1d
openmp.cfg: Add library configuration for OpenMP (#1956)
See https://www.openmp.org/
2019-07-05 03:00:52 +02:00
Sebastian fd3e1ceefc
donate-cpu.py: Enable new libraries (planned after release of 1.88) (#1940)
Tested locally
2019-07-01 10:40:10 +02:00
Daniel Marjamäki 423e23b430 donate-cpu: changed names 2019-06-30 12:43:05 +02:00